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 200CB7030D; Thu, 4 Feb 2021 01:02:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 200CB7030D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612389749; bh=FzoQVDICvyMonOXGzZX4p2EhTYMj6ia1IuiRFxCeVlI=; 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=NI22Z0z+AiLvKwA53qBgvaREF1oubSM24WIrmcK7M3SewsVWjjHmZPF467GQLUpmN s9NotnduGjTY6CVq/ms+FtGYFVSixC1Sg4Nu3cC5p3XQ0Vry6hGDZCKr+nWrzgi99K sl1hwPSrE1PcsAWAOS+CJJjrYbegaRNhw0Nz3spo= Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 E0CCE7030D for ; Thu, 4 Feb 2021 01:02:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E0CCE7030D Received: by mail-lj1-f171.google.com with SMTP id a17so935423ljq.2 for ; Wed, 03 Feb 2021 14:02:27 -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=MCBTVr8hjJuM5d6RWgL4pgZN/jKUU5UfHKB5wR7QP70=; b=iB96k/iKtEZN+hhHFWqJ3/PSJuwsVOSur5B6jvuPadVWc4zcAEZfFj1Lx410uhAGTm Sl5UVQt2IsNRZWIvdrSY5YtHy3tnal9aF+DjK43sb0XXXmljMloDQZPG7E7U7yjnTRBJ HA6iotvz/65lj7dv80wl/QSzcyjyoQ3tXVnAs+Q7DB3JWz/b2YbMCAx8B+RYouJBiATQ qXy9QlOScdZtjg7iuminSHj3Bbaf8UHBk1T660R0Ddv+FwZKG0QHIZvmY74+zYtMkUlB 9kP1O1cgYMgV6Wmi07vzbC5UOZfytu2BIFg8L9q0EUEACVwgY3iqrqUDgdYVW5UblKNA lwRQ== X-Gm-Message-State: AOAM533E4zzDo7sYwf1SXz+PujHVELYHf1610X0VBwINLzWqkZn8UwUA MNEqkfhSEATqCoJx+Kcctwn9DU8Fmj8= X-Google-Smtp-Source: ABdhPJxsbWiJpec26nnlNT7fP4L9qkRQJW4aLs5Md2mLoy/c1RGBnTM9deSVlrV/LJbNKQCQMQJB0g== X-Received: by 2002:a2e:a590:: with SMTP id m16mr3037122ljp.325.1612389746580; Wed, 03 Feb 2021 14:02:26 -0800 (PST) Received: from grain.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id 79sm359453lfe.252.2021.02.03.14.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 14:02:25 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 83F77560097; Thu, 4 Feb 2021 01:02:24 +0300 (MSK) Date: Thu, 4 Feb 2021 01:02:24 +0300 To: Vladislav Shpilevoy Message-ID: <20210203220224.GE2172@grain> References: <20210122132700.272816-1-gorcunov@gmail.com> <20210122132700.272816-6-gorcunov@gmail.com> <20210131221317.GB2172@grain> <68089c28-ef69-0573-32dc-89bf9e9467e6@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <68089c28-ef69-0573-32dc-89bf9e9467e6@tarantool.org> User-Agent: Mutt/1.14.6 (2020-07-11) Subject: Re: [Tarantool-patches] [PATCH 5/6] txn: stop using txn_has_flag 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Wed, Feb 03, 2021 at 08:47:39PM +0100, Vladislav Shpilevoy wrote: > > > > The initial rationale for this series was (as far as I remember) to > > setup several flags at once, so I think you could consider implementing > > txn_set_flags() helper which would do the trick instead. Thus lets drop > > this series, it doesn't make anything better without using neg operator. > > Another purpose of the issue was to make TXN_WAIT_SYNC a part of > TXN_WAIT_ACK. Because ACK is never present without SYNC. > > Talking of the setting many flags at once - you still can do this, > even with txn_set_flag(). Just rename txn_set_flag() to txn_set_flags(), > and make the flags proper bitfields like in the first commits of this > series. Then we could do > > txn_set_flags(TXN_WAIT_SYNC | TXN_WAIT_ACK) > > Although I don't know what to do with checking flags. If we add > txn_has_flags(), then should it return true if all the requested > flags are present, or if any of them? I think we can stick with txn_has_flags to exact match and txn_has_flagsa for any flag.