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 44A096FC87; Tue, 5 Oct 2021 00:16:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 44A096FC87 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1633382208; bh=Aa+CZKQ55ebs8YQjFF+X6iq7pLuZEOxAkO+TUjjrrNY=; 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=MAIdRk3HIpTRQLPSaj/ZWoU2lNOm8x/69eFGKGUD5M6TfdeK88YfqjSfT/3HwmB4a OJlcKgWdYFcpjYDxgnki8vdEFUJDQNw9mzkgMmPlIsLwM/5brEFqJA4uCMT5Blyf36 opzw88rzTl0MfnfRxVTZQI+uP71NycTG/Q1UjUT4= Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 3F5816FC87 for ; Tue, 5 Oct 2021 00:16:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3F5816FC87 Received: by mail-lf1-f52.google.com with SMTP id y15so11610511lfk.7 for ; Mon, 04 Oct 2021 14:16:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=earmeDalgAsLEO7Md2IpL3L+d1/bX9JVc0puvJLm3Eg=; b=KaE/jeZycEsRI0Z73qhgGaBlZUnLHzGXWcm2Kac9KhyeG+RYhWI6Vvif2fwTBuURok 1gOI3PqYoU7WOn+nyUpCkBEPcR10zarlPMgDaexn0b46GtzDjU2DcMRm5MgnSxtYVtZp lQylTj7rC3IYYEV4Kg5a+8Y+1jRH6MiRXy/LWwOSY0AxPb2EeJQqX1OrRgbW1wY+3NtB oxLUoceVq7zG4g6H/L8yZenTFIqSVKvNfDZPpzsmRc15YHRv0AhNBse4bqMYlhT4En7Y iorO5LfMusjZ0c0hQvVlw3SCqO8guCobQLr9skUcuOkHiFpk0A2x4Nz3YjxYQR225MjL SITg== X-Gm-Message-State: AOAM533r2zYwczStlPKQpDTMEI5w+I8EL01M+g0PgN5lHDVH6mqtIMxu cHcpjJE15qJC3qBVZmTUYH2CEbAUf4o= X-Google-Smtp-Source: ABdhPJzUOSH4s3H3BmHXduR4WvxE2+ts6xMk+JfqsXP+ByU/DKZC1YbH0+slKnutBQuc+HYwELEBfQ== X-Received: by 2002:a05:6512:3181:: with SMTP id i1mr2780300lfe.29.1633382203604; Mon, 04 Oct 2021 14:16:43 -0700 (PDT) Received: from grain.localdomain ([5.18.253.97]) by smtp.gmail.com with ESMTPSA id k10sm1762967ljj.24.2021.10.04.14.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 14:16:42 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 5A6975A001E; Tue, 5 Oct 2021 00:16:41 +0300 (MSK) Date: Tue, 5 Oct 2021 00:16:41 +0300 To: Serge Petrenko Cc: tml , Vladislav Shpilevoy Message-ID: References: <20210930094445.316694-1-gorcunov@gmail.com> <20210930094445.316694-4-gorcunov@gmail.com> <42713720-689c-221c-29a4-7087ccbc472f@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42713720-689c-221c-29a4-7087ccbc472f@tarantool.org> User-Agent: Mutt/2.0.7 (2021-05-04) Subject: Re: [Tarantool-patches] [PATCH v19 3/3] test: add gh-6036-qsync-order test 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 Fri, Oct 01, 2021 at 03:30:41PM +0300, Serge Petrenko wrote: > > Thanks for the test! > Please, find a couple of comments below. > I think the test won't be flaky anymore once you fix my comments. Thanks for comments, Serge! > > + > > +box.once("bootstrap", function() > > + box.schema.user.grant('guest', 'super') > > +end) > > Looks like "election_replica.lua" suits our needs perfectly now. > No need to introduce a new instance file. yup, I updated the test, thanks! > > +test_run:wait_cond(function() return box.space.test:get{1} ~= nil end) > > + | --- > > + | - true > > + | ... > > + > > > You may replace both calls with test_run:wait_lsn('master', 'replica') > Even without switching. Actually I need switch, otherwise i got stuck, so I use test_run:switch("master") box.ctl.promote() s = box.schema.create_space('test', {is_sync = true}) _ = s:create_index('pk') s:insert{1} test_run:switch("replica1") test_run:wait_lsn('replica1', 'master') test_run:switch("replica2") test_run:wait_lsn('replica2', 'master') which works just fine > > + > > +-- > > +-- Make replica1 been a leader and start writting data, > > +-- the PROMOTE request get queued on replica2 and not > > +-- yet processed, same time INSERT won't complete either > > +-- waiting for PROMOTE completion first. > > +test_run:switch("replica1") > > + | --- > > + | - true > > + | ... > > +box.ctl.promote() > > + | --- > > + | ... > > +_ = require('fiber').create(function() box.space.test:insert{2} end) > > + | --- > > + | ... > > + > > +-- > > Prior to doing something on master, you should make sure > replica2 has received the promote. > "wait_lsn" won't work here, because WAL is disabled. You may try > test_run:wait_cond(function() return box.space.test:get{2} ~= nil end) Wait, this moment is dubious. Look, once we issue promote it get stuck inside journal write procedure so the next "insert" won't proceed until the promote finished. I understand that you point to the potential race here because even promote() command may get finished but slowed down on nework level and simply reach replica2 out of other calls. I think without aditional debug output (such as promote term exposed via box.info I did in previous series) we can't be sure about timings and it seems that i've to return back the box.info patch. I mean currently the command test_run:wait_cond(function() return box.space.test:get{2} ~= nil end) stucks forever because promote yet not finished and next 'insert' simply has not been applied.