txn: remove TXN_IS_DONE check from txn_commit()
TXN_IS_DONE was used in txn_commit() to finalize the transaction
in a case it is not finished yet. But this happens only not in
so common cases - during bootstrap and recovery. During normal
operation the transaction is always finished when WAL thread
returns it to TX thread after a disk write.
So this is a matter of journal, and should be solved here, not in
txn code with some crutch, especially in such a hot path place.
This commit makes so that after journal_write() the transaction is
always already done, i.e. txn_complete_async() was called. Nothing
changes for the normal operation mode except this is -1 'if'.
Also the commit disables snap_quorum_delay.test, which uses
internal API of replication and txn modules assuming the journal
is initialized somewhere inside. But now it is not, and it can't
be fixed in a sane way inside the test. It will be
deleted/rewritten later.
Acked-by:
Cyrill Gorcunov <gorcunov@gmail.com>
Showing
- src/box/box.cc 27 additions, 9 deletionssrc/box/box.cc
- src/box/journal.c 1 addition, 44 deletionssrc/box/journal.c
- src/box/journal.h 0 additions, 11 deletionssrc/box/journal.h
- src/box/txn.c 2 additions, 4 deletionssrc/box/txn.c
- src/box/wal.c 1 addition, 1 deletionsrc/box/wal.c
- test/unit/suite.ini 1 addition, 0 deletionstest/unit/suite.ini
Loading
Please register or sign in to comment