[Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing

Serge Petrenko sergepetrenko at tarantool.org
Fri Jun 19 20:53:56 MSK 2020


18.06.2020 15:14, Serge Petrenko пишет:
> Now txn_limbo writes a ROLLBACK entry to WAL when one of the limbo
> entries fails to gather quorum during a txn_limbo_confirm_timeout.
> All the limbo entries, starting with the failed one, are rolled back in
> reverse order.
>
> Closes #4848

Added a new commit:

commit c3c3d6739add2d26b45e6ba0fd571b502b125c57
Author: Serge Petrenko <sergepetrenko at tarantool.org>
Date:   Fri Jun 19 08:30:43 2020 +0300

     Fix ROLLBACK handling during recovery and in row encoding

     [TO BE SQUASHED INTO THE PREVIOUS COMMIT]

diff --git a/src/box/box.cc b/src/box/box.cc
index 23c5aed95..8ba7ffafb 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -343,7 +343,7 @@ apply_wal_row(struct xstream *stream, struct 
xrow_header *row)
  {
         struct request request;
         // TODO: process confirmation during recovery.
-       if (row->type == IPROTO_CONFIRM)
+       if (iproto_type_is_synchro_request(row->type))
                 return;
         xrow_decode_dml_xc(row, &request, dml_request_key_map(row->type));
         if (request.type != IPROTO_NOP) {
diff --git a/src/box/txn.c b/src/box/txn.c
index 52e1c36dd..2360ecae3 100644
--- a/src/box/txn.c
+++ b/src/box/txn.c
@@ -83,10 +83,10 @@ txn_add_redo(struct txn *txn, struct txn_stmt *stmt, 
struct request *request)
         struct space *space = stmt->space;
         row->group_id = space != NULL ? space_group_id(space) : 0;
         /*
-        * IPROTO_CONFIRM entries are supplementary and aren't
-        * valid dml requests. They're encoded manually.
+        * Sychronous replication entries are supplementary and
+        * aren't valid dml requests. They're encoded manually.
          */
-       if (likely(row->type != IPROTO_CONFIRM))
+       if (likely(!iproto_type_is_synchro_request(row->type)))
                 row->bodycnt = xrow_encode_dml(request, &txn->region, 
row->body);
         if (row->bodycnt < 0)
                 return -1;


>    * Return TRUE if limbo is empty.
>    */

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list