Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH 0/3] Another applier ACKs rework
@ 2020-07-05 15:20 Vladislav Shpilevoy
  2020-07-05 15:20 ` [Tarantool-patches] [PATCH 1/3] txn: introduce on_wal_write trigger Vladislav Shpilevoy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vladislav Shpilevoy @ 2020-07-05 15:20 UTC (permalink / raw)
  To: tarantool-patches, sergepetrenko

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-05 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05 15:20 [Tarantool-patches] [PATCH 0/3] Another applier ACKs rework Vladislav Shpilevoy
2020-07-05 15:20 ` [Tarantool-patches] [PATCH 1/3] txn: introduce on_wal_write trigger Vladislav Shpilevoy
2020-07-05 15:20 ` [Tarantool-patches] [PATCH 2/3] applier: don't miss WAL writes happened during ACK send Vladislav Shpilevoy
2020-07-05 15:20 ` [Tarantool-patches] [PATCH 3/3] applier: use WAL write event instead of commit for ACK Vladislav Shpilevoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox