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>
Cc: tml <tarantool-patches@dev.tarantool.org>,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v9 1/1] applier: filter incoming synchro packets via transaction initiator
Date: Wed, 16 Jun 2021 11:16:04 +0300
Message-ID: <e62d5651-1311-4510-2d25-68feef2cd2c3@tarantool.org> (raw)
In-Reply-To: <YMjdQxFYmdSzqcq7@grain>



15.06.2021 20:02, Cyrill Gorcunov пишет:
> On Tue, Jun 15, 2021 at 05:26:06PM +0300, Serge Petrenko wrote:
>>> +box.space.sync:select{}
>>> + | ---
>>> + | - - [1]
>>> + | ...
>> You need to wait for the space creation, just like
>> you do below. Otherwise the test'll be flaky.
>> Also, please see a comment regarding wait_lsn vs wait_cond
>> below.
> As being discussed due to quorum=2 and sync space we don't need
> to wait.

Yes, indeed. I missed that.

>>> +test_run:wait_cond(function() return                    \
>>> +                   box.space.sync ~= nil and            \
>>> +                   box.space.sync:get{1} ~= nil and     \
>>> +                   box.space.sync:get{1}[1] == 1 end, 100)
>>> + | ---
>>> + | - true
>>> + | ...
>> I suggest you use wait_lsn('replica2', 'master') here
>> instead of this bulky wait_cond.
>> First of all, it takes a single line, instead of 4 lines.
>>
>> Secondly, you forgot to test `box.space.sync.index.pk ~= nil`, meaning
>> the test will still fail occasionally, when index creation doesn't replicate
>> in time.
> You mean something like below?
> ---
> diff --git a/test/replication/gh-6035-applier-filter.result b/test/replication/gh-6035-applier-filter.result
> index 2620e7b6f..7345a19f7 100644
> --- a/test/replication/gh-6035-applier-filter.result
> +++ b/test/replication/gh-6035-applier-filter.result
> @@ -102,12 +102,8 @@ test_run:switch('replica2')
>    | ---
>    | - true
>    | ...
> -test_run:wait_cond(function() return                    \
> -                   box.space.sync ~= nil and            \
> -                   box.space.sync:get{1} ~= nil and     \
> -                   box.space.sync:get{1}[1] == 1 end, 100)
> +test_run:wait_lsn('replica2', 'master')
>    | ---
> - | - true
>    | ...
>   box.space.sync:select{}
>    | ---
> diff --git a/test/replication/gh-6035-applier-filter.test.lua b/test/replication/gh-6035-applier-filter.test.lua
> index 9bfd91288..beca5258e 100644
> --- a/test/replication/gh-6035-applier-filter.test.lua
> +++ b/test/replication/gh-6035-applier-filter.test.lua
> @@ -53,10 +53,7 @@ box.space.sync:select{}
>   -- And the second hop is replica2 where
>   -- replica1 replicated the data to us.
>   test_run:switch('replica2')
> -test_run:wait_cond(function() return                    \
> -                   box.space.sync ~= nil and            \
> -                   box.space.sync:get{1} ~= nil and     \
> -                   box.space.sync:get{1}[1] == 1 end, 100)
> +test_run:wait_lsn('replica2', 'master')
>   box.space.sync:select{}
>   
>   test_run:switch('default')

Exactly.

-- 
Serge Petrenko


  parent reply	other threads:[~2021-06-16  8:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 13:56 [Tarantool-patches] [PATCH v9 0/1] " Cyrill Gorcunov via Tarantool-patches
2021-06-15 13:56 ` [Tarantool-patches] [PATCH v9 1/1] " Cyrill Gorcunov via Tarantool-patches
2021-06-15 14:26   ` Serge Petrenko via Tarantool-patches
2021-06-15 17:02     ` Cyrill Gorcunov via Tarantool-patches
2021-06-15 18:08       ` Cyrill Gorcunov via Tarantool-patches
2021-06-16  8:31         ` Serge Petrenko via Tarantool-patches
2021-06-16  8:43           ` Cyrill Gorcunov via Tarantool-patches
2021-06-16  8:16       ` Serge Petrenko via Tarantool-patches [this message]
2021-06-18 21:49 ` [Tarantool-patches] [PATCH v9 0/1] " Vladislav Shpilevoy via Tarantool-patches
2021-06-18 22:16   ` Cyrill Gorcunov via Tarantool-patches
2021-06-18 22:58     ` Vladislav Shpilevoy via Tarantool-patches
2021-06-19 11:01       ` Cyrill Gorcunov via Tarantool-patches
2021-06-20 14:50         ` Vladislav Shpilevoy via Tarantool-patches
2021-06-20 17:17           ` Cyrill Gorcunov via Tarantool-patches
2021-06-21 21:06 ` Vladislav Shpilevoy via Tarantool-patches

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=e62d5651-1311-4510-2d25-68feef2cd2c3@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    /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

Tarantool development patches archive

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lists.tarantool.org/tarantool-patches/0 tarantool-patches/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 tarantool-patches tarantool-patches/ https://lists.tarantool.org/tarantool-patches \
		tarantool-patches@dev.tarantool.org.
	public-inbox-index tarantool-patches

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git