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 4264063354; Fri, 22 Jan 2021 16:28:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4264063354 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1611322089; bh=3mncCmJuezZWJ2zN7eE8uRs3FJDW6/3SrBKyDSKz7sA=; 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=CjWYxIZwPNG+0Fzknjh/esi9W3FgbFbTQzEMoXErECXW61Y5yfornAC4PO/43l5AW EF6GWCdDe3WLFwIdCB7QmfTLowOGbw/4SIlZl2ANm6wFgRMG5z8wX8V7xEO8+My4/S HWvfuXRbV03xlzSJiA0963GPDmcPZkk4wCPGtbZg= Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 C64DA63354 for ; Fri, 22 Jan 2021 16:27:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C64DA63354 Received: by mail-lj1-f170.google.com with SMTP id x23so6496532lji.7 for ; Fri, 22 Jan 2021 05:27:31 -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=tbTqTohQ4erXG1SjO8OyxONrlOgwRzVKLFZY50Jt704=; b=VGNj5G1I4SpHjbdVY9+KCGfFJhO6qRy3gow5BYMrGGD0N7oodIXynIxkfHUAeGkmnE aS1OdLOePCnNFyuSytJJrExVzrqrQnlz6LOld35+/G1H0JrdCeU4RLsUWj624VMFzgzT ct4MrZ6QJ59Vndu5utBTAfV/wVFRRkfrzsCQ0uUfwxZwnG+92l3YEvVj+jaKtFDoZfqU fPPG/CpRn+nAlIr3fR+oQdP3WSFk3vJi0O+Le5Bb7CbrH2XgSkuJClaijgqv+DALtY4h Tj+eHhyE66AClwZyFts21COgoODSiM1mCukyHsKjk7vmY40Elk6B3Df2QdcWIVMSZNt3 a1MQ== X-Gm-Message-State: AOAM530M3XhJY5gkBwEAQi/ucQHkmgQ+fWpvWyqAhgV+UYYtgpCTNYjJ mSzU0NVGE4/rw95d62qoXfKR0/kXeZA= X-Google-Smtp-Source: ABdhPJxPs7vcFUC+/Q2HlwisJDPQ7XJVobmUzVFIRsTGeqiR70WNLKWZgkznoSO+OSnW+7h8sLkJlA== X-Received: by 2002:a05:651c:2dd:: with SMTP id f29mr1782757ljo.235.1611322050721; Fri, 22 Jan 2021 05:27:30 -0800 (PST) Received: from grain.localdomain ([5.18.91.94]) by smtp.gmail.com with ESMTPSA id z6sm961606ljz.71.2021.01.22.05.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 05:27:29 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 9DB2A5609D1; Fri, 22 Jan 2021 16:27:04 +0300 (MSK) To: tml Date: Fri, 22 Jan 2021 16:26:56 +0300 Message-Id: <20210122132700.272816-3-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 2/6] txn: stop using txn_set_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/applier.cc | 4 ++-- src/box/memtx_engine.c | 2 +- src/box/txn.c | 13 ++++++------- src/box/txn.h | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/box/applier.cc b/src/box/applier.cc index 553db76fc..c7c85d329 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -237,7 +237,7 @@ apply_snapshot_row(struct xrow_header *row) * Do not wait for confirmation when fetching a snapshot. * Master only sends confirmed rows during join. */ - txn_set_flag(txn, TXN_FORCE_ASYNC); + txn->flags |= TXN_FORCE_ASYNC; if (txn_begin_stmt(txn, space) != 0) goto rollback; /* no access checks here - applier always works with admin privs */ @@ -308,7 +308,7 @@ apply_final_join_row(struct xrow_header *row) * Do not wait for confirmation while processing final * join rows. See apply_snapshot_row(). */ - txn_set_flag(txn, TXN_FORCE_ASYNC); + txn->flags |= TXN_FORCE_ASYNC; if (apply_row(row) != 0) { txn_rollback(txn); fiber_gc(); diff --git a/src/box/memtx_engine.c b/src/box/memtx_engine.c index f79f14b4f..f0df3a07d 100644 --- a/src/box/memtx_engine.c +++ b/src/box/memtx_engine.c @@ -265,7 +265,7 @@ memtx_engine_recover_snapshot_row(struct memtx_engine *memtx, * Snapshot rows are confirmed by definition. They don't need to go to * the synchronous transactions limbo. */ - txn_set_flag(txn, TXN_FORCE_ASYNC); + txn->flags |= TXN_FORCE_ASYNC; rc = txn_commit(txn); /* * Don't let gc pool grow too much. Yet to diff --git a/src/box/txn.c b/src/box/txn.c index a5edbfc60..32eca02c5 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -282,7 +282,7 @@ txn_begin(void) * It's a responsibility of an engine to disable yields * if they are not supported. */ - txn_set_flag(txn, TXN_CAN_YIELD); + txn->flags |= TXN_CAN_YIELD; return txn; } @@ -516,7 +516,7 @@ txn_free_or_wakeup(struct txn *txn) if (txn->fiber == NULL) txn_free(txn); else { - txn_set_flag(txn, TXN_IS_DONE); + txn->flags |= TXN_IS_DONE; if (txn->fiber != fiber()) /* Wake a waiting fiber up. */ fiber_wakeup(txn->fiber); @@ -642,8 +642,7 @@ txn_journal_entry_new(struct txn *txn) */ if (!txn_has_flag(txn, TXN_FORCE_ASYNC)) { if (is_sync) { - txn_set_flag(txn, TXN_WAIT_SYNC); - txn_set_flag(txn, TXN_WAIT_ACK); + txn->flags |= TXN_WAIT_SYNC | TXN_WAIT_ACK; } else if (!txn_limbo_is_empty(&txn_limbo)) { /* * There some sync entries on the @@ -652,7 +651,7 @@ txn_journal_entry_new(struct txn *txn) * doesn't touch sync space (each sync txn * should be considered as a barrier). */ - txn_set_flag(txn, TXN_WAIT_SYNC); + txn->flags |= TXN_WAIT_SYNC; } } @@ -994,7 +993,7 @@ txn_can_yield(struct txn *txn, bool set) assert(txn == in_txn()); bool could = txn_has_flag(txn, TXN_CAN_YIELD); if (set && !could) { - txn_set_flag(txn, TXN_CAN_YIELD); + txn->flags |= TXN_CAN_YIELD; trigger_clear(&txn->fiber_on_yield); } else if (!set && could) { txn_clear_flag(txn, TXN_CAN_YIELD); @@ -1229,6 +1228,6 @@ txn_on_yield(struct trigger *trigger, void *event) assert(txn != NULL); assert(!txn_has_flag(txn, TXN_CAN_YIELD)); txn_rollback_to_svp(txn, NULL); - txn_set_flag(txn, TXN_IS_ABORTED_BY_YIELD); + txn->flags |= TXN_IS_ABORTED_BY_YIELD; return 0; } diff --git a/src/box/txn.h b/src/box/txn.h index b42249b17..201564000 100644 --- a/src/box/txn.h +++ b/src/box/txn.h @@ -491,7 +491,7 @@ txn_init_triggers(struct txn *txn) rlist_create(&txn->on_commit); rlist_create(&txn->on_rollback); rlist_create(&txn->on_wal_write); - txn_set_flag(txn, TXN_HAS_TRIGGERS); + txn->flags |= TXN_HAS_TRIGGERS; } } -- 2.29.2