From c27a21469bfa22fbfadd792bb9cd61d5983b8b0a Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 18 Jul 2024 13:16:21 -0700 Subject: [PATCH] Commit twice to work around redb off-by-one bug (#3856) --- src/index/updater.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index/updater.rs b/src/index/updater.rs index b0afd4459a..0d311be8e6 100644 --- a/src/index/updater.rs +++ b/src/index/updater.rs @@ -837,6 +837,10 @@ impl<'index> Updater<'index> { Index::increment_statistic(&wtx, Statistic::Commits, 1)?; wtx.commit()?; + // Commit twice since due to a bug redb will only reuse pages freed in the + // transaction before last. + self.index.begin_write()?.commit()?; + Reorg::update_savepoints(self.index, self.height)?; Ok(())