end read tx in op_transaction when write transaction return io

This commit is contained in:
meteorgan
2025-07-21 23:31:32 +08:00
parent 7ef50e0690
commit 08f1803a6b

View File

@@ -1967,10 +1967,17 @@ pub fn op_transaction(
}
if updated && matches!(new_transaction_state, TransactionState::Write { .. }) {
if let LimboResult::Busy = return_if_io!(pager.begin_write_tx()) {
pager.end_read_tx()?;
tracing::trace!("begin_write_tx busy");
return Ok(InsnFunctionStepResult::Busy);
match pager.begin_write_tx()? {
IOResult::Done(r) => {
if let LimboResult::Busy = r {
pager.end_read_tx()?;
return Ok(InsnFunctionStepResult::Busy);
}
}
IOResult::IO => {
pager.end_read_tx()?;
return Ok(InsnFunctionStepResult::IO);
}
}
}
if updated {