From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [tarantool-patches] [PATCH v2] memtx: add yields during index build From: Serge Petrenko In-Reply-To: <20190523152544.GA17820@atlas> Date: Tue, 28 May 2019 18:36:09 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190523141111.14885-1-sergepetrenko@tarantool.org> <20190523152544.GA17820@atlas> To: Konstantin Osipov Cc: tarantool-patches@freelists.org, Vladimir Davydov List-ID: > 23 =D0=BC=D0=B0=D1=8F 2019 =D0=B3., =D0=B2 18:25, Konstantin Osipov = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0):= >=20 > * Serge Petrenko [19/05/23 17:58]: >> Memtx index build used to stall event loop for all the build period. >> Add occasional yields so that the loop is not blocked for too long. >> Also make index build set on_replace triggers so that concurrent >> replaces are also correctly handled during the build. >>=20 >> Closes #3976 >=20 > The next piece of the puzzle is we need to understand how this > replicates.=20 >=20 > What would be the order of such a concurrent execution on replica?=20 >=20 > I'd assume it would stop the applier until the build is finished, > is this right, Georgy?=20 Georgy says that=E2=80=99s right, applier holds the latch until wal = write happens, i.e. during the whole index build process >=20 > I think this is the only reasonable and safe thing to do, do you > have other opinions? >=20 > If no, we just need to test it with some timeout injections on > replica, in particular add a test which breaks replication by > inserting a conflicting row while the index is being built. > This test would be useful for both engines, I guess. >=20 > --=20 > Konstantin Osipov, Moscow, Russia