Skip to content

Commit

Permalink
fix: unused assert when allocing page with fsm (#15)
Browse files Browse the repository at this point in the history
fix #14 

Previously we don't use fsm, so we can assert the allocated page number
is continous. Now we have updated to use fsm and virtual pages, so these
assertions are not needed.

Signed-off-by: Mingzhuo Yin <[email protected]>
  • Loading branch information
silver-ymz authored Dec 13, 2024
1 parent 1b39095 commit fd29c83
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion src/index/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ unsafe fn write_down(state: &BuildState) {
}
let delete_bitmap_blkno = delete_bitmap_writer.finalize();

// term info
// term stat
let mut term_stat_writer = PageWriter::new(state.index, PageFlags::TERM_STATISTIC, true);
for count in state.builder.term_stat() {
term_stat_writer.write(&count.to_le_bytes());
Expand Down
12 changes: 0 additions & 12 deletions src/page/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ impl PageWriterInitFork {
fn change_page(&mut self) {
let mut old_page = self.page.take().unwrap();
let new_page = page_alloc_init_forknum(self.relation, self.flag);
assert!(
old_page.blkno() + 1 == new_page.blkno(),
"old: {}, new: {}",
old_page.blkno(),
new_page.blkno()
);
old_page.opaque.next_blkno = new_page.blkno();
self.page = Some(new_page);
}
Expand Down Expand Up @@ -112,12 +106,6 @@ impl PageWriter {
fn change_page(&mut self) {
let mut old_page = self.page.take().unwrap();
let new_page = page_alloc_with_fsm(self.relation, self.flag, self.skip_lock_rel);
assert!(
old_page.blkno() + 1 == new_page.blkno(),
"old: {}, new: {}",
old_page.blkno(),
new_page.blkno()
);
old_page.opaque.next_blkno = new_page.blkno();
self.page = Some(new_page);
}
Expand Down

0 comments on commit fd29c83

Please sign in to comment.