From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 6C1B9445321 for ; Tue, 7 Jul 2020 02:31:52 +0300 (MSK) References: From: Vladislav Shpilevoy Message-ID: <394102fe-df91-8803-cb5f-009c315274f0@tarantool.org> Date: Tue, 7 Jul 2020 01:31:50 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH 3/4] replication: add tests for sync replication with anon replica List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sergeyb@tarantool.org, tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org, gorcunov@gmail.com, lvasiliev@tarantool.org > env = require('test_run') > test_run = env.new() > engine = test_run:get_cfg('engine') > > orig_synchro_quorum = box.cfg.replication_synchro_quorum > orig_synchro_timeout = box.cfg.replication_synchro_timeout > > NUM_INSTANCES = 2 > BROKEN_QUORUM = NUM_INSTANCES + 1 > > box.schema.user.grant('guest', 'replication') > > -- Setup a cluster with anonymous replica. > test_run:cmd('create server replica_anon with rpl_master=default, script="replication/anon1.lua"') > test_run:cmd('start server replica_anon') > test_run:cmd('switch replica_anon') > > -- [RFC, Asynchronous replication] successful transaction applied on async > -- replica. Я чет не понял. Как это проходит? Вроде порешали, что анонимные реплики в кворуме не участвуют. А здесь очевидно участвуют. > -- Testcase setup. > test_run:switch('default') > box.cfg{replication_synchro_quorum=NUM_INSTANCES, replication_synchro_timeout=0.1} > _ = box.schema.space.create('sync', {is_sync=true, engine=engine}) > _ = box.space.sync:create_index('pk') > -- Testcase body. > test_run:switch('default') > box.space.sync:insert{1} -- success > box.space.sync:insert{2} -- success > box.space.sync:insert{3} -- success > test_run:cmd('switch replica_anon') > box.space.sync:select{} -- 1, 2, 3 > -- Testcase cleanup. > test_run:switch('default') > box.space.sync:drop() > > -- [RFC, Asynchronous replication] failed transaction rolled back on async > -- replica. > -- Testcase setup. > box.cfg{replication_synchro_quorum=BROKEN_QUORUM, replication_synchro_timeout=0.1} > _ = box.schema.space.create('sync', {is_sync=true, engine=engine}) > _ = box.space.sync:create_index('pk') > -- Testcase body. > test_run:switch('default') > box.space.sync:insert{1} -- failure > test_run:cmd('switch replica_anon') > box.space.sync:select{} -- none > test_run:switch('default') > box.cfg{replication_synchro_quorum=NUM_INSTANCES} > box.space.sync:insert{1} -- success > test_run:cmd('switch replica_anon') > box.space.sync:select{} -- 1 > -- Testcase cleanup. > test_run:switch('default') > box.space.sync:drop() > > -- Teardown. > test_run:switch('default') > test_run:cmd('stop server replica_anon') > test_run:cmd('delete server replica_anon') > box.schema.user.revoke('guest', 'replication') > box.cfg{ \ > replication_synchro_quorum = orig_synchro_quorum, \ > replication_synchro_timeout = orig_synchro_timeout, \ > } > test_run:cleanup_cluster()