Skip to content

Commit

Permalink
Commit twice to work around redb off-by-one bug (#3856)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Jul 18, 2024
1 parent 0b6112c commit c27a214
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit c27a214

Please sign in to comment.