From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 3EF6745C304 for ; Fri, 18 Dec 2020 02:18:02 +0300 (MSK) References: <20201214113935.1040421-1-gorcunov@gmail.com> <20201214113935.1040421-4-gorcunov@gmail.com> From: Vladislav Shpilevoy Message-ID: <2b00fba4-63bd-559f-c273-a02cf3fed6f3@tarantool.org> Date: Fri, 18 Dec 2020 00:18:00 +0100 MIME-Version: 1.0 In-Reply-To: <20201214113935.1040421-4-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v4 3/3] test: add replication/gh-5446-qsync-eval-quorum.test.lua List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , tml Cc: Mons Anderson Thanks for the patch! See 2 comments below. > diff --git a/test/replication/gh-5446-qsync-eval-quorum.result b/test/replication/gh-5446-qsync-eval-quorum.result > new file mode 100644 > index 000000000..db0f8e91f > --- /dev/null > +++ b/test/replication/gh-5446-qsync-eval-quorum.result > @@ -0,0 +1,268 @@ > +-- test-run result file version 2 > +test_run = require('test_run').new() > + | --- > + | ... > +engine = test_run:get_cfg('engine') > + | --- > + | ... > + > +box.schema.user.grant('guest', 'replication') > + | --- > + | ... > + > +-- Test syntax error > +box.cfg{replication_synchro_quorum = "aaa"} > + | --- > + | - error: 'Incorrect value for option ''replication_synchro_quorum'': [string "local > + | expr = [[aaa]]..."]:7: Expression should return a number' > + | ... > + > +-- Test out of bounds values > +box.cfg{replication_synchro_quorum = "N+1"} > + | --- > + | - error: 'Incorrect value for option ''replication_synchro_quorum'': evaluated value > + | is out of range' > + | ... > +box.cfg{replication_synchro_quorum = "N-1"} > + | --- > + | - error: 'Incorrect value for option ''replication_synchro_quorum'': evaluated value > + | is out of range' > + | ... > + > +-- Use canonical majority formula > +box.cfg { replication_synchro_quorum = "N/2+1", replication_synchro_timeout = 1000 } > + | --- > + | ... > +match = 'set \'replication_synchro_quorum\' configuration option to \"N\\/2%+1' > + | --- > + | ... > +test_run:grep_log("default", match) ~= nil > + | --- > + | - true > + | ... > + > +-- 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.