From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 2C1EF445320 for ; Sun, 5 Jul 2020 18:20:18 +0300 (MSK) From: Vladislav Shpilevoy Date: Sun, 5 Jul 2020 17:20:13 +0200 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 0/3] Another applier ACKs rework List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org 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)