From 9b928468942fe55f8930f2ebbbfca645c422679e Mon Sep 17 00:00:00 2001 From: Vladislav Shpilevoy Date: Wed, 15 Aug 2018 00:00:12 +0300 Subject: [PATCH] Update test-run --- test/misc/check_uuid_on_connect.result | 12 ++++++++++++ test/misc/check_uuid_on_connect.test.lua | 3 +++ test/rebalancer/rebalancer_utils.lua | 5 ++++- test/rebalancer/receiving_bucket.result | 4 ++-- test/rebalancer/receiving_bucket.test.lua | 4 ++-- test/test-run | 2 +- vshard/storage/init.lua | 10 ++++++---- 7 files changed, 30 insertions(+), 10 deletions(-) diff --git a/test/misc/check_uuid_on_connect.result b/test/misc/check_uuid_on_connect.result index 6ac23530..da8b747d 100644 --- a/test/misc/check_uuid_on_connect.result +++ b/test/misc/check_uuid_on_connect.result @@ -109,6 +109,10 @@ test_run:cmd('start server bad_uuid_2_a_repaired') --- - true ... +test_run:cmd('create server bad_uuid_2_b with script="misc/bad_uuid_2_b.lua", wait=False, wait_load=False') +--- +- true +... test_run:cmd('start server bad_uuid_2_b') --- - true @@ -140,10 +144,18 @@ test_run:drop_cluster(REPLICASET_2) REPLICASET_2 = { 'bad_uuid_2_a', 'bad_uuid_2_b' } --- ... +test_run:cmd('create server bad_uuid_2_a with script="misc/bad_uuid_2_a.lua", wait=False, wait_load=False') +--- +- true +... test_run:cmd('start server bad_uuid_2_a with wait=False, wait_load=False') --- - true ... +test_run:cmd('create server bad_uuid_2_b with script="misc/bad_uuid_2_b.lua", wait=False, wait_load=False') +--- +- true +... test_run:cmd('start server bad_uuid_2_b with wait=False, wait_load=False') --- - true diff --git a/test/misc/check_uuid_on_connect.test.lua b/test/misc/check_uuid_on_connect.test.lua index f7af6910..288a2f59 100644 --- a/test/misc/check_uuid_on_connect.test.lua +++ b/test/misc/check_uuid_on_connect.test.lua @@ -42,6 +42,7 @@ test_run:drop_cluster(REPLICASET_2) REPLICASET_2 = { 'bad_uuid_2_a_repaired', 'bad_uuid_2_b' } test_run:cmd('create server bad_uuid_2_a_repaired with script="misc/bad_uuid_2_a_repaired.lua", wait=False, wait_load=False') test_run:cmd('start server bad_uuid_2_a_repaired') +test_run:cmd('create server bad_uuid_2_b with script="misc/bad_uuid_2_b.lua", wait=False, wait_load=False') test_run:cmd('start server bad_uuid_2_b') util.wait_master(test_run, REPLICASET_2, 'bad_uuid_2_a_repaired') @@ -55,7 +56,9 @@ require('log').info(string.rep('a', 1000)) test_run:cmd("switch default") test_run:drop_cluster(REPLICASET_2) REPLICASET_2 = { 'bad_uuid_2_a', 'bad_uuid_2_b' } +test_run:cmd('create server bad_uuid_2_a with script="misc/bad_uuid_2_a.lua", wait=False, wait_load=False') test_run:cmd('start server bad_uuid_2_a with wait=False, wait_load=False') +test_run:cmd('create server bad_uuid_2_b with script="misc/bad_uuid_2_b.lua", wait=False, wait_load=False') test_run:cmd('start server bad_uuid_2_b with wait=False, wait_load=False') util.wait_master(test_run, REPLICASET_2, 'bad_uuid_2_a') diff --git a/test/rebalancer/rebalancer_utils.lua b/test/rebalancer/rebalancer_utils.lua index 6678c295..e02d4c84 100644 --- a/test/rebalancer/rebalancer_utils.lua +++ b/test/rebalancer/rebalancer_utils.lua @@ -32,7 +32,10 @@ local function do_read_load() vshard.router.call(bucket, 'read', 'do_select', {{read_iterations}}, {timeout = 100}) - assert(tuples) + if not tuples then + log.info('Error during read loading: %s', err) + tuples = {} + end end assert(tuples[1][1] == read_iterations) assert(tuples[1][2] == bucket) diff --git a/test/rebalancer/receiving_bucket.result b/test/rebalancer/receiving_bucket.result index df81c00e..2f7dd0ad 100644 --- a/test/rebalancer/receiving_bucket.result +++ b/test/rebalancer/receiving_bucket.result @@ -93,7 +93,7 @@ box.space.test3:count() --- - 10000 ... -vshard.storage.bucket_send(1, util.replicasets[2]) +vshard.storage.bucket_send(1, util.replicasets[2], {timeout = 10}) --- - true ... @@ -138,7 +138,7 @@ vshard.storage.internal.errinj.ERRINJ_RECEIVE_PARTIALLY = true _ = test_run:switch('box_2_a') --- ... -vshard.storage.bucket_send(1, util.replicasets[1]) +vshard.storage.bucket_send(1, util.replicasets[1], {timeout = 10}) --- - null - type: ClientError diff --git a/test/rebalancer/receiving_bucket.test.lua b/test/rebalancer/receiving_bucket.test.lua index f58d4061..58d41962 100644 --- a/test/rebalancer/receiving_bucket.test.lua +++ b/test/rebalancer/receiving_bucket.test.lua @@ -39,7 +39,7 @@ box.space.test:count() box.space.test2:count() box.space.test3:count() -vshard.storage.bucket_send(1, util.replicasets[2]) +vshard.storage.bucket_send(1, util.replicasets[2], {timeout = 10}) box.space._bucket:get{1} _ = test_run:switch('box_2_a') @@ -56,7 +56,7 @@ _ = test_run:switch('box_1_a') while box.space._bucket:get{1} do fiber.sleep(0.01) end vshard.storage.internal.errinj.ERRINJ_RECEIVE_PARTIALLY = true _ = test_run:switch('box_2_a') -vshard.storage.bucket_send(1, util.replicasets[1]) +vshard.storage.bucket_send(1, util.replicasets[1], {timeout = 10}) box.space._bucket:get{1} _ = test_run:switch('box_1_a') box.space._bucket:get{1} diff --git a/test/test-run b/test/test-run index c37e685d..a1a77f43 160000 --- a/test/test-run +++ b/test/test-run @@ -1 +1 @@ -Subproject commit c37e685d9c6af8f9c6027060c258781dd2bd64ee +Subproject commit a1a77f43e77d78cc8987e8d7f9405a55e9375f8c diff --git a/vshard/storage/init.lua b/vshard/storage/init.lua index da8eb814..83630d44 100644 --- a/vshard/storage/init.lua +++ b/vshard/storage/init.lua @@ -792,7 +792,7 @@ end -- -- Send a bucket to other replicaset. -- -local function bucket_send_xc(bucket_id, destination) +local function bucket_send_xc(bucket_id, destination, opts) local status, err = bucket_check_state(bucket_id, 'write') if err then return nil, err @@ -809,7 +809,8 @@ local function bucket_send_xc(bucket_id, destination) local data = bucket_collect_internal(bucket_id) box.space._bucket:replace({bucket_id, consts.BUCKET.SENDING, destination}) status, err = replicaset:callrw('vshard.storage.bucket_recv', - {bucket_id, box.info.cluster.uuid, data}) + {bucket_id, box.info.cluster.uuid, data}, + opts) if not status then err = lerror.make(err) if err.type == 'ShardingError' then @@ -825,13 +826,14 @@ end -- -- Exception and recovery safe version of bucket_send_xc. -- -local function bucket_send(bucket_id, destination) +local function bucket_send(bucket_id, destination, opts) if type(bucket_id) ~= 'number' or type(destination) ~= 'string' then error('Usage: bucket_send(bucket_id, destination)') end M.buckets_to_recovery[bucket_id] = true M.rebalancer_transfering_buckets[bucket_id] = true - local status, ret, err = pcall(bucket_send_xc, bucket_id, destination) + local status, ret, err = pcall(bucket_send_xc, bucket_id, destination, + opts) M.rebalancer_transfering_buckets[bucket_id] = nil if status then if ret then