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

Method max_committed_offset

crates/commitlog/src/commitlog.rs:164–170  ·  view source on GitHub ↗

The last transaction offset written to disk, or `None` if nothing has been written yet. Note that this does not imply durability: [`Self::sync`] may not have been called at this offset.

(&self)

Source from the content-addressed store, hash-verified

162 /// Note that this does not imply durability: [`Self::sync`] may not have
163 /// been called at this offset.
164 pub fn max_committed_offset(&self) -> Option<u64> {
165 // Naming is hard: the segment's `next_tx_offset` indicates how many
166 // txs are already in the log (it's the next commit's min-tx-offset).
167 // If the value is zero, however, the initial commit hasn't been
168 // committed yet.
169 self.head.next_tx_offset().checked_sub(1)
170 }
171
172 /// The first transaction offset written to disk, or `None` if nothing has
173 /// been written yet.

Callers

nothing calls this directly

Calls 2

checked_subMethod · 0.45
next_tx_offsetMethod · 0.45

Tested by

no test coverage detected