From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Vladimir Davydov Subject: [PATCH v2 6/8] vinyl: relax limitation imposed on run min/max lsn Date: Sun, 27 May 2018 22:05:54 +0300 Message-Id: In-Reply-To: References: In-Reply-To: References: To: kostja@tarantool.org Cc: tarantool-patches@freelists.org List-ID: Currently, we assume that no two runs of the same range intersect by LSN. This holds, because LSNs grow strictly monotonically, and no transaction may be split between two runs (as we pin each affected vy_mem until the transaction is complete). We ensure this with an assertion in vy_task_dump_complete. However, when building a new index we can't increment tx_manager->lsn so there may be multiple statements with the same LSN. This is OK as for each particular key, two statements will still have different LSNs, but this may break the assertion in vy_task_dump_complete in case dump occurs while build is in progress. To avoid that, let's relax the condition under the assertion and assume that a run's max_lsn may be equal min_lsn of the newer run. Needed for #1653 --- src/box/vy_scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/box/vy_scheduler.c b/src/box/vy_scheduler.c index d1545e76..eff3a814 100644 --- a/src/box/vy_scheduler.c +++ b/src/box/vy_scheduler.c @@ -731,7 +731,7 @@ vy_task_dump_complete(struct vy_scheduler *scheduler, struct vy_task *task) goto delete_mems; } - assert(new_run->info.min_lsn > lsm->dump_lsn); + assert(new_run->info.min_lsn >= lsm->dump_lsn); assert(new_run->info.max_lsn <= dump_lsn); /* -- 2.11.0