[Tarantool-patches] [PATCH 0/3] Another applier ACKs rework
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Sun Jul 5 18:20:13 MSK 2020
The solved issues:
https://github.com/tarantool/tarantool/issues/5127
https://github.com/tarantool/tarantool/issues/5100
In the previous solution I used txn->fiber set to applier's writer
fiber. So as it would be woken up when the transaction's WAL write
is done.
This hack worked but then I found the issue 5127. And it appeared
that just fiber_wakeup() is not enough. This patchset attempts to
solve both issues.
Among all the solutions I described in 5127 the chosen approach
with a new trigger list for txn looks the least crutchy. It adds
16 bytes to struct txn, but I realized it shouldn't be a problem,
because transactions end up in a cache from which they are
obtained for O(1) time regardless of their size.
Also triggers are not set for the normal transactions on the
master (not on_commit, nor on_wal_write, nor on_rollback), so it
shouldn't affect the speed either.
But it can be optimized in future. For example, I see that
on_wal_write and on_commit are never used together. So we could
merge them into a union someday.
Branch: http://github.com/tarantool/tarantool/tree/gh-4842-sync-replication
Issue: https://github.com/tarantool/tarantool/issues/4842
Vladislav Shpilevoy (3):
txn: introduce on_wal_write trigger
applier: don't miss WAL writes happened during ACK send
applier: use WAL write event instead of commit for ACK
src/box/applier.cc | 72 ++++++++++------
src/box/applier.h | 7 ++
src/box/replication.cc | 2 +-
src/box/replication.h | 4 +-
src/box/txn.c | 29 ++++++-
src/box/txn.h | 10 ++-
src/lib/core/errinj.h | 1 +
test/replication/qsync_basic.result | 59 ++++++++++++-
test/replication/qsync_basic.test.lua | 32 ++++++-
test/replication/qsync_errinj.result | 114 +++++++++++++++++++++++++
test/replication/qsync_errinj.test.lua | 46 ++++++++++
11 files changed, 341 insertions(+), 35 deletions(-)
create mode 100644 test/replication/qsync_errinj.result
create mode 100644 test/replication/qsync_errinj.test.lua
--
2.21.1 (Apple Git-122.3)
More information about the Tarantool-patches
mailing list