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 9879C6E200; Fri, 18 Jun 2021 01:05:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9879C6E200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623967511; bh=v7d8Q71L0pLvvAjrwJp/E6a9EjgHhDpLk10gabbSt6I=; 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=wQjQ1+D0D85nsuM03wVytb9yQQgue5pSX7a30Vjfs1smO/8uwWZWefDcAK6a3+6eN XJ+rGi7OiNKyimcLhGvDGbO9xP+e/0q+LjD37b9Iyyj7WcFTtt/VD6i79tER2PNEEz V3Mx93lEQQ4TwjNIWGvodkdbFRgIv3ZQzOlpup/Y= Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 9A20E6E200 for ; Fri, 18 Jun 2021 01:05:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9A20E6E200 Received: by mail-lf1-f46.google.com with SMTP id d16so5517314lfn.3 for ; Thu, 17 Jun 2021 15:05:10 -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=yYz8XdSWAymyUsxVy2JlVNNOR3o9KIowpPtSkbTWvoc=; b=rFQ+i3XJ2Uabs5wFKK+giAkqF629iTT2adQldMDj1toY8SKR8W4orrwbs1Ucd79WCT QoFueAORmO6zO4X2539mcG7weOz7nubcigvxZuq/f17f49cMsFbmc8FOeCxl8dtu4fSO BfUkFmjggWohATBQaGw42JuD7cpWDeXTg9mwEpa/H07y5+997SXgdTjr805zo8xKztFH 0vyxdFLC2ImBR2JyZpfY/I6+XvXyTYyNOXsHzhl0v6+8+jKyjA94vaBBu2A75QEEikwK i/qf5Fsm1PVwvXNtsTG1TJ4Zd7hphTxdF7+oIuM/phiz5a3PtNAdP0WYGzqGjE2rKgLW 2d+Q== X-Gm-Message-State: AOAM531DbvdPr8LdhjrAAR0u0c9WNTi3gZz7z7PTzvf2kT49XY7N9sxQ EK5YyW2natc9JSKMzSoq/zu2Y66q/Hg= X-Google-Smtp-Source: ABdhPJwVSG1XuV0SbUiXcQRM7mYT/rhsnLVO9oCQZ+qTOhIvh291nrSCjopiJvVDyTXTAQpdoq5dZg== X-Received: by 2002:a05:6512:a84:: with SMTP id m4mr357619lfu.451.1623967509217; Thu, 17 Jun 2021 15:05:09 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id b16sm762367lff.210.2021.06.17.15.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 15:05:08 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 796635A002A; Fri, 18 Jun 2021 01:05:07 +0300 (MSK) Date: Fri, 18 Jun 2021 01:05:07 +0300 To: Serge Petrenko Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org Message-ID: References: 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 v2 2/8] txn_limbo: fix promote term filtering 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, Jun 18, 2021 at 12:07:36AM +0300, Serge Petrenko wrote: > txn_limbo_process() used to filter out promote requests whose term was > equal to the greatest term seen. This wasn't correct for PROMOTE entries > with term 1. ... > + if (term > limbo->promote_greatest_term) { > + limbo->promote_greatest_term = term; > + } else if (req->type == IPROTO_PROMOTE && > + limbo->promote_greatest_term > 1) { > + /* PROMOTE for outdated term. Ignore. */ > + say_info("RAFT: ignoring PROMOTE request from instance " > + "id %"PRIu32" for term %"PRIu64". Greatest term seen " > + "before (%"PRIu64") is bigger.", origin, term, > + limbo->promote_greatest_term); > + return; > } Serge, please don't use PRIx helper, they are completely unreadable. As far as I remember we agreed to use %llu with explicit long long conversion. Ie say_info("RAFT: ignoring PROMOTE request from instance " "id %u for term %lld . Greatest term seen " "before (%llu) is bigger.", origin, (long long)term, (long long)limbo->promote_greatest_term); surely we can fix it on top of the series.