krishvishal commented on code in PR #2916:
URL: https://github.com/apache/iggy/pull/2916#discussion_r2967633910
##########
core/metadata/src/impls/metadata.rs:
##########
@@ -325,3 +432,35 @@ where
send_prepare_ok_common(consensus, header, Some(persisted)).await;
}
}
+
+#[allow(unused)]
+impl<C, J, S, M> IggyMetadata<C, J, S, M> {
+ /// Create a snapshot from the current state machine and persist it to
disk.
+ ///
+ /// After the snapshot is durably persisted, advances the journal's
+ /// snapshot watermark so that entries at or below `last_op` may be
+ /// evicted from the ring buffer on future appends.
+ ///
+ /// # Errors
+ /// Returns `SnapshotError` if snapshotting, persistence, or compaction
fails.
+ #[allow(clippy::future_not_send)]
+ pub async fn checkpoint(&self, data_dir: &Path, last_op: u64) ->
Result<(), SnapshotError>
Review Comment:
Done.
##########
core/metadata/src/impls/metadata.rs:
##########
@@ -99,6 +140,37 @@ pub struct IggyMetadata<C, J, S, M> {
pub snapshot: Option<S>,
/// State machine - lives on all shards
pub mux_stm: M,
+ /// Root data directory, used by checkpoint to persist snapshots.
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]