From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 65445741CE; Wed, 6 Oct 2021 11:44:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 65445741CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1633509863; bh=I+D9TkE/VsNg4MooGgePVaPPjWP/dNe3fg2OJgUvltU=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=lHnXzPiSsdRRHKiwEiPQytJa1K+iLOoeji70+6knUtSF8YZ5vhr6eG2aVql298UKU zbbhFBzB1dqS00/ZVNfZkbmjVJ2O/IGO453XcoXAqtjfDUo68i4G6t89bQBsF+teE+ kY8ctE1lx2qBuYgHgae4QJdyU/rsI4D5UXq9clGE= Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D961F74152 for ; Wed, 6 Oct 2021 11:44:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D961F74152 Received: by mail-lf1-f53.google.com with SMTP id u18so7158882lfd.12 for ; Wed, 06 Oct 2021 01:44:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6+3zhlpcKvlUau1uCvYF2/0ggroD0qkAm3zTLXYcfa8=; b=CwPMltw8PD9OVzOSoryJUfa/pyi+HIGtnZa//Gd0la1JuzMQqmflKTyObtG8INCr6H TA+zFsonoAMyWZI1HkRW+/Z216Ug9vHqF9JY2gtU7/6+etM/QNLDuwr1S35dH+K9Vzow qxDQDbech8JCfNUX7oe1YgUqy5v8X6zs13iXx8X4+mWDsoFCbDNX+yKpd8dQ0A0hpuL7 4Lz7Wmr/gjjHDjuylzJuBuJZ/IUHWf/w3IZdE7YgfQ9zjug7FzGCWUYexgM9fPdiopzc K2tEUjDKIJAfy3iGakLF6uEQXFFqth0Kj37w/FSPhQxD81ykCE20ORT6zw0m40ulghg9 cFEQ== X-Gm-Message-State: AOAM531SRHc6BjqX0Wq/1lnk8CAtY4heXD+kGeoQHOE/hSQGrInv7+Q2 yPooouYvgkbFYYBc1iJOqI/cdQETKLU= X-Google-Smtp-Source: ABdhPJxlKvcQvYL+symXZBPgBWWe4cXqgpBh2jW52QMGaC96hsgrHZplkrK0ACSYvgNIDN1IMCOVrw== X-Received: by 2002:a05:651c:311:: with SMTP id a17mr27228339ljp.293.1633509861117; Wed, 06 Oct 2021 01:44:21 -0700 (PDT) Received: from localhost.localdomain (broadband-46-242-13-228.ip.moscow.rt.ru. [46.242.13.228]) by smtp.gmail.com with ESMTPSA id j23sm1220692lfm.139.2021.10.06.01.44.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 01:44:20 -0700 (PDT) To: tarantool-patches@dev.tarantool.org Cc: Yan Shtunder Date: Wed, 6 Oct 2021 11:44:16 +0300 Message-Id: <20211006084416.8445-1-ya.shtunder@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2] replication: removing anonymous replicas from synchro quorum X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Yan Shtunder via Tarantool-patches Reply-To: Yan Shtunder Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Transactions have to committed after they reaches quorum of "real" cluster members. Therefore, anonymous replicas don't have to participate in the quorum. Closes #5418 --- Issue: https://github.com/tarantool/tarantool/issues/5418 Patch: https://github.com/tarantool/tarantool/tree/yshtunder/gh-5418-qsync-with-anon-replicas test/replication-luatest/gh_5418_test.lua | 6 +- .../{master.lua => master_quorum.lua} | 0 .../{replica.lua => replica_anon.lua} | 0 test/replication/qsync_with_anon.result | 130 ------------------ test/replication/qsync_with_anon.test.lua | 55 -------- 5 files changed, 2 insertions(+), 189 deletions(-) rename test/replication-luatest/instance_files/{master.lua => master_quorum.lua} (100%) rename test/replication-luatest/instance_files/{replica.lua => replica_anon.lua} (100%) delete mode 100644 test/replication/qsync_with_anon.result delete mode 100644 test/replication/qsync_with_anon.test.lua diff --git a/test/replication-luatest/gh_5418_test.lua b/test/replication-luatest/gh_5418_test.lua index 858fe342f..36c83fe68 100644 --- a/test/replication-luatest/gh_5418_test.lua +++ b/test/replication-luatest/gh_5418_test.lua @@ -10,18 +10,16 @@ local Server = t.Server g.before_all(function() g.master = Server:new({ alias = 'master', - command = './test/replication-luatest/instance_files/master.lua', + command = './test/replication-luatest/instance_files/master_quorum.lua', workdir = fio.tempdir(), - http_port = 8081, net_box_port = 13301, }) g.replica = Server:new({ alias = 'replica', - command = './test/replication-luatest/instance_files/replica.lua', + command = './test/replication-luatest/instance_files/replica_anon.lua', workdir = fio.tempdir(), env = {TARANTOOL_MASTER = '13301'}, - http_port = 8082, net_box_port = 13302, }) diff --git a/test/replication-luatest/instance_files/master.lua b/test/replication-luatest/instance_files/master_quorum.lua similarity index 100% rename from test/replication-luatest/instance_files/master.lua rename to test/replication-luatest/instance_files/master_quorum.lua diff --git a/test/replication-luatest/instance_files/replica.lua b/test/replication-luatest/instance_files/replica_anon.lua similarity index 100% rename from test/replication-luatest/instance_files/replica.lua rename to test/replication-luatest/instance_files/replica_anon.lua diff --git a/test/replication/qsync_with_anon.result b/test/replication/qsync_with_anon.result deleted file mode 100644 index 0522a09f8..000000000 --- a/test/replication/qsync_with_anon.result +++ /dev/null @@ -1,130 +0,0 @@ --- test-run result file version 2 -test_run = require('test_run').new() - | --- - | ... - -NUM_INSTANCES = 2 - | --- - | ... - -box.schema.user.grant('guest', 'replication') - | --- - | ... -box.cfg{replication_synchro_quorum=NUM_INSTANCES} - | --- - | ... -_ = box.schema.space.create('sync', {is_sync=true}) - | --- - | ... -_ = box.space.sync:create_index('pk') - | --- - | ... -box.ctl.promote() - | --- - | ... --- Testcase body. -test_run:switch('default') - | --- - | - true - | ... -box.space.sync:insert{1} -- success - | --- - | - [1] - | ... -box.space.sync:insert{2} -- success - | --- - | - [2] - | ... -box.space.sync:insert{3} -- success - | --- - | - [3] - | ... -test_run:cmd('switch replica_anon') - | --- - | - true - | ... -box.space.sync:select{} -- 1, 2, 3 - | --- - | - - [1] - | - [2] - | - [3] - | ... --- Testcase cleanup. -test_run:switch('default') - | --- - | - true - | ... -box.space.sync:drop() - | --- - | ... - - --- Setup a cluster with anonymous replica -test_run:cmd('create server replica_anon with rpl_master=default,\ - script="replication/anon1.lua"') - | --- - | - true - | ... -test_run:cmd('start server replica_anon') - | --- - | - true - | ... - - --- Testcase -box.space.sync:insert{1} -- error - | --- - | - error: Quorum collection for a synchronous transaction is timed out - | ... -box.space.sync:insert{3} -- error - | --- - | - error: Quorum collection for a synchronous transaction is timed out - | ... -test_run:cmd('switch replica_anon') - | --- - | - true - | ... -box.space.sync:select{} -- [] - | --- - | - [] - | ... - --- Testcase cleanup -test_run:switch('default') - | --- - | - true - | ... -box.space.sync:drop() - | --- - | ... - - --- Teardown -test_run:cmd('stop server replica_anon') - | --- - | - true - | ... -test_run:cmd('cleanup server replica_anon') - | --- - | - true - | ... -test_run:cmd('delete server replica_anon') - | --- - | - true - | ... - -box.schema.user.revoke('guest', 'replication') - | --- - | ... -box.cfg{ \ - replication_synchro_quorum = orig_synchro_quorum, \ - replication_synchro_timeout = orig_synchro_timeout, \ -} - | --- - | ... -box.ctl.demote() - | --- - | ... -test_run:cleanup_cluster() - | --- - | ... diff --git a/test/replication/qsync_with_anon.test.lua b/test/replication/qsync_with_anon.test.lua deleted file mode 100644 index 05a56c8ef..000000000 --- a/test/replication/qsync_with_anon.test.lua +++ /dev/null @@ -1,55 +0,0 @@ -test_run = require('test_run').new() - -NUM_INSTANCES = 2 - -box.schema.user.grant('guest', 'replication') -box.cfg{replication_synchro_quorum=NUM_INSTANCES} -_ = box.schema.space.create('sync', {is_sync=true}) -_ = box.space.sync:create_index('pk') -<<<<<<< HEAD -======= -box.ctl.promote() --- 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() ->>>>>>> box: introduce `box.ctl.demote` - - --- 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') - - --- Testcase -box.space.sync:insert{1} -- error -box.space.sync:insert{3} -- error -test_run:cmd('switch replica_anon') -box.space.sync:select{} -- [] - --- Testcase cleanup -test_run:switch('default') -box.space.sync:drop() - - --- Teardown -test_run:cmd('stop server replica_anon') -test_run:cmd('cleanup server replica_anon') -test_run:cmd('delete server replica_anon') -<<<<<<< HEAD -======= -box.schema.user.revoke('guest', 'replication') -box.cfg{ \ - replication_synchro_quorum = orig_synchro_quorum, \ - replication_synchro_timeout = orig_synchro_timeout, \ -} -box.ctl.demote() -test_run:cleanup_cluster() ->>>>>>> box: introduce `box.ctl.demote` -- 2.25.1