[tarantool-patches] [PATCH v5 1/2] Journal transaction boundaries
vdavydov.dev at gmail.com
Thu Feb 21 19:25:38 MSK 2019
On Thu, Feb 21, 2019 at 06:29:16PM +0300, Georgy Kirichenko wrote:
> Append txn_id and is_commit to xrow_header structure, txn_id identifies
> transaction id on replica where transaction was started. As transaction id
> a lsn of the first row in the transaction is used. is_commit is set to true
> for the last row in a transaction.
> As encoding/deconding rule assumed:
> * txn_id encoded using transaction sequence number iproto field
> as IPROTO_TSN = lsn - txn_id,
> * is_commit packed into IPROTO_FLAGS field with a bit mask,
> * txn_id and is_commit are encoded only for multi-row transactions.
> So if we do not have txn_id after row decoding then this means that it
> is a single row transaction.
> These rules provide compatibility with previous xlog format as well
> as good compaction level.
> Needed for: 2798
> src/box/iproto_constants.c | 8 +--
> src/box/iproto_constants.h | 7 +++
> src/box/lua/xlog.c | 10 +++
> src/box/wal.c | 5 ++
> src/box/xrow.c | 41 +++++++++++++
> src/box/xrow.h | 4 +-
> test/unit/xrow.cc | 2 +
> test/xlog/transaction.result | 108 +++++++++++++++++++++++++++++++++
> test/xlog/transaction.test.lua | 46 ++++++++++++++
> 9 files changed, 226 insertions(+), 5 deletions(-)
> create mode 100644 test/xlog/transaction.result
> create mode 100644 test/xlog/transaction.test.lua
Pushed this one to 2.1.
More information about the Tarantool-patches