[Tarantool-patches] [tarantool-patches] [PATCH v3 4/4] replication: use wal memory buffer to fetch rows
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Oct 22 02:07:23 MSK 2019
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'")
> ---
More information about the Tarantool-patches
mailing list