mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
fix balance_non_root should trigger balance again
This commit is contained in:
parent
10824e3eb3
commit
1de4861414
1 changed files with 14 additions and 2 deletions
|
@ -824,6 +824,15 @@ impl BTreeCursor {
|
|||
let state = self.state.write_info().expect("must be balancing").state;
|
||||
match state {
|
||||
WriteState::BalanceStart => {
|
||||
assert!(
|
||||
self.state
|
||||
.write_info()
|
||||
.unwrap()
|
||||
.balance_info
|
||||
.borrow()
|
||||
.is_none(),
|
||||
"BalanceInfo should be empty on start"
|
||||
);
|
||||
let current_page = self.stack.top();
|
||||
{
|
||||
// check if we don't need to balance
|
||||
|
@ -1437,12 +1446,15 @@ impl BTreeCursor {
|
|||
}
|
||||
}
|
||||
// TODO: balance root
|
||||
self.stack.pop();
|
||||
// TODO: free pages
|
||||
(WriteState::Finish, Ok(CursorResult::Ok(())))
|
||||
(WriteState::BalanceStart, Ok(CursorResult::Ok(())))
|
||||
}
|
||||
WriteState::Finish => todo!(),
|
||||
};
|
||||
if matches!(next_write_state, WriteState::BalanceStart) {
|
||||
// reset balance state
|
||||
let _ = self.state.mut_write_info().unwrap().balance_info.take();
|
||||
}
|
||||
let write_info = self.state.mut_write_info().unwrap();
|
||||
write_info.state = next_write_state;
|
||||
result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue