From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 21 Mar 2019 22:28:38 +0300 From: Vladimir Davydov Subject: Re: [PATCH] vinyl: fix recovery after aborted index creation Message-ID: <20190321192838.mopufbiqw75lvl57@esperanza> References: <38fc0bbe800bb3e876e501ab729bb5c1131f173a.1553195373.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <38fc0bbe800bb3e876e501ab729bb5c1131f173a.1553195373.git.vdavydov.dev@gmail.com> To: tarantool-patches@freelists.org List-ID: On Thu, Mar 21, 2019 at 10:11:02PM +0300, Vladimir Davydov wrote: > There's a bug in the code building index hash on recovery: we replace > a dropped index with any newer index, even incomplete one. Apparently, > this is wrong, because a dropped index may have been dropped during > final recovery and hence is still needed for initial recovery. If we > replace it with an incomplete index in the index hash, initial recovery > will fail with > > ER_INVALID_VYLOG_FILE: Invalid VYLOG file: LSM tree 512/1 not found > > (see vy_lsm_recover()). > > Fix this problem by checking create_lsn of the index that is going to > replace a dropped one - if it's negative, we must link it to the dropped > index via vy_lsm_recovery_info->prepared instead of inserting it into > the hash directly. > > Closes #4066 > --- > https://github.com/tarantool/tarantool/issues/4066 > > src/box/vy_log.c | 5 ++-- > test/vinyl/errinj_vylog.result | 55 ++++++++++++++++++++++++++++++++++++++++ > test/vinyl/errinj_vylog.test.lua | 28 ++++++++++++++++++++ > 3 files changed, 86 insertions(+), 2 deletions(-) Urgent - affects a customer. Pushed to master, 2.1, and 1.10.