(
&self,
migration_id: MigrationId,
attempt: u32,
payload: MigrationCheckpointPayload,
)
| 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)] |
no test coverage detected