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

Method flush

crates/commitlog/src/lib.rs:290–296  ·  view source on GitHub ↗

Write all outstanding transaction records to disk. Note that this does **not** force the OS to sync the data to disk. Use [`Self::flush_and_sync`] or call [`Self::sync`] after this method to ensure all data is on disk. Returns the maximum transaction offset written to disk. The offset is `None` if the log is empty and no data was pending to be flushed. Repeatedly calling this method may return

(&self)

Source from the content-addressed store, hash-verified

288 ///
289 /// Repeatedly calling this method may return the same value.
290 pub fn flush(&self) -> io::Result<Option<u64>> {
291 let mut inner = self.inner.write().unwrap();
292 trace!("flush commitlog");
293 inner.flush()?;
294
295 Ok(inner.max_committed_offset())
296 }
297
298 /// Write all outstanding transaction records to disk and flush OS buffers.
299 ///

Callers 15

pid_fileMethod · 0.45
spawn_redirect_serverFunction · 0.45
insert_databaseMethod · 0.45
update_databaseMethod · 0.45
delete_databaseMethod · 0.45
insert_replicaMethod · 0.45
delete_replicaMethod · 0.45
_insert_nodeMethod · 0.45
_update_nodeMethod · 0.45

Calls 4

OkFunction · 0.50
unwrapMethod · 0.45
writeMethod · 0.45
max_committed_offsetMethod · 0.45

Tested by 4

spawn_redirect_serverFunction · 0.36
all_segments_sealedFunction · 0.36
resume_empty_segmentFunction · 0.36