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 D380F7030F; Fri, 22 Jan 2021 16:29:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D380F7030F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1611322149; bh=9bXBDprijzl4OpsxXNXCtNb9NxGXCL74jL3/Hf6GtVk=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JLPNoR8IYwdTX9BqzEbmCc0w7HnLtbiJwMp1SMI04clXZ8i/w8L1TVKceN/6fB+Pb AZ/ITtNv4M/ncvQf5LCgR7a+IZDVZuX4V7Ai0mYZqJ++7m2jG+LkNQIyddF7s/XdF/ 5Sh0Ud+2oupniq3UFyYIoGulJ+14UK3d8hjsuP1k= Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (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 0CCE07030F for ; Fri, 22 Jan 2021 16:27:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0CCE07030F Received: by mail-lj1-f182.google.com with SMTP id 3so6526131ljc.4 for ; Fri, 22 Jan 2021 05:27:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BehbSRKFN0wgBuEfkDDxI4+B00T/UIEcd/Xou9sSDSA=; b=flmA8NMfMUZ3jU+473/2+gYZjoU9jT+ZatFdgm/azoZYeXkAxxLBgjWI5lRMMKEUxO uWdiUZIbSg0OI5/uJZOAni5VH7AbkyBqukKHMYNJled8YwYykCb6z/VkkK8dpoXsr6TY +Bq9DNvMrkfljozk4sESKG72ZnGrbonjGdVdm4toqp4Rgd+XJ25VqXf2LxRn4bv8pOwN Redu7NbMdzdQ7Fa9zs5YrwRo+EB9r+ID+vVw31G54dKkLZhVzq4eI0SIgOwetSBG7qUK 04kAPBCVT7gG93x3kvgO2eYIxhoYrDyOlQxT2SdRmZ4ZsQdttcZqjaEsu3FzFqfWCZV/ RB9Q== X-Gm-Message-State: AOAM531BiHNZqTskIBfIy/LpsG2JuZlsBAaxtkocHtAyiP27CIPhuqQk p86zRucB7mD7y0bV1ZxH53yOcioNs5k= X-Google-Smtp-Source: ABdhPJwsfcdrW/l+w0XRd8vwJ0KN6rIMTsh58+dEEU7FSae2imaLoynLEIdVsknfqZbQV59hR3ijaA== X-Received: by 2002:a2e:5803:: with SMTP id m3mr2520894ljb.274.1611322074918; Fri, 22 Jan 2021 05:27:54 -0800 (PST) Received: from grain.localdomain ([5.18.91.94]) by smtp.gmail.com with ESMTPSA id l133sm882300lfd.234.2021.01.22.05.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 05:27:53 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id A2FEC5609D3; Fri, 22 Jan 2021 16:27:04 +0300 (MSK) To: tml Date: Fri, 22 Jan 2021 16:26:58 +0300 Message-Id: <20210122132700.272816-5-gorcunov@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210122132700.272816-1-gorcunov@gmail.com> References: <20210122132700.272816-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 4/6] txn: stop using txn_clear_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: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Part-of #5128 Signed-off-by: Cyrill Gorcunov --- src/box/txn.c | 2 +- src/box/txn_limbo.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/box/txn.c b/src/box/txn.c index 32eca02c5..6197cf012 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -996,7 +996,7 @@ txn_can_yield(struct txn *txn, bool set) txn->flags |= TXN_CAN_YIELD; trigger_clear(&txn->fiber_on_yield); } else if (!set && could) { - txn_clear_flag(txn, TXN_CAN_YIELD); + txn->flags &= ~TXN_CAN_YIELD; trigger_create(&txn->fiber_on_yield, txn_on_yield, NULL, NULL); trigger_add(&fiber()->on_yield, &txn->fiber_on_yield); } diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c index 9c4c3cdf1..d418530ad 100644 --- a/src/box/txn_limbo.c +++ b/src/box/txn_limbo.c @@ -266,8 +266,7 @@ txn_limbo_wait_complete(struct txn_limbo *limbo, struct txn_limbo_entry *entry) in_queue, tmp) { e->txn->signature = TXN_SIGNATURE_QUORUM_TIMEOUT; txn_limbo_abort(limbo, e); - txn_clear_flag(e->txn, TXN_WAIT_SYNC); - txn_clear_flag(e->txn, TXN_WAIT_ACK); + e->txn->flags &= ~(TXN_WAIT_SYNC | TXN_WAIT_ACK); txn_complete_fail(e->txn); if (e == entry) break; @@ -399,8 +398,7 @@ txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn) } e->is_commit = true; txn_limbo_remove(limbo, e); - txn_clear_flag(e->txn, TXN_WAIT_SYNC); - txn_clear_flag(e->txn, TXN_WAIT_ACK); + e->txn->flags &= ~(TXN_WAIT_SYNC | TXN_WAIT_ACK); /* * If already written to WAL by now, finish tx processing. * Otherwise just clear the sync flags. Tx procesing will finish @@ -456,8 +454,7 @@ txn_limbo_read_rollback(struct txn_limbo *limbo, int64_t lsn) return; rlist_foreach_entry_safe_reverse(e, &limbo->queue, in_queue, tmp) { txn_limbo_abort(limbo, e); - txn_clear_flag(e->txn, TXN_WAIT_SYNC); - txn_clear_flag(e->txn, TXN_WAIT_ACK); + e->txn->flags &= ~(TXN_WAIT_SYNC | TXN_WAIT_ACK); if (e->txn->signature >= 0) { /* Rollback the transaction. */ e->txn->signature = TXN_SIGNATURE_SYNC_ROLLBACK; -- 2.29.2