From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6FEEB440F40 for ; Tue, 19 Nov 2019 19:05:02 +0300 (MSK) From: Georgy Kirichenko Date: Tue, 19 Nov 2019 19:04:55 +0300 Message-Id: <2a163e6a73264afa64e5db2844b65f355e4d805f.1574178520.git.georgy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 4/6] vinyl: do not insert vy_tx twice into writers list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org 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