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 11/13] gc: separate checkpoint references from wal consumers
Date: Fri, 5 Oct 2018 01:05:09 +0300	[thread overview]
Message-ID: <20181004220509.GK22855@chai> (raw)
In-Reply-To: <df173df606d0b98534117bd2ee6d2f7b14a40f7d.1538671546.git.vdavydov.dev@gmail.com>

* Vladimir Davydov <vdavydov.dev@gmail.com> [18/10/05 00:11]:

Pinning and referencing are different concepts :)
I agree with your reasoning and the patch is OK to push.

> Initially, gc_consumer object was used for pinning both checkpoint and
> WAL files, but commit 9c5d851d7830 ("replication: remove old snapshot
> files not needed by replicas") changed that. Now whether a consumer pins
> WALs or checkpoints or both depends on gc_consumer_type. This was done
> so that replicas wouldn't prevent garbage collection of checkpoint
> files, which they don't need after initial join is complete.
> 
> The way the feature was implemented is rather questionable though:
>  - Since consumers of both types are stored in the same binary search
>    tree, we have to iterate through the tree to find the leftmost
>    checkpoint consumer, see gc_tree_first_checkpoint. This looks
>    inefficient and ugly.
>  - The notion of advancing a checkpoint consumer (gc_consumer_advance)
>    is dubious: there's no point to move on to the next checkpoint after
>    reading one - instead the consumer needs incremental changes, i.e.
>    WALs.
> 
> To eliminate those questionable aspects and make the code easier for
> understanding, let's separate WAL and checkpoint consumers. We do this
> by removing gc_consumer_type and making gc_consumer track WALs only.
> For pinning the files corresponding to a checkpoint a new object class
> is introduced, gc_checkpoint_ref. To pin a checkpoint, gc_ref_checkpoint
> needs to be called. It is passed the gc_checkpoint object to pin, the
> consumer name, and the gc_checkpoint_ref to store the ref in. To unpin a
> previously pinned checkpoint, gc_checkpoint_unref should be called.
> 
> References are listed by box.info.gc() for each checkpoint under
> 'references' key.

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

  reply	other threads:[~2018-10-04 22:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 17:20 [PATCH 00/13] box: garbage collection refactoring and fixes Vladimir Davydov
2018-10-04 17:20 ` [PATCH 01/13] vinyl: fix master crash on replica join failure Vladimir Davydov
2018-10-04 21:43   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 02/13] vinyl: force deletion of runs left from unfinished indexes on restart Vladimir Davydov
2018-10-04 21:44   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 03/13] gc: make gc_consumer and gc_state structs transparent Vladimir Davydov
2018-10-04 21:47   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 04/13] gc: use fixed length buffer for storing consumer name Vladimir Davydov
2018-10-04 21:47   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 05/13] gc: fold gc_consumer_new and gc_consumer_delete Vladimir Davydov
2018-10-04 21:50   ` Konstantin Osipov
2018-10-05  8:56     ` Vladimir Davydov
2018-10-04 17:20 ` [PATCH 06/13] gc: format consumer name in gc_consumer_register Vladimir Davydov
2018-10-04 21:50   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 07/13] gc: rename checkpoint_count to min_checkpoint_count Vladimir Davydov
2018-10-04 21:51   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 08/13] gc: keep track of available checkpoints Vladimir Davydov
2018-10-04 21:59   ` Konstantin Osipov
2018-10-05  8:50     ` Vladimir Davydov
2018-10-04 17:20 ` [PATCH 09/13] gc: cleanup garbage collection procedure Vladimir Davydov
2018-10-04 22:00   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 10/13] gc: improve box.info.gc output Vladimir Davydov
2018-10-04 22:01   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 11/13] gc: separate checkpoint references from wal consumers Vladimir Davydov
2018-10-04 22:05   ` Konstantin Osipov [this message]
2018-10-04 17:20 ` [PATCH 12/13] gc: call gc_run unconditionally when consumer is advanced Vladimir Davydov
2018-10-04 22:26   ` Konstantin Osipov
2018-10-04 17:20 ` [PATCH 13/13] replication: ref checkpoint needed to join replica Vladimir Davydov
2018-10-04 22:27   ` Konstantin Osipov
2018-10-05 17:03 ` [PATCH 00/13] box: garbage collection refactoring and fixes 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=20181004220509.GK22855@chai \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH 11/13] gc: separate checkpoint references from wal consumers' \
    /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