From 66c69461fba0638e46f382d0b474c595ecdb141c Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Tue, 7 Oct 2025 10:09:39 +0530 Subject: [PATCH] Add getter/setter for checkpoint threshold in LogicalLog Wire threshold access through Storage Add checkpoint threshold accessors to MvStore --- core/mvcc/database/mod.rs | 4 ++++ core/mvcc/persistent_storage/logical_log.rs | 4 ++++ core/mvcc/persistent_storage/mod.rs | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/core/mvcc/database/mod.rs b/core/mvcc/database/mod.rs index 3c3b4aaff..5425adead 100644 --- a/core/mvcc/database/mod.rs +++ b/core/mvcc/database/mod.rs @@ -2035,6 +2035,10 @@ impl MvStore { pub fn set_checkpoint_threshold(&self, threshold: u64) { self.storage.set_checkpoint_threshold(threshold) } + + pub fn checkpoint_threshold(&self) -> u64 { + self.storage.checkpoint_threshold() + } } /// A write-write conflict happens when transaction T_current attempts to update a diff --git a/core/mvcc/persistent_storage/logical_log.rs b/core/mvcc/persistent_storage/logical_log.rs index ee572f225..a902bac98 100644 --- a/core/mvcc/persistent_storage/logical_log.rs +++ b/core/mvcc/persistent_storage/logical_log.rs @@ -235,6 +235,10 @@ impl LogicalLog { pub fn set_checkpoint_threshold(&mut self, threshold: u64) { self.checkpoint_threshold = threshold; } + + pub fn checkpoint_threshold(&self) -> u64 { + self.checkpoint_threshold + } } pub enum StreamingResult { diff --git a/core/mvcc/persistent_storage/mod.rs b/core/mvcc/persistent_storage/mod.rs index 1cc8d0c2b..ede456bc3 100644 --- a/core/mvcc/persistent_storage/mod.rs +++ b/core/mvcc/persistent_storage/mod.rs @@ -49,6 +49,10 @@ impl Storage { .unwrap() .set_checkpoint_threshold(threshold) } + + pub fn checkpoint_threshold(&self) -> u64 { + self.logical_log.read().unwrap().checkpoint_threshold() + } } impl Debug for Storage {