commit 70066e3f546eb5060280579b6680e1bf4afbcd15 from: Sergey Bronnikov date: Mon Aug 16 15:17:59 2021 UTC tmp commit commit - ce00726119426e2dad881bce9f2f4a8b82939cae commit + 70066e3f546eb5060280579b6680e1bf4afbcd15 blob - 510b3b4db5c7af181584777530f3852db89fda27 blob + 639e1d28b4aa729ea0179ba03ed052fd738364f3 --- test/replication/qsync_basic.result +++ test/replication/qsync_basic.result @@ -641,23 +641,13 @@ box.space.sync:count() | ... -- -<<<<<<< HEAD -- gh-5445: NOPs bypass the limbo for the sake of vclock bumps from foreign -- instances, but also works for local rows. -======= --- gh-4849: clear synchro queue on a master -- --- NOTE: current behavior of the queue clearance is incorrect, --- because it should never rollback local rows, see --- https://github.com/tarantool/tarantool/issues/5435. Test may --- stop working eventually. ->>>>>>> qsync: test clear_synchro_queue() function --- test_run:switch('default') | --- | - true | ... -<<<<<<< HEAD box.ctl.demote() | --- | ... @@ -712,7 +702,19 @@ box.space.sync:truncate() -- cleanup procedure, also we're spinning on default node -- and do not switch to other nodes. -- -======= + +-- gh-4849: clear synchro queue on a master +-- +-- NOTE: current behavior of the queue clearance is incorrect, +-- because it should never rollback local rows, see +-- https://github.com/tarantool/tarantool/issues/5435. Test may +-- stop working eventually. +-- + +test_run:switch('default') + | --- + | - true + | ... box.cfg{replication_synchro_quorum = 3, replication_synchro_timeout = 1000} | --- | ... @@ -743,7 +745,7 @@ test_run:switch('default') box.cfg{replication_synchro_timeout = 0.1} | --- | ... -box.ctl.clear_synchro_queue() +box.ctl.promote() | --- | ... test_run:switch('replica') @@ -805,12 +807,13 @@ test_run:switch('replica') box.cfg{replication_synchro_quorum = 3, replication_synchro_timeout=0.01} | --- | ... -box.ctl.clear_synchro_queue() +box.ctl.promote() | --- + | - error: 'Couldn''t wait for quorum 3: timeout after 0.01 seconds, collected 1 acks' | ... test_run:wait_cond(function() return box.space.sync:get{9} == nil end) | --- - | - true + | - false | ... test_run:switch('default') | --- @@ -836,7 +839,6 @@ test_run:wait_cond(function() return box.space.sync:ge -- Note: cluster may be in a broken state here due to nature of previous test. -- Cleanup. ->>>>>>> qsync: test clear_synchro_queue() function test_run:cmd('switch default') | --- | - true blob - d75943141778875c0a3dda4dbb1b8ac999471ddc blob + b078d7ae653eaeda7f182122918b13ab3772b1fd --- test/replication/qsync_basic.test.lua +++ test/replication/qsync_basic.test.lua @@ -288,7 +288,7 @@ box.space.sync:truncate() -- https://github.com/tarantool/tarantool/issues/5435. Test may -- stop working eventually. -- ---[[ + test_run:switch('default') box.cfg{replication_synchro_quorum = 3, replication_synchro_timeout = 1000} ok, err = nil @@ -300,7 +300,7 @@ test_run:switch('replica') test_run:wait_cond(function() return box.space.sync:get{10} ~= nil end) test_run:switch('default') box.cfg{replication_synchro_timeout = 0.1} -box.ctl.clear_synchro_queue() +box.ctl.promote() test_run:switch('replica') test_run:wait_cond(function() return box.space.sync:get{10} == nil end) test_run:switch('default') @@ -321,7 +321,7 @@ f:status() test_run:wait_cond(function() return box.space.sync:get{9} ~= nil end) test_run:switch('replica') box.cfg{replication_synchro_quorum = 3, replication_synchro_timeout=0.01} -box.ctl.clear_synchro_queue() +box.ctl.promote() test_run:wait_cond(function() return box.space.sync:get{9} == nil end) test_run:switch('default') box.cfg{replication_synchro_timeout=0.01} @@ -330,7 +330,6 @@ ok, err test_run:wait_cond(function() return box.space.sync:get{9} == nil end) -- Note: cluster may be in a broken state here due to nature of previous test. -]] -- Cleanup. test_run:cmd('switch default') blob - 5ddc7af139cabb8db110a6ae19d8d35725eec282 blob + c113a3a30512a1aa5c4380bdec71fcfdefccc45b --- test/replication/qsync_sync_mode.result +++ test/replication/qsync_sync_mode.result @@ -44,18 +44,21 @@ _ = box.space.sync:create_index('pk') | ... -- Testcase body. +--box.ctl.promote() for i = 1,100 do \ box.cfg{replication_synchro_quorum=3, replication_synchro_timeout=1000} \ - fiber.create(function() box.space.sync:insert{i} end) \ + f1 = fiber.create(function() box.space.sync:insert{i} end) \ mode = not box.space.sync.is_sync \ - fiber.create(function() box.space.sync:alter{is_sync=mode} end) \ - box.cfg{replication_synchro_quorum=2, replication_synchro_timeout=0.1} \ + f2 = fiber.create(function() box.space.sync:alter{is_sync=mode} end) \ + box.cfg{replication_synchro_quorum=2, replication_synchro_timeout=0.01} \ + test_run:wait_cond(function() return f1:status() == 'dead' end) \ + test_run:wait_cond(function() return f2:status() == 'dead' end) \ end | --- | ... box.space.sync:count() -- 100 | --- - | - 43 + | - 100 | ... -- Testcase cleanup. blob - 40a476c259bdfb6d9e59c8ce4097a782977ffa26 blob + 7c1a6806aead08ea401aa7e572f44a72a1955104 --- test/replication/qsync_sync_mode.test.lua +++ test/replication/qsync_sync_mode.test.lua @@ -19,12 +19,15 @@ _ = box.schema.space.create('sync', {is_sync=true, eng _ = box.space.sync:create_index('pk') -- Testcase body. +--box.ctl.promote() for i = 1,100 do \ box.cfg{replication_synchro_quorum=3, replication_synchro_timeout=1000} \ - fiber.create(function() box.space.sync:insert{i} end) \ + f1 = fiber.create(function() box.space.sync:insert{i} end) \ mode = not box.space.sync.is_sync \ - fiber.create(function() box.space.sync:alter{is_sync=mode} end) \ - box.cfg{replication_synchro_quorum=2, replication_synchro_timeout=0.1} \ + f2 = fiber.create(function() box.space.sync:alter{is_sync=mode} end) \ + box.cfg{replication_synchro_quorum=2, replication_synchro_timeout=0.01} \ + test_run:wait_cond(function() return f1:status() == 'dead' end) \ + test_run:wait_cond(function() return f2:status() == 'dead' end) \ end box.space.sync:count() -- 100