txn: assert after WAL write that txn is not done
In the journal write trigger the transaction assumed it might be already rolled back and completed, hence does not need to do anything except free itself. But it can't happen. The only imaginable reason why a transaction might be rolled back before it completed its WAL write is a ROLLBACK entry issued after the transaction. But ROLLBACK applies its effects only after it is written. Hence only after all the other pending txns are written too. Therefore it is not possible for a transaction to get ROLLBACK before it finishes its own WAL write. Probably it was possible in the time when applier used to execute ROLLBACK before writing it to WAL. But that was fixed in b259e930 ("applier: process synchro rows after WAL write"). Can't happen now. This became easier to realize when not finished transaction signature got its own value TXN_SIGNATURE_UNKNOWN.
Please register or sign in to comment