mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-07 09:14:26 +01:00
keep track when fsync is called
This commit is contained in:
@@ -31,6 +31,8 @@ pub(crate) struct SimulatorFile {
|
||||
pub(crate) rng: RefCell<ChaCha8Rng>,
|
||||
|
||||
pub latency_probability: usize,
|
||||
|
||||
pub sync_completion: RefCell<Option<Arc<limbo_core::Completion>>>,
|
||||
}
|
||||
|
||||
unsafe impl Send for SimulatorFile {}
|
||||
@@ -185,7 +187,9 @@ impl File for SimulatorFile {
|
||||
};
|
||||
sync_completion.complete = Box::new(new_complete);
|
||||
};
|
||||
self.inner.sync(c)
|
||||
let c = self.inner.sync(c)?;
|
||||
*self.sync_completion.borrow_mut() = Some(c.clone());
|
||||
Ok(c)
|
||||
}
|
||||
|
||||
fn size(&self) -> Result<u64> {
|
||||
|
||||
@@ -85,6 +85,7 @@ impl IO for SimulatorIO {
|
||||
page_size: self.page_size,
|
||||
rng: RefCell::new(ChaCha8Rng::seed_from_u64(self.seed)),
|
||||
latency_probability: self.latency_probability,
|
||||
sync_completion: RefCell::new(None),
|
||||
});
|
||||
self.files.borrow_mut().push(file.clone());
|
||||
Ok(file)
|
||||
|
||||
Reference in New Issue
Block a user