From 1785d7608d4f73ffa3771696ad7f21bf2b2b074c Mon Sep 17 00:00:00 2001 From: Croxx Date: Thu, 11 Apr 2024 15:55:18 +0800 Subject: [PATCH] fix: do not truncate when open wal (#322) Signed-off-by: MrCroxx --- foyer-experimental/src/wal.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/foyer-experimental/src/wal.rs b/foyer-experimental/src/wal.rs index c5df56d6..7d2673f5 100644 --- a/foyer-experimental/src/wal.rs +++ b/foyer-experimental/src/wal.rs @@ -143,12 +143,9 @@ impl TombstoneLog { path.push(format!("tombstone-{:08X}", config.id)); - let file = OpenOptions::new() - .write(true) - .read(true) - .create(true) - .truncate(true) - .open(path)?; + // TODO(MrCroxx): use `expect` after `lint_reasons` is stable. + #[allow(clippy::suspicious_open_options)] + let file = OpenOptions::new().write(true).read(true).create(true).open(path)?; let inner = Arc::new(TombstoneLogInner { inflights: Mutex::new(vec![]),