From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4E69A469710 for ; Sun, 10 May 2020 22:59:03 +0300 (MSK) References: <5012bd8eb07b5379eb70aa777402c7cd566a3b34.1588273848.git.korablev@tarantool.org> <959a3f72-6b95-30b1-c838-3b9e2bebc04c@tarantool.org> <20200507130256.GB11724@tarantool.org> <5a697151-e6fc-c567-ccf6-8d02a1df340e@tarantool.org> <20200507223625.GB13970@tarantool.org> From: Vladislav Shpilevoy Message-ID: <10f1d262-b1ae-ba9a-fdae-efc9229ccd52@tarantool.org> Date: Sun, 10 May 2020 21:59:01 +0200 MIME-Version: 1.0 In-Reply-To: <20200507223625.GB13970@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 2/2] vinyl: drop wasted runs in case range recovery fails List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the fixes! See 1 comment below. > diff --git a/test/vinyl/gh-4805-open-run-err-recovery.result b/test/vinyl/gh-4805-open-run-err-recovery.result > new file mode 100644 > index 000000000..31e0e7857 > --- /dev/null > +++ b/test/vinyl/gh-4805-open-run-err-recovery.result > @@ -0,0 +1,101 @@ > +-- test-run result file version 2 > +fiber = require('fiber') > + | --- > + | ... > +test_run = require('test_run').new() > + | --- > + | ... > + > +test_run:cmd('create server err_recovery with script = "vinyl/errinj_recovery.lua"') > + | --- > + | - true > + | ... > +test_run:cmd('start server err_recovery') > + | --- > + | - true > + | ... > +test_run:cmd('switch err_recovery') > + | --- > + | - true > + | ... > + > +s = box.schema.space.create('test', {engine = 'vinyl'}) > + | --- > + | ... > +_ = s:create_index('pk', {run_count_per_level = 100, page_size = 128, range_size = 1024}) > + | --- > + | ... > + > +digest = require('digest') > + | --- > + | ... > +test_run:cmd("setopt delimiter ';'") > + | --- > + | - true > + | ... > +function dump(big) > + local step = big and 1 or 5 > + for i = 1, 20, step do > + s:replace{i, digest.urandom(1000)} > + end > + box.snapshot() > +end; > + | --- > + | ... > +test_run:cmd("setopt delimiter ''"); > + | --- > + | - true > + | ... > + > +dump(true) > + | --- > + | ... > +dump() > + | --- > + | ... > +dump() > + | --- > + | ... > + > +test_run:cmd('switch default') > + | --- > + | - true > + | ... > +test_run:cmd('stop server err_recovery') > + | --- > + | - true > + | ... > +test_run:cmd('start server err_recovery with crash_expected=True') > + | --- > + | - false > + | ... > + > +fio = require('fio') > + | --- > + | ... > +fh = fio.open(fio.pathjoin(fio.cwd(), 'errinj_recovery.log'), {'O_RDONLY'}) > + | --- > + | ... > +size = fh:seek(0, 'SEEK_END') > + | --- > + | ... > +fh:seek(-256, 'SEEK_END') ~= nil > + | --- > + | - true > + | ... > +line = fh:read(256) > + | --- > + | ... > +fh:close() > + | --- > + | - true > + | ... > +string.match(line, 'failed to open') ~= nil Why can't you use test_run:grep_log()? It supports searching in logs of an already crashed instance too. See its parameters in test_run.lua. Looks like it can solve your task.