Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH] vinyl: fix compaction vs checkpoint race resulting in invalid gc
Date: Fri, 1 Jun 2018 21:51:35 +0300	[thread overview]
Message-ID: <20180601185135.GC22817@atlas> (raw)
In-Reply-To: <09ab67b920b5207ac3b47d797412da94b1fe8336.1527769684.git.vdavydov.dev@gmail.com>

* Vladimir Davydov <vdavydov.dev@gmail.com> [18/05/31 15:51]:
> The callback invoked upon compaction completion uses checkpoint_last()
> to determine whether compacted runs may be deleted: if the max LSN
> stored in a compacted run (run->dump_lsn) is greater than the LSN of the
> last checkpoint (gc_lsn) then the run doesn't belong to the last
> checkpoint and hence is safe to delete, see commit 35db70fac55c ("vinyl:
> remove runs not referenced by any checkpoint immediately").
> 
> The problem is checkpoint_last() isn't synced with vylog rotation - it
> returns the signature of the last successfully created memtx snapshot
> and is updated in memtx_engine_commit_checkpoint() after vylog is
> rotated. If a compaction task completes after vylog is rotated but
> before snap file is renamed, it will assume that compacted runs do not
> belong to the last checkpoint, although they do (as they have been
> appended to the rotated vylog), and delete them.
> 
> To eliminate this race, let's use vylog signature instead of snap
> signature in vy_task_compact_complete().
> 
> Closes #3437


Pushed.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

      reply	other threads:[~2018-06-01 18:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 12:51 Vladimir Davydov
2018-06-01 18:51 ` Konstantin Osipov [this message]

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=20180601185135.GC22817@atlas \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH] vinyl: fix compaction vs checkpoint race resulting in invalid gc' \
    /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