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 802A46ECE3; Wed, 20 Oct 2021 01:26:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 802A46ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1634682411; bh=r/unc35jv+lFm/gekJUOYIKLwr9i7M+zXvUuHYgEa9U=; 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=y559D5hR7FGtg6CISetqRgqscsgF5Q4qZWdXVFhnEYfmAYUlrDqwqkp5oHeIrwCqI 9wv+uwZMEEkgXmkm0fAC+aG6BcaOfzOr0OmwPVIr8EmwaNPujTHsS7/pTZYKmNywPu 9h9ECaq8OtYvd83L0Vl65p3uHF7U4Y4gWr9/j2BQ= Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 4A21B6ECE3 for ; Wed, 20 Oct 2021 01:26:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4A21B6ECE3 Received: by mail-lf1-f43.google.com with SMTP id x192so10659760lff.12 for ; Tue, 19 Oct 2021 15:26:49 -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=Lm22yPHVKlvBdOnFs/nDVe5iv1o6yP/KwkG12W0bJ/M=; b=6u+XaR7cRPGkoYCvh0Npq2iWTMT1++wlbcK7A96Fp4V8QwSR0f3BL+fEgylb2Gxysv Q++pMT+NjUluTBWPQoPqxip/pxCflc5hhkPwbvGaPXGhN/n9s+K1CIYWqf8e5NbivXBk o5PBOiDBpnf7rowfiQhxGzex71sVCvWHNJERXQxjxSRfv5blaff11EDF48SA6ilawehH O0c6OZZ55Zn5wYgNqR2IvODO9WOTNXTiedyNoiQUq0DFzVex3LrjuO+g2tW8+7XkVlVM 9qFYCf3aDgsDpW2logNW6zb+CGayzmWZ6C46/TNgtn/m+Xr4frpoR5KojbLLin9L5kMl YPvw== X-Gm-Message-State: AOAM533E1vO0b25WrahXamSxSt4A0fJui44BjP+D08/hTt/ErOdDbFqs 90MPwWMmynZ+quFQ1LXyiBFLIVDsFMA= X-Google-Smtp-Source: ABdhPJziPPU5O9I9ohKbu20Pnc0J+nJXa7vy7/l+m2Axbcg8uvYzjdQvfkLcfB8uzvi5QP6KKUSVRQ== X-Received: by 2002:a05:6512:1103:: with SMTP id l3mr8673708lfg.550.1634682408221; Tue, 19 Oct 2021 15:26:48 -0700 (PDT) Received: from grain.localdomain ([5.18.253.97]) by smtp.gmail.com with ESMTPSA id k19sm35166lfv.109.2021.10.19.15.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 15:26:47 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 1BB275A0020; Wed, 20 Oct 2021 01:26:46 +0300 (MSK) Date: Wed, 20 Oct 2021 01:26:46 +0300 To: Serge Petrenko Cc: tml Message-ID: References: <20211014215622.49732-1-gorcunov@gmail.com> <20211014215622.49732-4-gorcunov@gmail.com> <5ce44467-f9a9-0743-3394-c2a40cff463c@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ce44467-f9a9-0743-3394-c2a40cff463c@tarantool.org> User-Agent: Mutt/2.0.7 (2021-05-04) Subject: Re: [Tarantool-patches] [PATCH v23 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 Tue, Oct 19, 2021 at 06:09:50PM +0300, Serge Petrenko wrote: > > +-- > > +-- The election_replica1 node has no clue that there is a new leader > > +-- and continue writing data with obsolete term. Since election_replica3 > > +-- is delayed now the INSERT won't proceed yet but get queued. > > +test_run:switch("election_replica1") > > + | --- > > + | - true > > + | ... > > +box.space.test:insert{3} > > + | --- > > + | - [3] > > + | ... > > + > > +-- > > +-- Finally enable election_replica3 back. Make sure the data from new election_replica2 > > +-- leader get writing while old leader's data ignored. > > +test_run:switch("election_replica3") > > + | --- > > + | - true > > + | ... > > Hi and thanks for the fixes! > > I have only one comment left. > > Actually you do need to count writes here. > The wait_cond for ERRINJ_WAL_WRITE_COUNT == write_cnt + 3 > is needed to make sure you receive (and thus try to process) > insert {3} **before** the replica is re-enabled. > > Otherwise we can't be sure that the test is correct. You may simply > perform a select before insert{3} has reached the replica. You know, I spent a few hours trying to pass the test waiting for ERRINJ_WAL_WRITE_COUNT == write_cnt + 3 and finally realized that it seems that is what happens: the replica1 is not longer a leader and when this record reach our replica3 node we NOPify it then we run apply_row if (request.type == IPROTO_NOP) return process_nop() thus this record even not reaching the journal at all and that is why waiting for write_cnt + 3 lasts forever. If only I didn't miss something obvious.