From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 8 Feb 2019 12:57:49 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] [PATCH v2 1/2] Do not promote wal vclock for failed writes Message-ID: <20190208095749.wv7wwlzbrzuo2th4@esperanza> References: <79a9eeb9870e15a826d7e64f186b8010ad836a64.1549556742.git.georgy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79a9eeb9870e15a826d7e64f186b8010ad836a64.1549556742.git.georgy@tarantool.org> To: Georgy Kirichenko Cc: tarantool-patches@freelists.org List-ID: On Thu, Feb 07, 2019 at 08:27:30PM +0300, Georgy Kirichenko wrote: > diff --git a/test/box/errinj.result b/test/box/errinj.result > index 12303670e..1d9a16d8d 100644 > --- a/test/box/errinj.result > +++ b/test/box/errinj.result > @@ -141,6 +141,15 @@ errinj.set("ERRINJ_TESTING", false) > --- > - ok > ... > +env = require('test_run') > +--- > +... > +test_run = env.new() > +--- > +... > +lsn1 = box.info.vclock[box.info.id] > +--- > +... > -- Check how well we handle a failed log write > errinj.set("ERRINJ_WAL_IO", true) > --- > @@ -161,6 +170,11 @@ space:insert{1} > --- > - [1] > ... > +-- Check vclock was promoted only one time > +box.info.vclock[box.info.id] == lsn1 + 1 > +--- > +- true > +... > errinj.set("ERRINJ_WAL_IO", true) > --- > - ok > @@ -180,6 +194,15 @@ errinj.set("ERRINJ_WAL_IO", false) > --- > - ok > ... > +space:update(1, {{'=', 2, 2}}) > +--- > +- [1, 2] > +... > +-- Check vclock was promoted only two times > +box.info.vclock[box.info.id] == lsn1 + 2 > +--- > +- true > +... > space:truncate() > --- > ... You didn't sync box/errinj.result properly. To be exact, you synced it in the next patch. > diff --git a/test/box/errinj.test.lua b/test/box/errinj.test.lua > index 6f491d623..39d73b57e 100644 > --- a/test/box/errinj.test.lua > +++ b/test/box/errinj.test.lua > @@ -18,11 +18,31 @@ space:insert{1} > space:get{1} > errinj.set("ERRINJ_WAL_IO", false) > space:insert{1} > +-- Check vclock was promoted only one time Pointless change. > errinj.set("ERRINJ_WAL_IO", true) > space:update(1, {{'=', 2, 2}}) > space:get{1} > space:get{2} > errinj.set("ERRINJ_WAL_IO", false) > +space:update(1, {{'=', 2, 2}}) > +-- Check vclock was promoted only two times Pointless change. Please be more careful. I fixed those bloopers by myself. > +space:truncate() > + > +lsn1 = box.info.vclock[box.info.id] > +-- Check how well we handle a failed log write > +errinj.set("ERRINJ_WAL_WRITE_PARTIAL", 0) > +space:insert{1} > +errinj.set("ERRINJ_WAL_WRITE_PARTIAL", -1) > +space:insert{1} > +-- Check vclock was promoted only one time > +box.info.vclock[box.info.id] == lsn1 + 1 > +errinj.set("ERRINJ_WAL_WRITE_PARTIAL", 0) > +space:update(1, {{'=', 2, 2}}) > +space:get{1} > +errinj.set("ERRINJ_WAL_WRITE_PARTIAL", -1) > +space:update(1, {{'=', 2, 2}}) > +-- Check vclock was promoted only two times > +box.info.vclock[box.info.id] == lsn1 + 2 > space:truncate()