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 891176EC55; Tue, 15 Jun 2021 20:03:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 891176EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623776584; bh=zK9C/3iPSbYsaVnDe074IZHbD61qeKVAL4bfV+R3BfE=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Q7CdK06PzuAuIbh78sj/atI8woomZejzxKoNlc2MvnAo7HPl0aQXyQBYO2o06OImG XrLf0wR1s/r6Yec3gLG3glGP6Kvn8zYtIWkx0aAUAAVr+UJEJ3BjI15Iz3mfJP82+z HVRR4HI0fxfh01dUwId0lPrwj7Y82aItblqivSCg= Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 E10E56EC55 for ; Tue, 15 Jun 2021 20:03:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E10E56EC55 Received: by mail-lj1-f177.google.com with SMTP id r14so25929048ljd.10 for ; Tue, 15 Jun 2021 10:03:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mMXrfHU2FVHpVzzVA5KyNHJmK5PjkWL3QoCoaSidf/E=; b=AcSvx2BdVbMwmRrWczFJucET4jouaulH3YtispjnRPxu4Ux+rhxxnhYu4ULXZLdl+O sWsPC6YLMUVKL+6zT4SqPI/VqStfBOVoFaQBDp5y0D5TZAmQOATL8YQR9UzkfmBldDI4 IAVCHd6E5Lgw6FuAKwaalDDnlkFC+Pz9z68Dk8+ZnC/hur/8epaAzY+G0uw8GfLF9lvg riLUdX8OugJyOeQUzbf96nA/k0Y/PFG+BkXZ3V7v5c/GrF9kKlYV1A3Se4YxeFm87Ty7 XHrJESa7rVNajd36jTraQ2prHCRc/u3cweYCC5sPcoHPz5LribNKurbrJn9eLFlzaQIj +qBQ== X-Gm-Message-State: AOAM531GAtqcQPtAwiOkYiQ0DGEDugvzpxl1sBK7tYqLroGiNNLR719R 1HnhtJw7e82KkOCAEijdk7AoTdGWksw= X-Google-Smtp-Source: ABdhPJxaFh9Y4Djs0BxN2OCydsGJltFYaiivBre//aysgS10umYU1Hh6a/yTR8Tk8SLtEwSwpizGTQ== X-Received: by 2002:a2e:bc1b:: with SMTP id b27mr512955ljf.65.1623776581705; Tue, 15 Jun 2021 10:03:01 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id l27sm1554412ljb.90.2021.06.15.10.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 10:03:00 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 86E125A002A; Tue, 15 Jun 2021 20:02:59 +0300 (MSK) Date: Tue, 15 Jun 2021 20:02:59 +0300 To: Serge Petrenko Cc: tml , Vladislav Shpilevoy Message-ID: References: <20210615135630.63465-1-gorcunov@gmail.com> <20210615135630.63465-2-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) Subject: Re: [Tarantool-patches] [PATCH v9 1/1] applier: filter incoming synchro packets via transaction initiator 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: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Tue, Jun 15, 2021 at 05:26:06PM +0300, Serge Petrenko wrote: > > +box.space.sync:select{} > > + | --- > > + | - - [1] > > + | ... > > You need to wait for the space creation, just like > you do below. Otherwise the test'll be flaky. > Also, please see a comment regarding wait_lsn vs wait_cond > below. As being discussed due to quorum=2 and sync space we don't need to wait. > > +test_run:wait_cond(function() return \ > > + box.space.sync ~= nil and \ > > + box.space.sync:get{1} ~= nil and \ > > + box.space.sync:get{1}[1] == 1 end, 100) > > + | --- > > + | - true > > + | ... > > I suggest you use wait_lsn('replica2', 'master') here > instead of this bulky wait_cond. > First of all, it takes a single line, instead of 4 lines. > > Secondly, you forgot to test `box.space.sync.index.pk ~= nil`, meaning > the test will still fail occasionally, when index creation doesn't replicate > in time. You mean something like below? --- diff --git a/test/replication/gh-6035-applier-filter.result b/test/replication/gh-6035-applier-filter.result index 2620e7b6f..7345a19f7 100644 --- a/test/replication/gh-6035-applier-filter.result +++ b/test/replication/gh-6035-applier-filter.result @@ -102,12 +102,8 @@ test_run:switch('replica2') | --- | - true | ... -test_run:wait_cond(function() return \ - box.space.sync ~= nil and \ - box.space.sync:get{1} ~= nil and \ - box.space.sync:get{1}[1] == 1 end, 100) +test_run:wait_lsn('replica2', 'master') | --- - | - true | ... box.space.sync:select{} | --- diff --git a/test/replication/gh-6035-applier-filter.test.lua b/test/replication/gh-6035-applier-filter.test.lua index 9bfd91288..beca5258e 100644 --- a/test/replication/gh-6035-applier-filter.test.lua +++ b/test/replication/gh-6035-applier-filter.test.lua @@ -53,10 +53,7 @@ box.space.sync:select{} -- And the second hop is replica2 where -- replica1 replicated the data to us. test_run:switch('replica2') -test_run:wait_cond(function() return \ - box.space.sync ~= nil and \ - box.space.sync:get{1} ~= nil and \ - box.space.sync:get{1}[1] == 1 end, 100) +test_run:wait_lsn('replica2', 'master') box.space.sync:select{} test_run:switch('default')