From fe7a108ce571be7e63bca0074565d85222ec107a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 21 Nov 2026 19:00:32 -0800 Subject: [PATCH] volume(rs): an EC sync does not wait for a journal append in flight CopyFile syncs the EC volume under the store read lock, and the .ecj sync now took the journal lock, so it waited out a delete's fsync with the store guard held. Every committed append already syncs its own record, so skip the journal while one holds its lock. Co-Authored-By: Claude Opus 5.5 --- seaweed-volume/src/storage/erasure_coding/ec_volume.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/seaweed-volume/src/storage/erasure_coding/ec_volume.rs b/seaweed-volume/src/storage/erasure_coding/ec_volume.rs index 8b14811d95..d29b880f65 100644 --- a/seaweed-volume/src/storage/erasure_coding/ec_volume.rs +++ b/seaweed-volume/src/storage/erasure_coding/ec_volume.rs @@ -1558,8 +1558,12 @@ impl EcVolume { /// Sync the EC volume's journal and index files to disk (matching Go's ecv.Sync()). /// Go flushes both .ecj and .ecx to ensure in-place deletion marks are persisted. pub fn sync_to_disk(&self) -> io::Result<()> { - if let Some(ref ecj_file) = self.journal().file { - ecj_file.sync_all()?; + // Every append syncs its own record, so one in flight is not waited + // for: callers such as CopyFile hold the store lock here. + if let Ok(journal) = self.ecj.try_lock() { + if let Some(ref ecj_file) = journal.file { + ecj_file.sync_all()?; + } } if let Some(ref ecx_file) = self.ecx_file { ecx_file.sync_all()?;