Skip to content

Commit

Permalink
Only get block contexts once (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Oct 23, 2023
1 parent bc3cdb4 commit 14c8eb7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions downstairs/src/extent_inner_sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,14 @@ impl SqliteInner {
let ctxs = self.get_block_contexts(0, self.extent_size.value)?;
let needs_rehash = ctxs.iter().any(|c| c.len() > 1);

if needs_rehash {
let ctxs = if needs_rehash {
// Clean up stale hashes. After this is done, each block should
// have either 0 or 1 contexts.
self.fully_rehash_and_clean_all_stale_contexts(true)?;
}

let ctxs = self.get_block_contexts(0, self.extent_size.value)?;
self.get_block_contexts(0, self.extent_size.value)?
} else {
ctxs
};

use crate::{
extent::EXTENT_META_RAW,
Expand Down

0 comments on commit 14c8eb7

Please sign in to comment.