MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / sync

Method sync

crates/commitlog/src/commitlog.rs:135–141  ·  view source on GitHub ↗

Force the currently active segment to be flushed to storage. Using a filesystem backend, this means to call `fsync(2)`. Note** that this does not flush the buffered data from calls to [Self::commit], it only instructs the underlying storage to flush its buffers. Call [Self::flush] prior to this method to ensure data from all previous [Self::commit] calls is flushed to the underlying storage. #

(&mut self)

Source from the content-addressed store, hash-verified

133 /// this method panics in this case, thereby preventing any further writes
134 /// to the log and forcing the user to re-read the state from disk.
135 pub fn sync(&mut self) {
136 self.panicked = true;
137 if let Err(e) = self.head.fsync() {
138 panic!("Failed to fsync segment: {e}");
139 }
140 self.panicked = false;
141 }
142
143 /// Flush the buffered data from previous calls to [Self::commit] to the
144 /// underlying storage.

Callers 2

flush_and_syncMethod · 0.45
commitMethod · 0.45

Calls 1

fsyncMethod · 0.45

Tested by

no test coverage detected