From 5cdfa89594844f62b2ab0705bd25a69d6bac7c71 Mon Sep 17 00:00:00 2001 From: Michael Constant Date: Mon, 18 Nov 2024 05:21:01 -0800 Subject: [PATCH] No need to flush non-durable commits anymore We no longer need special-case code to flush non-durable commits on shutdown, since Database::drop() now guarantees that the last commit before shutdown is a durable commit with quick-repair enabled --- src/tree_store/page_store/page_manager.rs | 30 ----------------------- 1 file changed, 30 deletions(-) diff --git a/src/tree_store/page_store/page_manager.rs b/src/tree_store/page_store/page_manager.rs index 128b01a8..b441602b 100644 --- a/src/tree_store/page_store/page_manager.rs +++ b/src/tree_store/page_store/page_manager.rs @@ -1135,36 +1135,6 @@ impl Drop for TransactionalMemory { return; } - // Commit any non-durable transactions that are outstanding - if self.read_from_secondary.load(Ordering::Acquire) - && !self.needs_recovery.load(Ordering::Acquire) - { - if let Ok(non_durable_transaction_id) = self.get_last_committed_transaction_id() { - let root = self.get_data_root(); - let system_root = self.get_system_root(); - let freed_root = self.get_freed_root(); - if self - .commit( - root, - system_root, - freed_root, - non_durable_transaction_id, - false, - true, - ) - .is_err() - { - #[cfg(feature = "logging")] - warn!( - "Failure while finalizing non-durable commit. Database may have rolled back" - ); - } - } else { - #[cfg(feature = "logging")] - warn!("Failure while finalizing non-durable commit. Database may have rolled back"); - } - } - // Allocate a larger region-tracker page if necessary if self.ensure_region_tracker_page().is_err() { #[cfg(feature = "logging")]