[Tarantool-patches] [PATCH 5/5] [tosquash] replication: add test on local row in the end of sync txn

Serge Petrenko sergepetrenko at tarantool.org
Sun Jul 5 12:11:26 MSK 2020


03.07.2020 02:40, Vladislav Shpilevoy пишет:
> Currently disabled, because soon should start working without
> any changes when #4928 is fixed.
> ---
>   test/replication/qsync_basic.result   | 20 ++++++++++++++++++++
>   test/replication/qsync_basic.test.lua | 20 ++++++++++++++++++++
>   2 files changed, 40 insertions(+)
>
> diff --git a/test/replication/qsync_basic.result b/test/replication/qsync_basic.result
> index 339fc0e33..83ff7d3d1 100644
> --- a/test/replication/qsync_basic.result
> +++ b/test/replication/qsync_basic.result
> @@ -419,6 +419,26 @@ box.space.test:select{9}
>    | - []
>    | ...
>   
> +--
> +-- gh-4928: test that a sync transaction works fine with local
> +-- rows in the end.
> +--
> +
> +-- test_run:switch('default')
> +-- box.cfg{replication_synchro_timeout = 1000, replication_synchro_quorum = 2}
> +-- do                                                                              \
> +--     box.begin()                                                                 \
> +--     box.space.sync:replace{10}                                                  \
> +--     box.space.locallocal:replace({10})                                          \
> +--     box.commit()                                                                \
> +-- end
> +-- box.space.sync:select{10}
> +-- box.space.locallocal:select{10}
> +
> +-- test_run:switch('replica')
> +-- box.space.sync:select{10}
> +-- box.space.locallocal:select{10}
> +
>   --
>   -- gh-5123: quorum 1 still should write CONFIRM.
>   --
> diff --git a/test/replication/qsync_basic.test.lua b/test/replication/qsync_basic.test.lua
> index 6e40131bf..74083a0b9 100644
> --- a/test/replication/qsync_basic.test.lua
> +++ b/test/replication/qsync_basic.test.lua
> @@ -163,6 +163,26 @@ box.space.sync:select{9}
>   box.space.locallocal:select{9}
>   box.space.test:select{9}
>   
> +--
> +-- gh-4928: test that a sync transaction works fine with local
> +-- rows in the end.
> +--
> +
> +-- test_run:switch('default')
> +-- box.cfg{replication_synchro_timeout = 1000, replication_synchro_quorum = 2}
> +-- do                                                                              \
> +--     box.begin()                                                                 \
> +--     box.space.sync:replace{10}                                                  \
> +--     box.space.locallocal:replace({10})                                          \
> +--     box.commit()                                                                \
> +-- end
> +-- box.space.sync:select{10}
> +-- box.space.locallocal:select{10}
> +
> +-- test_run:switch('replica')
> +-- box.space.sync:select{10}
> +-- box.space.locallocal:select{10}
> +
>   --
>   -- gh-5123: quorum 1 still should write CONFIRM.
>   --
Hi! Thanks for the test!
LGTM with one comment.

Looks like it relies on the vclock[0] increase you performed in
the previous test (patch 4/5).
If it wasn't for this increase,both correctly and incorrectly
working tarantools would complete the transaction. (The incorrect
one would take lsn = 1 from vclock[0])

Maybe add the same increase here, to make sure the test stays
valid if someone changes the previous test case?

I mean the `for i = 1,2000 do box.space.localocal:replace{1} end`

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list