vinyl: fix !vy_tx_is_in_read_view assertion failure in vy_tx_prepare
Commit 4d52199e ("box: fix transaction "read-view" and "conflicted" states") updated vy_tx_send_to_read_view so that now it aborts all RW transactions right away instead of sending them to read view and aborting them on commit. It also updated vy_tx_begin_statement to fail if a transaction sent to a read view tries to do DML. With all that, we assume that there cannot possibly be an RW transaction sent to read view so we have an assertion checking that in vy_tx_commit. However, this assertion may fail, because a DML statement may yield on disk read before it writes anything to the write set. If this is the first statement in a transaction, the transaction is technically read-only and we will send it to read-view instead of aborting it. Once it completes the disk read, it will apply the statement and hence become read-write, breaking our assumption in vy_tx_commit. Fix this by aborting RW transactions sent to read-view in vy_tx_set. Follow-up #7240 NO_DOC=bug fix NO_CHANGELOG=unreleased
Please register or sign in to comment