[Tarantool-patches] [PATCH v7 8/8] applier: drop process_synchro_row

Cyrill Gorcunov gorcunov at gmail.com
Sat Aug 15 00:14:42 MSK 2020


Handling of synchro requests now are passed
via separate apply_synchro_row helper so
we no longer need process_synchro_row and
can drop it.

Closes #5129

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/box/applier.cc | 38 +++++---------------------------------
 1 file changed, 5 insertions(+), 33 deletions(-)

diff --git a/src/box/applier.cc b/src/box/applier.cc
index a1ce7a23f..7652e1acd 100644
--- a/src/box/applier.cc
+++ b/src/box/applier.cc
@@ -270,45 +270,17 @@ process_nop(struct request *request)
 	return txn_commit_stmt(txn, request);
 }
 
-/*
- * CONFIRM/ROLLBACK rows aren't dml requests  and require special
- * handling: instead of performing some operations on spaces,
- * processing these requests requires txn_limbo to either confirm
- * or rollback some of its entries.
- */
 static int
-process_synchro_row(struct request *request)
+apply_row(struct xrow_header *row)
 {
-	assert(iproto_type_is_synchro_request(request->header->type));
-	struct txn *txn = in_txn();
+	struct request request;
 
-	struct synchro_request syn_req;
-	if (xrow_decode_synchro(request->header, &syn_req) != 0)
-		return -1;
-	assert(txn->n_applier_rows == 0);
 	/*
-	 * This is not really a transaction. It just uses txn API
-	 * to put the data into WAL. And obviously it should not
-	 * go to the limbo and block on the very same sync
-	 * transaction which it tries to confirm now.
+	 * Synchro requests must never use txn engine,
+	 * instead they are handled separately.
 	 */
-	txn_set_flag(txn, TXN_FORCE_ASYNC);
+	assert(!iproto_type_is_synchro_request(row->type));
 
-	if (txn_begin_stmt(txn, NULL) != 0)
-		return -1;
-	if (txn_commit_stmt(txn, request) != 0)
-		return -1;
-	return txn_limbo_process(&txn_limbo, &syn_req);
-}
-
-static int
-apply_row(struct xrow_header *row)
-{
-	struct request request;
-	if (iproto_type_is_synchro_request(row->type)) {
-		request.header = row;
-		return process_synchro_row(&request);
-	}
 	if (xrow_decode_dml(row, &request, dml_request_key_map(row->type)) != 0)
 		return -1;
 	if (request.type == IPROTO_NOP)
-- 
2.26.2



More information about the Tarantool-patches mailing list