MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / is_catchup_ready

Method is_catchup_ready

nodedb-cluster/src/migration.rs:144–156  ·  view source on GitHub ↗

Check if WAL lag is low enough to proceed to cut-over.

(&self)

Source from the content-addressed store, hash-verified

142
143 /// Check if WAL lag is low enough to proceed to cut-over.
144 pub fn is_catchup_ready(&self) -> bool {
145 if let MigrationPhase::WalCatchUp {
146 current_lsn,
147 source_lsn,
148 ..
149 } = self.phase
150 {
151 // Sub-millisecond lag = within 10 LSN entries.
152 source_lsn.saturating_sub(current_lsn) <= 10
153 } else {
154 false
155 }
156 }
157
158 /// Attempt to start Phase 3: Atomic Cut-over.
159 ///

Callers 1

phase2_wal_catchupFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected