[Tarantool-patches] [PATCH 5/5] txn: use txn_set_flag

Cyrill Gorcunov gorcunov at gmail.com
Fri Jun 26 17:52:27 MSK 2020


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 <gorcunov at gmail.com>
---
 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



More information about the Tarantool-patches mailing list