From: Cyrill Gorcunov <gorcunov@gmail.com> To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Cc: Mons Anderson <v.perepelitsa@corp.mail.ru>, tml <tarantool-patches@dev.tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v4 3/3] test: add replication/gh-5446-qsync-eval-quorum.test.lua Date: Fri, 18 Dec 2020 11:14:16 +0300 [thread overview] Message-ID: <20201218081416.GG14556@grain> (raw) In-Reply-To: <2b00fba4-63bd-559f-c273-a02cf3fed6f3@tarantool.org> On Fri, Dec 18, 2020 at 12:18:00AM +0100, Vladislav Shpilevoy wrote: > > +-- Create a sync space we will operate on > > +_ = box.schema.space.create('sync', {is_sync = true, engine = engine}) > > + | --- > > + | ... > > +s = box.space.sync > > + | --- > > + | ... > > +s:format({{name = 'id', type = 'unsigned'}, {name = 'value', type = 'unsigned'}}) > > 1. Why do you need the format? Why do you even need 2 fields? > > > + | --- > > + | ... > > +_ = s:create_index('primary', {parts = {'id'}}) > > 2. In primary index you can omit 'parts' - it will use the first > field automatically. Took both notes from some existing example. Would the following be better? --- diff --git a/test/replication/gh-5446-qsync-eval-quorum.test.lua b/test/replication/gh-5446-qsync-eval-quorum.test.lua index 2ecfa8c3e..9f731a488 100644 --- a/test/replication/gh-5446-qsync-eval-quorum.test.lua +++ b/test/replication/gh-5446-qsync-eval-quorum.test.lua @@ -17,10 +17,8 @@ test_run:grep_log("default", match) ~= nil -- Create a sync space we will operate on _ = box.schema.space.create('sync', {is_sync = true, engine = engine}) -s = box.space.sync -s:format({{name = 'id', type = 'unsigned'}, {name = 'value', type = 'unsigned'}}) -_ = s:create_index('primary', {parts = {'id'}}) -s:insert{1, 1} +_ = box.space.sync:create_index('pk') +box.space.sync:insert{1} test_run:cmd('create server replica1 with rpl_master=default,\ script="replication/replica-quorum-1.lua"') @@ -69,17 +67,17 @@ test_run:grep_log("default", match) ~= nil -- 5 replicas left, the commit should pass test_run:cmd('stop server replica1') test_run:cmd('delete server replica1') -s:insert{2, 2} +box.space.sync:insert{2} -- 4 replicas left,the commit should pass test_run:cmd('stop server replica2') test_run:cmd('delete server replica2') -s:insert{3, 3} +box.space.sync:insert{3} -- 3 replicas left, the commit should pass test_run:cmd('stop server replica3') test_run:cmd('delete server replica3') -s:insert{4, 4} +box.space.sync:insert{4} -- 2 replicas left, the commit should NOT pass -- @@ -88,11 +86,11 @@ s:insert{4, 4} -- not pass since replicas are stopped. box.cfg { replication_synchro_timeout = 0.5 } test_run:cmd('stop server replica4') -s:insert{5, 5} +box.space.sync:insert{5} -- restore it back and retry test_run:cmd('start server replica4 with wait=True, wait_load=True') box.cfg { replication_synchro_timeout = 1000 } -s:insert{5, 5} +box.space.sync:insert{5} test_run:cmd('stop server replica4') test_run:cmd('delete server replica4')
next prev parent reply other threads:[~2020-12-18 8:14 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-14 11:39 [Tarantool-patches] [PATCH v4 0/3] qsync: evaluate replication_synchro_quorum dynamically Cyrill Gorcunov 2020-12-14 11:39 ` [Tarantool-patches] [PATCH v4 1/3] cfg: add cfg_isnumber helper Cyrill Gorcunov 2020-12-14 11:39 ` [Tarantool-patches] [PATCH v4 2/3] cfg: support symbolic evaluation of replication_synchro_quorum Cyrill Gorcunov 2020-12-16 13:21 ` Serge Petrenko 2020-12-16 13:35 ` Cyrill Gorcunov 2020-12-17 23:17 ` Vladislav Shpilevoy 2020-12-18 7:25 ` Cyrill Gorcunov 2020-12-20 17:01 ` Vladislav Shpilevoy 2020-12-20 18:28 ` Cyrill Gorcunov 2020-12-21 17:48 ` Vladislav Shpilevoy 2020-12-21 17:49 ` Vladislav Shpilevoy 2020-12-21 20:02 ` Cyrill Gorcunov 2020-12-21 20:12 ` Cyrill Gorcunov 2020-12-14 11:39 ` [Tarantool-patches] [PATCH v4 3/3] test: add replication/gh-5446-qsync-eval-quorum.test.lua Cyrill Gorcunov 2020-12-16 13:25 ` Serge Petrenko 2020-12-17 23:18 ` Vladislav Shpilevoy 2020-12-18 8:14 ` Cyrill Gorcunov [this message] 2020-12-20 17:01 ` Vladislav Shpilevoy 2020-12-20 18:27 ` Cyrill Gorcunov 2020-12-21 16:05 ` Cyrill Gorcunov
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=20201218081416.GG14556@grain \ --to=gorcunov@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.perepelitsa@corp.mail.ru \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v4 3/3] test: add replication/gh-5446-qsync-eval-quorum.test.lua' \ /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