From: sergos via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: "Ян Штундер" <ya.shtunder@gmail.com>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v3] replication: removing anonymous replicas from synchro quorum
Date: Thu, 11 Nov 2021 18:04:50 +0300 [thread overview]
Message-ID: <04CEC0FF-209C-4534-80BB-BF88AE097E33@tarantool.org> (raw)
In-Reply-To: <5ae7bc55-485c-d526-9c84-3cbba13b6254@tarantool.org>
Hi!
Thanks for the patch!
Just a nit in message and a question re the test below.
Sergos.
The changelog is from https://github.com/tarantool/tarantool/commit/b9feb3853fbce389471ad3022307942aa92e8ea7
> Transactions should be committed after they reach quorum of "real"
> cluster members. Therefore, anonymous replicas don't have to
I would rephrase it as ‘replicas shouldn’t participate’
> participate in the quorum.
>
>> +++ b/test/replication-luatest/gh_5418_qsync_with_anon_test.lua
>> @@ -0,0 +1,62 @@
>> +local t = require('luatest')
>> +local cluster = require('test.luatest_helpers.cluster')
>> +local helpers = require('test.luatest_helpers')
>> +
>> +local g = t.group('gh-5418', {{engine = 'memtx'}, {engine = 'vinyl'}})
>> +
>> +g.before_each(function(cg)
>> + local engine = cg.params.engine
>> +
>> + cg.cluster = cluster:new({})
>> +
>> + local box_cfg = {
>> + replication = {
>> + helpers.instance_uri('master')
>> + },
>> + replication_synchro_quorum = 2,
>> + replication_timeout = 1
>> + }
>> +
>> + cg.master = cg.cluster:build_server({alias = 'master', engine = engine, box_cfg = box_cfg})
>> +
>> + local box_cfg = {
>> + replication = {
>> + helpers.instance_uri('master'),
>> + helpers.instance_uri('replica')
>> + },
>> + replication_timeout = 1,
>> + replication_connect_timeout = 4,
>> + read_only = true,
>> + replication_anon = true
>> + }
>> +
>> + cg.replica = cg.cluster:build_server({alias = 'replica', engine = engine, box_cfg = box_cfg})
>> +
>> + cg.cluster:add_server(cg.master)
>> + cg.cluster:add_server(cg.replica)
>> + cg.cluster:start()
>> +end)
>> +
>> +
>> +g.after_each(function(cg)
>> + cg.cluster.servers = nil
>> + cg.cluster:drop()
>> +end)
>> +
>> +
>> +g.test_qsync_with_anon = function(cg)
>> + cg.master:eval("box.schema.space.create('sync', {is_sync = true})")
>> + cg.master:eval("box.space.sync:create_index('pk')")
>> + cg.master:eval("box.ctl.promote()")
>> +
>> + t.assert_error_msg_content_equals("Quorum collection for a synchronous transaction is timed out",
>> + function() cg.master:eval("return box.space.sync:insert{1}") end)
>> +
>> + -- Wait until everything is replicated from the master to the replica
>> + local vclock = cg.master:eval("return box.info.vclock")
>> + vclock[0] = nil
>> + helpers:wait_vclock(cg.replica, vclock)
>> +
By this point the insert() is replicated from the master. I wonder if ROLLBACK
will be delivered to the replica by the time of select()?
>> + t.assert_equals(cg.master:eval("return box.space.sync:select()"), {})
>> + t.assert_equals(cg.replica:eval("return box.space.sync:select()"), {})
>> +end
next prev parent reply other threads:[~2021-11-11 15:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 9:52 Yan Shtunder via Tarantool-patches
2021-10-25 13:32 ` Serge Petrenko via Tarantool-patches
[not found] ` <CAP94r39r6HMBxDDShO5qTYVBPz9kLVgRvaSBq8n6F+BUn1m4xw@mail.gmail.com>
2021-10-29 8:06 ` Serge Petrenko via Tarantool-patches
[not found] ` <CAP94r3_CkdY5QFJ543XsL-wGU+m3K0CBXaOpznL72jpzgXWGEQ@mail.gmail.com>
2021-11-03 15:01 ` Serge Petrenko via Tarantool-patches
2021-11-11 15:04 ` sergos via Tarantool-patches [this message]
2021-11-29 15:17 ` Kirill Yukhin via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=04CEC0FF-209C-4534-80BB-BF88AE097E33@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=sergos@tarantool.org \
--cc=ya.shtunder@gmail.com \
--subject='Re: [Tarantool-patches] [PATCH v3] replication: removing anonymous replicas from synchro quorum' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox