[Tarantool-patches] [PATCH 4/6] vinyl: do not insert vy_tx twice into writers list

Georgy Kirichenko georgy at tarantool.org
Tue Nov 19 19:04:55 MSK 2019


If some cases (like there is not data update in case of recovery) a
vy_tx could be inserted twice into the corresponding writers list as
the vy_tx would have empty log. So check that a vy_tx is already
inserted.
This was not detected before as we did not do recovery preserving
transaction boundaries before.

Part of #980
---
 src/box/vy_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/box/vy_tx.c b/src/box/vy_tx.c
index d092e0cdb..990c0df85 100644
--- a/src/box/vy_tx.c
+++ b/src/box/vy_tx.c
@@ -895,7 +895,7 @@ vy_tx_begin_statement(struct vy_tx *tx, struct space *space, void **savepoint)
 	}
 	assert(tx->state == VINYL_TX_READY);
 	tx->last_stmt_space = space;
-	if (stailq_empty(&tx->log))
+	if (stailq_empty(&tx->log) && rlist_empty(&tx->in_writers))
 		rlist_add_entry(&tx->xm->writers, tx, in_writers);
 	*savepoint = stailq_last(&tx->log);
 	return 0;
-- 
2.24.0



More information about the Tarantool-patches mailing list