From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 28 Jun 2018 15:27:45 +0300 From: Vladimir Davydov Subject: Re: [PATCH v5 2/2] xlog: Remove inprogress files on start Message-ID: <20180628122745.rqc43nt75wi62mkn@esperanza> References: <1767e811d5608a47549cdcd750ab77d0c8f82970.1529511845.git.imarkov@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1767e811d5608a47549cdcd750ab77d0c8f82970.1529511845.git.imarkov@tarantool.org> To: Ilya Markov Cc: georgy@tarantool.org, tarantool-patches@freelists.org List-ID: On Wed, Jun 20, 2018 at 07:25:56PM +0300, Ilya Markov wrote: > When tarantool crashes during writing to vylog, index, run or snapshot, > inprogress files remain. But garbage collector doesn't take into account > these files. So they remain until they are removed manually. > > Fix this with adding deletion of such files to functions memtx_engine_end_recovery, > vinyl_engine_end_recovery and vy_run_remove_files. > > - Add 3 errinj which simulate the crash before renaming inprogress files. > - Moved const string inprogress_suffix to xlog.h and replace it with > #defiled string in order to reuse it in vinyl run and index files removal. > - Add 2 new vy_file_type in order to support formatting of inprogress > files names. > > Closes #3406 > --- > src/box/memtx_engine.c | 1 + > src/box/vinyl.c | 3 + > src/box/vy_log.c | 7 +- > src/box/vy_run.c | 19 ++++- > src/box/vy_run.h | 2 + > src/box/xlog.c | 29 +++++++- > src/box/xlog.h | 11 +++ > src/errinj.h | 3 + > test/box/errinj.result | 185 +++++++++++++++++++++++++++++++++++++++++++++++ > test/box/errinj.test.lua | 72 +++++++++++++++++- > 10 files changed, 326 insertions(+), 6 deletions(-) Reworked the test, polished the code, and pushed.