From: Nikita Pettik <korablev@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/2] vinyl: init all vars before cleanup in vy_lsm_split_range()
Date: Fri, 10 Apr 2020 18:24:10 +0000 [thread overview]
Message-ID: <20200410182410.GA10478@tarantool.org> (raw)
In-Reply-To: <20200410154050.GD9428@tarantool.org>
On 10 Apr 15:40, Nikita Pettik wrote:
> On 10 Apr 17:13, Vladislav Shpilevoy wrote:
> > > + | ---
> > > + | ...
> > > +dump()
> > > + | ---
> > > + | ...
> > > +-- 1 range, 2 runs
> >
> > 2. Can you add an assertion, that it is really 1 range and 2 runs?
> > To be sure that the test won't become useless in future if suddenly
> > something will change there.
>
> Ok, will add.
>
> > > +
> > > +compact()
> > > + | ---
> > > + | ...
> > > +-- 1 range, 1 run after compaction
> > > +
> > > +dump()
> > > + | ---
> > > + | ...
> > > +-- 1 range, 2 runs
> > > +
> > > +errinj = box.error.injection
> > > + | ---
> > > + | ...
> > > +errinj.set('ERRINJ_VY_MAX_TUPLE_SIZE', 0)
> > > + | ---
> > > + | - ok
> > > + | ...
> > > +-- Should finish successfully despite vy_stmt_alloc() fail.
> > > +--
> > > +compact()
> > > + | ---
> > > + | ...
> > > +-- 1 range, 1 run
> > > +s.index.pk:stat().range_count
> > > + | ---
> > > + | - 1
> > > + | ...
> > > +s.index.pk:stat().run_count
> >
> > 3. I would add an assertion/print, that ERRINJ_VY_MAX_TUPLE_SIZE
> > (or whatever will be used after the review) is changed back to
> > off, and then change it to off again anyway. Because if the test
> > won't hit the errinj because of something in future, the errinj
> > will be left set, and we won't notice that here. Also it will
> > make all next vinyl tests running in the same job fail in very
> > surprising ways.
> >
> > The same for the next commit.
>
> Ok, will fix.
>
Diff:
diff --git a/test/vinyl/gh-4864-stmt-alloc-fail-compact.test.lua b/test/vinyl/gh-4864-stmt-alloc-fail-compact.test.lua
index 53a050c9b..693a4ff22 100644
--- a/test/vinyl/gh-4864-stmt-alloc-fail-compact.test.lua
+++ b/test/vinyl/gh-4864-stmt-alloc-fail-compact.test.lua
@@ -29,13 +29,17 @@ test_run:cmd("setopt delimiter ''");
--
dump(true)
dump()
+assert(s.index.pk:stat().range_count == 1)
+assert(s.index.pk:stat().run_count == 2)
-- 1 range, 2 runs
compact()
--- 1 range, 1 run after compaction
+assert(s.index.pk:stat().range_count == 1)
+assert(s.index.pk:stat().run_count == 1)
dump()
--- 1 range, 2 runs
+assert(s.index.pk:stat().range_count == 1)
+assert(s.index.pk:stat().run_count == 2)
errinj = box.error.injection
errinj.set('ERRINJ_VY_MAX_TUPLE_SIZE', 0)
@@ -43,7 +47,9 @@ errinj.set('ERRINJ_VY_MAX_TUPLE_SIZE', 0)
--
compact()
-- 1 range, 1 run
-s.index.pk:stat().range_count
-s.index.pk:stat().run_count
+assert(s.index.pk:stat().range_count == 1)
+assert(s.index.pk:stat().run_count == 1)
+assert(errinj.get('ERRINJ_VY_MAX_TUPLE_SIZE') == -1)
+errinj.set('ERRINJ_VY_MAX_TUPLE_SIZE', -1)
s:drop()
next prev parent reply other threads:[~2020-04-10 18:24 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-08 21:37 [Tarantool-patches] [PATCH 0/2] vinyl: fix uninitialized memory accesses Nikita Pettik
2020-04-08 21:37 ` [Tarantool-patches] [PATCH 1/2] vinyl: init all vars before cleanup in vy_lsm_split_range() Nikita Pettik
2020-04-09 8:18 ` Konstantin Osipov
2020-04-09 10:55 ` Nikita Pettik
2020-04-09 11:07 ` Konstantin Osipov
2020-04-09 11:26 ` Nikita Pettik
2020-04-10 15:13 ` Vladislav Shpilevoy
2020-04-10 15:40 ` Nikita Pettik
2020-04-10 18:24 ` Nikita Pettik [this message]
2020-04-11 17:39 ` Vladislav Shpilevoy
2020-04-13 22:29 ` Nikita Pettik
2020-04-14 21:40 ` Nikita Pettik
2020-04-08 21:37 ` [Tarantool-patches] [PATCH 2/2] vinyl: clean-up read views if *_build_history() fails Nikita Pettik
2020-04-09 8:19 ` Konstantin Osipov
2020-04-09 11:09 ` Nikita Pettik
2020-04-10 15:13 ` Vladislav Shpilevoy
2020-04-10 15:47 ` Nikita Pettik
2020-04-10 21:45 ` Nikita Pettik
2020-04-10 22:32 ` Vladislav Shpilevoy
2020-04-11 17:30 ` Konstantin Osipov
2020-04-13 22:31 ` Nikita Pettik
2020-04-13 22:35 ` Konstantin Osipov
2020-04-13 22:11 ` Nikita Pettik
2020-04-11 17:39 ` Vladislav Shpilevoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200410182410.GA10478@tarantool.org \
--to=korablev@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 1/2] vinyl: init all vars before cleanup in vy_lsm_split_range()' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox