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

Method start_cutover

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

Attempt to start Phase 3: Atomic Cut-over. Returns `Err` if the estimated pause would exceed the budget.

(&mut self, estimated_pause_us: u64)

Source from the content-addressed store, hash-verified

159 ///
160 /// Returns `Err` if the estimated pause would exceed the budget.
161 pub fn start_cutover(&mut self, estimated_pause_us: u64) -> crate::Result<()> {
162 if estimated_pause_us > self.write_pause_budget_us {
163 warn!(
164 vshard = self.vshard_id,
165 estimated_us = estimated_pause_us,
166 budget_us = self.write_pause_budget_us,
167 "refusing cut-over: pause exceeds budget"
168 );
169 return Err(crate::ClusterError::MigrationPauseBudgetExceeded {
170 estimated_us: estimated_pause_us,
171 budget_us: self.write_pause_budget_us,
172 });
173 }
174
175 self.phase = MigrationPhase::AtomicCutOver {
176 pause_start_us: estimated_pause_us,
177 };
178 info!(
179 vshard = self.vshard_id,
180 estimated_pause_us, "starting atomic cut-over"
181 );
182 Ok(())
183 }
184
185 /// Complete the migration.
186 pub fn complete(&mut self, actual_pause_us: u64) {

Callers 3

full_lifecycleFunction · 0.80
pause_budget_exceededFunction · 0.80
phase3_cutoverFunction · 0.80

Calls

no outgoing calls

Tested by 2

full_lifecycleFunction · 0.64
pause_budget_exceededFunction · 0.64