[Tarantool-patches] [PATCH v4 12/12] txm: add a test

Aleksandr Lyapunov alyapunov at tarantool.org
Wed Sep 23 14:12:41 MSK 2020


Thanks!
Meanwhile I added more tests and comments and fixed a tiny bug:

diff --git a/src/box/memtx_tx.c b/src/box/memtx_tx.c
index 55748ad..62ddfbe 100644
--- a/src/box/memtx_tx.c
+++ b/src/box/memtx_tx.c
@@ -808,6 +808,11 @@ memtx_tx_history_rollback_stmt(struct txn_stmt *stmt)
         if (stmt->del_story != NULL) {
                 struct memtx_story *story = stmt->del_story;

+               /**
+                * Clear del_story's pointer to the statement.
+                * Since the story hold a list of in-progress delete 
statements,
+                * find the stmt in the list and unlink.
+                */
                 struct txn_stmt **prev = &story->del_stmt;
                 while (*prev != stmt) {
                         prev = &(*prev)->next_in_del_list;
@@ -816,7 +821,7 @@ memtx_tx_history_rollback_stmt(struct txn_stmt *stmt)
                 *prev = stmt->next_in_del_list;
                 stmt->next_in_del_list = NULL;

-               stmt->del_story->del_stmt = NULL;
+               /* And vice versa: clear the statement's pointer to 
story. */
                 stmt->del_story = NULL;
         }
  }

On 23.09.2020 14:07, Nikita Pettik wrote:
>
> Othewise LGTM
>   
>


More information about the Tarantool-patches mailing list