From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (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 5518943D678 for ; Tue, 22 Oct 2019 02:02:08 +0300 (MSK) References: <0b5ca0bc9f891c3c5363a0e3275c662f93a813de.1570639218.git.georgy@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Tue, 22 Oct 2019 01:07:23 +0200 MIME-Version: 1.0 In-Reply-To: <0b5ca0bc9f891c3c5363a0e3275c662f93a813de.1570639218.git.georgy@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [tarantool-patches] [PATCH v3 4/4] replication: use wal memory buffer to fetch rows List-Id: Tarantool development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@freelists.org, Georgy Kirichenko , tarantool-patches@dev.tarantool.org Thanks for the patch! On 09/10/2019 18:45, Georgy Kirichenko wrote: > Fetch data from wal in-memory buffer. Wal allows to start a fiber > which creates a xrow buffer cursor with given vclock and then fetches > row from the xrow buffer one by one and calls given callback for each > row. Also the wal relaying fiber send a heartbeat message if all > rows were processed there were no rows written for replication timeout > period. Sorry, I didn't understand the last sentence. Maybe if all rows were processed *and* there were no rows? See 2 comments below. > Relay connects to wal with a replica known vclock and tries to > relay data. In case of outdated vclock (wal could not create a cursor > or fetch new row from the cursor) the relay makes a fallback in > order to read logged data from file and then makes another try > to connect to wal with updated vclock and so waiter. > In file mode a relay already has a data to send to a replica so from > not the relay has not any duty to send heartbeat messages - it 1. 'so from not the relay has not' - I didn't understand it. Could you please rephrase? > is done by wal relay fiber while it waits for new transactions > written by wal. > > Closes #3794 > --- > src/box/relay.cc | 180 +++++++++--------- > src/box/wal.c | 158 +++++++++++++++ > src/box/wal.h | 60 ++++++ > src/lib/core/cbus.c | 4 + > src/lib/core/errinj.h | 1 + > test/box/errinj.result | 2 + > test/replication/force_recovery.result | 8 + > test/replication/force_recovery.test.lua | 2 + > test/replication/replica_rejoin.result | 8 + > test/replication/replica_rejoin.test.lua | 2 + > .../show_error_on_disconnect.result | 8 + > .../show_error_on_disconnect.test.lua | 2 + > test/replication/suite.ini | 2 +- > test/xlog/panic_on_wal_error.result | 12 ++ > test/xlog/panic_on_wal_error.test.lua | 3 + > test/xlog/suite.ini | 2 +- > 16 files changed, 365 insertions(+), 89 deletions(-) > > diff --git a/test/replication/force_recovery.result b/test/replication/force_recovery.result > index f50452858..e48c12657 100644 > --- a/test/replication/force_recovery.result > +++ b/test/replication/force_recovery.result > @@ -16,6 +16,10 @@ _ = box.space.test:create_index('primary') > box.schema.user.grant('guest', 'replication') > --- > ... > +box.error.injection.set("ERRINJ_WAL_MEM_IGNORE", true) 2. Unfortunately, you can't set error injections in Release mode. It means, that all these injection.set are nop in Release. Please, remove them. If you want to use an error injection, you need to write a special test file, and disable it for the Release build. > +--- > +- ok > +... > -- Deploy a replica. > test_run:cmd("create server test with rpl_master=default, script='replication/replica.lua'") > ---