From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B085C42EF5F for ; Fri, 26 Jun 2020 17:53:32 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id n24so10619262lji.10 for ; Fri, 26 Jun 2020 07:53:32 -0700 (PDT) From: Cyrill Gorcunov Date: Fri, 26 Jun 2020 17:52:27 +0300 Message-Id: <20200626145227.1507426-6-gorcunov@gmail.com> In-Reply-To: <20200626145227.1507426-1-gorcunov@gmail.com> References: <20200626145227.1507426-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 5/5] txn: use txn_set_flag List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Vladislav Shpilevoy To operate with flags we've three helpers: _set, _clear and _has. No need for additional wrapper. Same time it is more convenient to grep for TXN_FORCE_ASYNC directly. In-scope-of #4842 Signed-off-by: Cyrill Gorcunov --- src/box/applier.cc | 4 ++-- src/box/txn.h | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/box/applier.cc b/src/box/applier.cc index 2d1047d43..04b557051 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -219,7 +219,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_force_async(txn); + txn_set_flag(txn, TXN_FORCE_ASYNC); if (txn_begin_stmt(txn, space) != 0) goto rollback; /* no access checks here - applier always works with admin privs */ @@ -336,7 +336,7 @@ apply_final_join_row(struct xrow_header *row) * Do not wait for confirmation while processing final * join rows. See apply_snapshot_row(). */ - txn_force_async(txn); + txn_set_flag(txn, TXN_FORCE_ASYNC); if (apply_row(row) != 0) { txn_rollback(txn); fiber_gc(); diff --git a/src/box/txn.h b/src/box/txn.h index d10c51f0f..c631d7033 100644 --- a/src/box/txn.h +++ b/src/box/txn.h @@ -287,16 +287,6 @@ txn_clear_flag(struct txn *txn, enum txn_flag flag) txn->flags &= ~(1 << flag); } -/** - * Force async mode for transaction. It won't wait for acks - * or confirmation. - */ -static inline void -txn_force_async(struct txn *txn) -{ - txn_set_flag(txn, TXN_FORCE_ASYNC); -} - /* Pointer to the current transaction (if any) */ static inline struct txn * in_txn(void) -- 2.26.2