Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH v2 6/8] vinyl: relax limitation imposed on run min/max lsn
Date: Sun, 27 May 2018 22:05:54 +0300	[thread overview]
Message-ID: <d5b37d6905495e982c274f2912af0f79c7d3bb10.1527446023.git.vdavydov.dev@gmail.com> (raw)
In-Reply-To: <cover.1527446023.git.vdavydov.dev@gmail.com>
In-Reply-To: <cover.1527446023.git.vdavydov.dev@gmail.com>

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

  parent reply	other threads:[~2018-05-27 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-27 19:05 [PATCH v2 0/8] Allow to build indexes for vinyl spaces Vladimir Davydov
2018-05-27 19:05 ` [PATCH v2 1/8] vinyl: allocate key parts in vy_recovery_do_create_lsm Vladimir Davydov
2018-05-30 11:51   ` Konstantin Osipov
2018-05-27 19:05 ` [PATCH v2 2/8] vinyl: update recovery context with records written during recovery Vladimir Davydov
2018-05-30 11:51   ` Konstantin Osipov
2018-05-27 19:05 ` [PATCH v2 3/8] vinyl: log new index before WAL write on DDL Vladimir Davydov
2018-06-06 18:01   ` Konstantin Osipov
2018-05-27 19:05 ` [PATCH v2 4/8] vinyl: bump mem version after committing statement Vladimir Davydov
2018-06-07  5:41   ` Konstantin Osipov
2018-05-27 19:05 ` [PATCH v2 5/8] vinyl: allow to commit statements to mem in arbitrary order Vladimir Davydov
2018-06-07  5:41   ` Konstantin Osipov
2018-05-27 19:05 ` Vladimir Davydov [this message]
2018-05-27 19:05 ` [PATCH v2 7/8] vinyl: factor out vy_check_is_unique_secondary Vladimir Davydov
2018-05-27 19:05 ` [PATCH v2 8/8] vinyl: allow to build secondary index for non-empty space Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5b37d6905495e982c274f2912af0f79c7d3bb10.1527446023.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH v2 6/8] vinyl: relax limitation imposed on run min/max lsn' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox