Merge 'mvcc: handle properly the case where starting pager read tx fails with busy' from Jussi Saurio

Fixes panics with `must have a read transaction to start a write
transaction` - previously we were simply ignoring these Busy errors and
thinking we have a read tx, when we actually don't.

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #3148
This commit is contained in:
Jussi Saurio
2025-09-16 15:49:10 +03:00
committed by GitHub

View File

@@ -1399,7 +1399,10 @@ impl<Clock: LogicalClock> MvStore<Clock> {
// TODO: we need to tie a pager's read transaction to a transaction ID, so that future refactors to read
// pages from WAL/DB read from a consistent state to maintiain snapshot isolation.
pager.begin_read_tx()?;
let result = pager.begin_read_tx()?;
if let crate::result::LimboResult::Busy = result {
return Err(LimboError::Busy);
}
Ok(tx_id)
}