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

Method propose_checkpoint

nodedb-cluster/src/migration_executor/executor.rs:189–218  ·  view source on GitHub ↗
(
        &self,
        migration_id: MigrationId,
        attempt: u32,
        payload: MigrationCheckpointPayload,
    )

Source from the content-addressed store, hash-verified

187 }
188
189 pub(super) async fn propose_checkpoint(
190 &self,
191 migration_id: MigrationId,
192 attempt: u32,
193 payload: MigrationCheckpointPayload,
194 ) -> Result<()> {
195 let Some(proposer) = &self.metadata_proposer else {
196 return Ok(());
197 };
198
199 let ts_ms = SystemTime::now()
200 .duration_since(UNIX_EPOCH)
201 .unwrap_or_default()
202 .as_millis() as u64;
203
204 let crc32c = payload.crc32c()?;
205 let phase = payload.phase_tag();
206
207 let entry = Entry::MigrationCheckpoint {
208 migration_id: migration_id.hyphenated().to_string(),
209 phase,
210 attempt,
211 payload,
212 crc32c,
213 ts_ms,
214 };
215
216 proposer.propose_and_wait(entry).await?;
217 Ok(())
218 }
219}
220
221#[cfg(test)]

Callers 3

phase1_base_copyFunction · 0.80
phase2_wal_catchupFunction · 0.80
phase3_cutoverFunction · 0.80

Calls 7

nowFunction · 0.85
duration_sinceMethod · 0.80
crc32cMethod · 0.80
phase_tagMethod · 0.80
to_stringMethod · 0.80
as_millisMethod · 0.45
propose_and_waitMethod · 0.45

Tested by

no test coverage detected