Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Serge Petrenko <sergepetrenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] relay: move relay_schedule_pending_gc before status update
Date: Thu, 16 Apr 2020 15:38:02 +0300	[thread overview]
Message-ID: <20200416123802.GS3072@uranus> (raw)
In-Reply-To: <20200416120658.33777-1-sergepetrenko@tarantool.org>

On Thu, Apr 16, 2020 at 03:06:58PM +0300, Serge Petrenko wrote:
> relay_schedule_pending_gc() is executed after relay status update,
> which made perfect sense before we've introduced local spaces rework, making
> local space operations use a special instance id: 0.
> Relay status update is performed only when the remote instance has
> reported a bigger vclock, than its previous one. However, we may have an
> entire WAL file filled with local space changes, in which case the
> changes won't be transmitted to replica, and it will report the same
> vclock as before, postponing the scheduled gc until a non-local row is
> created on master.
> 
> Fix this by reordering relay_schedule_pending_gc() and relay status
> update. In case nothing new is added to pending_gc queue and replica
> clock is not updated, relay_schedule_pending_gc() will exit on the first
> loop iteration, so it doesn't add an overhead.
> 
> Also make relay_schedule_pending_gc() use vclock_compare_ignore0() instead
> of plain vclock_compare().
> 
> Follow-up #4114
> ---
> This code was present in v5 of the patchset regarding local space replication
> rework, but I accidentally threw it  away during the review. Sorry.
> The letter was "[PATCH v5 2/4] replication: hide 0-th vclock components in
> replication responses"
> 
> Branch:  https://github.com/tarantool/tarantool/tree/sp/relay-gc-fix

Maybe it worth to have two commits?

 - use vclock_compare_ignore0 in relay_schedule_pending_gc
 - reorder relay_schedule_pending_gc

  parent reply	other threads:[~2020-04-16 12:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 12:06 Serge Petrenko
2020-04-16 12:37 ` Kirill Yukhin
2020-04-16 12:38 ` Cyrill Gorcunov [this message]
2020-04-16 12:42   ` [Tarantool-patches] [PATCH] relay: move relay_schedule_pending_gc before status Cyrill Gorcunov
2020-04-17  7:02     ` Kirill Yukhin
2020-04-17  7:10       ` Cyrill Gorcunov

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=20200416123802.GS3072@uranus \
    --to=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] relay: move relay_schedule_pending_gc before status update' \
    /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