diff --git a/crates/cold/src/task/runner.rs b/crates/cold/src/task/runner.rs index b0a2114..43ff773 100644 --- a/crates/cold/src/task/runner.rs +++ b/crates/cold/src/task/runner.rs @@ -331,6 +331,12 @@ impl ColdStorageTask { debug!("Cold storage write channel closed"); break; }; + // Drain in-flight reads before executing the write to + // ensure exclusive access to the backend. + self.task_tracker.close(); + self.task_tracker.wait().await; + self.task_tracker.reopen(); + self.inner.handle_write(req).await; }