From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id F420E441840 for ; Mon, 30 Mar 2020 15:58:55 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id w1so17917586ljh.5 for ; Mon, 30 Mar 2020 05:58:55 -0700 (PDT) Date: Mon, 30 Mar 2020 15:58:53 +0300 From: Konstantin Osipov Message-ID: <20200330125853.GF17886@atlas> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v5 4/4] box: start counting local space requests separately List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org * Serge Petrenko [20/03/30 14:08]: > diff --git a/src/box/box.cc b/src/box/box.cc > index bf95d1b5e..0762266b0 100644 > --- a/src/box/box.cc > +++ b/src/box/box.cc > @@ -1879,6 +1879,23 @@ box_process_subscribe(struct ev_io *io, struct xrow_header *header) > say_info("remote vclock %s local vclock %s", > vclock_to_string(&replica_clock), vclock_to_string(&vclock)); > > + /* > + * Replica clock is used in gc state and recovery > + * initialization, so we need to replace the remote 0-th > + * component with our own one. This doesn't break > + * recovery: it finds the WAL with a vclock strictly less > + * than replia clock in all components except the 0th one. > + * This leads to finding the correct WAL, if it exists, > + * since we do not need to recover local rows (the ones, > + * that contribute to the 0-th vclock component). > + * Note, that it would be bad to set 0-th vclock component > + * to a smaller value, since it would unnecessarily > + * require additional WALs, which may have already been > + * deleted. > + * Speaking of gc, remote instances' local vclock > + * components are not used by consumers at all. > + */ > + vclock_reset(&replica_clock, 0, vclock_get(&replicaset.vclock, 0)); I would love to get rid of any use of vclock_reset() outside vclock.c, but it seems I can't. lgtm. -- Konstantin Osipov, Moscow, Russia https://scylladb.com