Skip to content

Commit 9b92846

Browse files
committed
Update test-run
1 parent 9f82b42 commit 9b92846

File tree

7 files changed

+30
-10
lines changed

7 files changed

+30
-10
lines changed

test/misc/check_uuid_on_connect.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ test_run:cmd('start server bad_uuid_2_a_repaired')
109109
---
110110
- true
111111
...
112+
test_run:cmd('create server bad_uuid_2_b with script="misc/bad_uuid_2_b.lua", wait=False, wait_load=False')
113+
---
114+
- true
115+
...
112116
test_run:cmd('start server bad_uuid_2_b')
113117
---
114118
- true
@@ -140,10 +144,18 @@ test_run:drop_cluster(REPLICASET_2)
140144
REPLICASET_2 = { 'bad_uuid_2_a', 'bad_uuid_2_b' }
141145
---
142146
...
147+
test_run:cmd('create server bad_uuid_2_a with script="misc/bad_uuid_2_a.lua", wait=False, wait_load=False')
148+
---
149+
- true
150+
...
143151
test_run:cmd('start server bad_uuid_2_a with wait=False, wait_load=False')
144152
---
145153
- true
146154
...
155+
test_run:cmd('create server bad_uuid_2_b with script="misc/bad_uuid_2_b.lua", wait=False, wait_load=False')
156+
---
157+
- true
158+
...
147159
test_run:cmd('start server bad_uuid_2_b with wait=False, wait_load=False')
148160
---
149161
- true

test/misc/check_uuid_on_connect.test.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ test_run:drop_cluster(REPLICASET_2)
4242
REPLICASET_2 = { 'bad_uuid_2_a_repaired', 'bad_uuid_2_b' }
4343
test_run:cmd('create server bad_uuid_2_a_repaired with script="misc/bad_uuid_2_a_repaired.lua", wait=False, wait_load=False')
4444
test_run:cmd('start server bad_uuid_2_a_repaired')
45+
test_run:cmd('create server bad_uuid_2_b with script="misc/bad_uuid_2_b.lua", wait=False, wait_load=False')
4546
test_run:cmd('start server bad_uuid_2_b')
4647
util.wait_master(test_run, REPLICASET_2, 'bad_uuid_2_a_repaired')
4748

@@ -55,7 +56,9 @@ require('log').info(string.rep('a', 1000))
5556
test_run:cmd("switch default")
5657
test_run:drop_cluster(REPLICASET_2)
5758
REPLICASET_2 = { 'bad_uuid_2_a', 'bad_uuid_2_b' }
59+
test_run:cmd('create server bad_uuid_2_a with script="misc/bad_uuid_2_a.lua", wait=False, wait_load=False')
5860
test_run:cmd('start server bad_uuid_2_a with wait=False, wait_load=False')
61+
test_run:cmd('create server bad_uuid_2_b with script="misc/bad_uuid_2_b.lua", wait=False, wait_load=False')
5962
test_run:cmd('start server bad_uuid_2_b with wait=False, wait_load=False')
6063
util.wait_master(test_run, REPLICASET_2, 'bad_uuid_2_a')
6164

test/rebalancer/rebalancer_utils.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ local function do_read_load()
3232
vshard.router.call(bucket, 'read', 'do_select',
3333
{{read_iterations}},
3434
{timeout = 100})
35-
assert(tuples)
35+
if not tuples then
36+
log.info('Error during read loading: %s', err)
37+
tuples = {}
38+
end
3639
end
3740
assert(tuples[1][1] == read_iterations)
3841
assert(tuples[1][2] == bucket)

test/rebalancer/receiving_bucket.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ box.space.test3:count()
9393
---
9494
- 10000
9595
...
96-
vshard.storage.bucket_send(1, util.replicasets[2])
96+
vshard.storage.bucket_send(1, util.replicasets[2], {timeout = 10})
9797
---
9898
- true
9999
...
@@ -138,7 +138,7 @@ vshard.storage.internal.errinj.ERRINJ_RECEIVE_PARTIALLY = true
138138
_ = test_run:switch('box_2_a')
139139
---
140140
...
141-
vshard.storage.bucket_send(1, util.replicasets[1])
141+
vshard.storage.bucket_send(1, util.replicasets[1], {timeout = 10})
142142
---
143143
- null
144144
- type: ClientError

test/rebalancer/receiving_bucket.test.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ box.space.test:count()
3939
box.space.test2:count()
4040
box.space.test3:count()
4141

42-
vshard.storage.bucket_send(1, util.replicasets[2])
42+
vshard.storage.bucket_send(1, util.replicasets[2], {timeout = 10})
4343
box.space._bucket:get{1}
4444

4545
_ = test_run:switch('box_2_a')
@@ -56,7 +56,7 @@ _ = test_run:switch('box_1_a')
5656
while box.space._bucket:get{1} do fiber.sleep(0.01) end
5757
vshard.storage.internal.errinj.ERRINJ_RECEIVE_PARTIALLY = true
5858
_ = test_run:switch('box_2_a')
59-
vshard.storage.bucket_send(1, util.replicasets[1])
59+
vshard.storage.bucket_send(1, util.replicasets[1], {timeout = 10})
6060
box.space._bucket:get{1}
6161
_ = test_run:switch('box_1_a')
6262
box.space._bucket:get{1}

vshard/storage/init.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ end
792792
--
793793
-- Send a bucket to other replicaset.
794794
--
795-
local function bucket_send_xc(bucket_id, destination)
795+
local function bucket_send_xc(bucket_id, destination, opts)
796796
local status, err = bucket_check_state(bucket_id, 'write')
797797
if err then
798798
return nil, err
@@ -809,7 +809,8 @@ local function bucket_send_xc(bucket_id, destination)
809809
local data = bucket_collect_internal(bucket_id)
810810
box.space._bucket:replace({bucket_id, consts.BUCKET.SENDING, destination})
811811
status, err = replicaset:callrw('vshard.storage.bucket_recv',
812-
{bucket_id, box.info.cluster.uuid, data})
812+
{bucket_id, box.info.cluster.uuid, data},
813+
opts)
813814
if not status then
814815
err = lerror.make(err)
815816
if err.type == 'ShardingError' then
@@ -825,13 +826,14 @@ end
825826
--
826827
-- Exception and recovery safe version of bucket_send_xc.
827828
--
828-
local function bucket_send(bucket_id, destination)
829+
local function bucket_send(bucket_id, destination, opts)
829830
if type(bucket_id) ~= 'number' or type(destination) ~= 'string' then
830831
error('Usage: bucket_send(bucket_id, destination)')
831832
end
832833
M.buckets_to_recovery[bucket_id] = true
833834
M.rebalancer_transfering_buckets[bucket_id] = true
834-
local status, ret, err = pcall(bucket_send_xc, bucket_id, destination)
835+
local status, ret, err = pcall(bucket_send_xc, bucket_id, destination,
836+
opts)
835837
M.rebalancer_transfering_buckets[bucket_id] = nil
836838
if status then
837839
if ret then

0 commit comments

Comments
 (0)