From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 44107446439 for ; Thu, 22 Oct 2020 19:02:46 +0300 (MSK) From: Aleksandr Lyapunov Date: Thu, 22 Oct 2020 19:02:32 +0300 Message-Id: <1603382553-5570-2-git-send-email-alyapunov@tarantool.org> In-Reply-To: <1603382553-5570-1-git-send-email-alyapunov@tarantool.org> References: <1603382553-5570-1-git-send-email-alyapunov@tarantool.org> Subject: [Tarantool-patches] [PATCH 1/2] memtx: fix a bug in unlinking story lists List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, Nikita Pettik , "Alexander V . Tikhonov" Tx stories must be linked into correct double-linked list. Preserve it. Part of #5423 --- src/box/memtx_tx.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/box/memtx_tx.c b/src/box/memtx_tx.c index 55748ad..e378054 100644 --- a/src/box/memtx_tx.c +++ b/src/box/memtx_tx.c @@ -433,9 +433,20 @@ memtx_tx_story_gc_step() } assert(story->tuple == unused); } - memtx_tx_story_unlink(story, i); + + if (link->older.is_story) { + struct memtx_story *older_story = link->older.story; + memtx_tx_story_unlink(story, i); + older_story->link[i].newer_story = older_story; + } else { + memtx_tx_story_unlink(story, i); + } } else { + /* Just unlink from list */ link->newer_story->link[i].older = link->older; + if (link->older.is_story) + link->older.story->link[i].newer_story = + link->newer_story; link->older.is_story = false; link->older.story = NULL; link->newer_story = NULL; -- 2.7.4