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 353FF6EC59; Thu, 4 Feb 2021 17:32:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 353FF6EC59 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612449122; bh=ruThzhan7q7wrvXBWY0Ho8F5JeGeJgcNESbcxAOO9Hk=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=pK+MUUOxDiJdFR6KiyDylil+xF/s433ulOwPoQ84HdCl0GlHCgXPKY+NyF5J4Atc3 qpn+Hq7t+ByqW5ur8PxsRMWg520pesx0jmJOhHrD05AQDyRegXOc9b72F8+XJsE+oV UnIFgXCGoV/yDJKeVA1ecRj8G7RrT53SvOGa5tBE= 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 264706EC59 for ; Thu, 4 Feb 2021 17:32:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 264706EC59 Received: by mail-lj1-f177.google.com with SMTP id c18so3618435ljd.9 for ; Thu, 04 Feb 2021 06:32:01 -0800 (PST) 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=r1VIShzudA9dwS/n6gsynNC/ItqnS2PA+Se4D62BFYA=; b=tZehRmaqN+NnrLg+XpbuRnpQqTeW6on/c+5lOdE33uhc+V0RLvPBE+GWTI0yNK4AIH CIYRjppwtCt79wOcu5+wpjeVCe3OYkrtpF4z2QLzz+vz5lxnigg1Df67yIjQ1lHChAX8 x94k2PcRV4qAVY9OGBK+BuSBjjF4sIGFJv3OM+ErAfMHNnFMLboLnJJpWieCVEt36jzw iFMnrLnw1VLtboIX9izflqxoPHut1I5/cvI/ujpjLSjuQ1UuWEZe9Yn19eGGuVjb8yP1 mHYQFv/4OFBW/DYgKn9mJhk4d/jlgGwOP0m8evuQVG0jr+Hg18iVU54M8dsvu3+6Fnqm l9MA== X-Gm-Message-State: AOAM533+woj5OQ3VKGPgA0AgMrgCwv7y5e+TLfRKy3O784dtFyF5ry78 W2mefjEq3eURYsL4GbMjig+24woYNWM= X-Google-Smtp-Source: ABdhPJyPqI+uNUUlkgLn24t1vvQ0KZsO997cUj+fUz7vCQ5foyuNy1tGCIqR5aRYThPL5jNWwXbo7g== X-Received: by 2002:a2e:a0ce:: with SMTP id f14mr4817828ljm.180.1612449120070; Thu, 04 Feb 2021 06:32:00 -0800 (PST) Received: from grain.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id z7sm622528lfd.228.2021.02.04.06.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 06:31:58 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id D5721560087; Thu, 4 Feb 2021 17:31:57 +0300 (MSK) Date: Thu, 4 Feb 2021 17:31:57 +0300 To: Serge Petrenko Message-ID: <20210204143157.GG2172@grain> References: <20210204111912.496547-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.6 (2020-07-11) Subject: Re: [Tarantool-patches] [PATCH v3] txn: convert flags to explicit bitfield 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 Cc: tml , Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Thu, Feb 04, 2021 at 05:01:07PM +0300, Serge Petrenko wrote: ... > > /** > > * Synchronous transaction touched sync spaces, or an > > * asynchronous transaction blocked by a sync one until it > > * is confirmed. > > */ > > - TXN_WAIT_SYNC, > > + TXN_WAIT_SYNC = 0x10, > > /** > > * Synchronous transaction 'waiting for ACKs' state before > > * commit. In this state it waits until it is replicated > > @@ -82,14 +82,14 @@ enum txn_flag { > > * commit and returns success to a user. > > * TXN_WAIT_SYNC is always set, if TXN_WAIT_ACK is set. > > */ > > - TXN_WAIT_ACK, > > + TXN_WAIT_ACK = 0x20, > > Since setting `TXN_WAIT_ACK` always implies setting `TXN_WAIT_SYNC`, and > when TXN_WAIT_ACK is cleared, TXN_WAIT_SYNC is also cleared, you may > define TXN_WAIT_ACK = 0x30 for simplicity. > Then setting TXN_WAIT_ACK will set TXN_WAIT_SYNC implicitly. And same for > clearing TXN_WAIT_ACK. Yes, but this won't get exact match for txn_has_flag, which tests for a single bit now. Surely I can setup TXN_WAIT_ACK = 0x20 | TXN_WAIT_SYNC if you and Vlad agrees.