Skip to content

Commit

Permalink
No need to flush non-durable commits anymore
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mconst authored and cberner committed Nov 25, 2024
1 parent 36c07ab commit 71e3b41
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/tree_store/page_store/page_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit 71e3b41

Please sign in to comment.