From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 20 Aug 2019 15:05:18 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH v2 7/7] relay: join new replicas off read view Message-ID: <20190820120518.GU13834@esperanza> References: <9ed5cd28b89751e0f4edd8f8c9a57d66ba2bd5f8.1566233187.git.vdavydov.dev@gmail.com> <20190819205721.GH21602@atlas> <20190820081655.GR13834@esperanza> <20190820115333.GC8932@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820115333.GC8932@atlas> To: Konstantin Osipov Cc: tarantool-patches@freelists.org List-ID: On Tue, Aug 20, 2019 at 02:53:33PM +0300, Konstantin Osipov wrote: > * Vladimir Davydov [19/08/20 11:22]: > > > > Historically, we join a new replica off the last checkpoint. As a > > > > result, we must always keep the last memtx snapshot and all vinyl data > > > > files corresponding to it. Actually, there's no need to use the last > > > > checkpoint for joining a replica. Instead we can use the current read > > > > view as both memtx and vinyl support it. This should speed up the > > > > process of joining a new replica, because we don't need to replay all > > > > xlogs written after the last checkpoint, only those that are accumulated > > > > while we are relaying the current read view. This should also allow us > > > > to avoid creating a snapshot file on bootstrap, because the only reason > > > > why we need it is allowing joining replicas. Besides, this is a step > > > > towards decoupling the vinyl metadata log from checkpointing in > > > > particular and from xlogs in general. > > > > > > > > > > How does this work given relay_* functions are running in a relay thread? > > > > Those functions don't run in a relay thread. Just like in case of index > > build, we open and use iterators in the tx thread. > > Then they shouldn't be prefixed relay_*, this is confusing. Well, yeah, kinda. OTOH they do relay data to a replica that's why I named them relay_something :-/ Also, those functions live in relay.cc, which is consistent with the relay_ prefix. If not relay_, what prefix do you think we should use then? join_? May be, we should also move those functions to a separate file? join.c?