Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [RFC v29 3/3] test: add gh-6036-qsync-order test
Date: Wed, 9 Feb 2022 12:11:02 +0300	[thread overview]
Message-ID: <07721603-350b-ff70-f96e-ae3ca593a843@tarantool.org> (raw)
In-Reply-To: <20220131215554.1367429-4-gorcunov@gmail.com>


01.02.2022 00:55, Cyrill Gorcunov пишет:
> To test that promotion requests are handled only when appropriate
> write to WAL completes, because we update memory data before the
> write finishes.
>
> Part-of #6036
>
> Signed-off-by: Cyrill Gorcunov<gorcunov@gmail.com>
> ---
>   .../gh_6036_qsync_order_test.lua              | 137 ++++++++++++++++++
>   test/replication-luatest/suite.ini            |   1 +
>   2 files changed, 138 insertions(+)
>   create mode 100644 test/replication-luatest/gh_6036_qsync_order_test.lua
>
> diff --git a/test/replication-luatest/gh_6036_qsync_order_test.lua b/test/replication-luatest/gh_6036_qsync_order_test.lua
> new file mode 100644
> index 000000000..4c0059764
> --- /dev/null
> +++ b/test/replication-luatest/gh_6036_qsync_order_test.lua
> @@ -0,0 +1,137 @@
> +local t = require('luatest')
> +local cluster = require('test.luatest_helpers.cluster')
> +local asserts = require('test.luatest_helpers.asserts')
> +local helpers = require('test.luatest_helpers')
> +local log = require('log')
> +
> +local g = t.group('gh-6036', {{engine = 'memtx'}, {engine = 'vinyl'}})


You don't need to test engines here.

You always create a memtx space anyway.

> +
> +g.before_each(function(cg)
> +    pcall(log.cfg, {level = 6})


You don't use log on the default instance. Why do you need that?

Does it help luatest output somehow?


> +
> +    local engine = cg.params.engine
> +
> +    cg.cluster = cluster:new({})
> +


Otherwise the test looks fine. Congratulations on writing your first 
luatest-test!


Now on the promote/demote test. It should be fairly easy to implement.

You only need 2 servers with election mode off and synchro quorum = 1, 
and a sync space.

1. promote server1

2. wait until the promotion is replicated

3. initiate wal delay on server2

4. issue box.ctl.promote() on server2 (it will block on box_issue_promote())

5. while server2 is blocked on writing a promote, do insert{1} on server1

6. wait for replication to server2 (wal is blocked, so rely on 
ERRINJ_WAL_WRITE_COUNT)

7. unblock wal on server2

8. make sure insert{1} wasn't applied on server2.


Speaking of the demote test. Demotion only works on the queue owner, so 
no one should be able

to write obsolete data during the DEMOTE wal write. I  can't think of a 
test here and I think we may

leave it untested.


      reply	other threads:[~2022-02-09  9:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 21:55 [Tarantool-patches] [RFC v29 0/3] qsync: implement packet filtering (part 1) Cyrill Gorcunov via Tarantool-patches
2022-01-31 21:55 ` [Tarantool-patches] [RFC v29 1/3] latch: add latch_is_locked helper Cyrill Gorcunov via Tarantool-patches
2022-01-31 21:55 ` [Tarantool-patches] [RFC v29 2/3] qsync: order access to the limbo terms Cyrill Gorcunov via Tarantool-patches
2022-02-09  9:10   ` Serge Petrenko via Tarantool-patches
2022-01-31 21:55 ` [Tarantool-patches] [RFC v29 3/3] test: add gh-6036-qsync-order test Cyrill Gorcunov via Tarantool-patches
2022-02-09  9:11   ` Serge Petrenko via Tarantool-patches [this message]

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=07721603-350b-ff70-f96e-ae3ca593a843@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [RFC v29 3/3] test: add gh-6036-qsync-order test' \
    /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