@@ -236,47 +236,49 @@ test_group.test_ref_with_buckets_basic = function(g)
236
236
237
237
-- No buckets.
238
238
res , err = ivshard .storage ._call (
239
- ' storage_ref_with_buckets ' , rid , iwait_timeout , {})
239
+ ' storage_ref_make_with_buckets ' , rid , iwait_timeout , {})
240
240
ilt .assert_equals (err , nil )
241
241
ilt .assert_equals (res , {moved = {}})
242
242
ilt .assert_equals (lref .count , 0 )
243
243
244
244
-- Check for a single ok bucket.
245
245
res , err = ivshard .storage ._call (
246
- ' storage_ref_with_buckets ' , rid , iwait_timeout , {bids [1 ]})
246
+ ' storage_ref_make_with_buckets ' , rid , iwait_timeout , {bids [1 ]})
247
247
ilt .assert_equals (err , nil )
248
- ilt .assert_equals (res , {rid = rid , moved = {}})
248
+ ilt .assert_equals (res , {is_done = true , moved = {}})
249
249
ilt .assert_equals (lref .count , 1 )
250
250
_ , err = ivshard .storage ._call (' storage_unref' , rid )
251
251
ilt .assert_equals (err , nil )
252
252
ilt .assert_equals (lref .count , 0 )
253
253
254
254
-- Check for multiple ok buckets.
255
255
res , err = ivshard .storage ._call (
256
- ' storage_ref_with_buckets' , rid , iwait_timeout , {bids [1 ], bids [2 ]})
256
+ ' storage_ref_make_with_buckets' , rid , iwait_timeout ,
257
+ {bids [1 ], bids [2 ]})
257
258
ilt .assert_equals (err , nil )
258
- ilt .assert_equals (res , {rid = rid , moved = {}})
259
+ ilt .assert_equals (res , {is_done = true , moved = {}})
259
260
_ , err = ivshard .storage ._call (' storage_unref' , rid )
260
261
ilt .assert_equals (err , nil )
261
262
262
263
-- Check for double referencing.
263
264
res , err = ivshard .storage ._call (
264
- ' storage_ref_with_buckets' , rid , iwait_timeout , {bids [1 ], bids [1 ]})
265
+ ' storage_ref_make_with_buckets' , rid , iwait_timeout ,
266
+ {bids [1 ], bids [1 ]})
265
267
ilt .assert_equals (err , nil )
266
- ilt .assert_equals (res , {rid = rid , moved = {}})
268
+ ilt .assert_equals (res , {is_done = true , moved = {}})
267
269
ilt .assert_equals (lref .count , 1 )
268
270
_ , err = ivshard .storage ._call (' storage_unref' , rid )
269
271
ilt .assert_equals (err , nil )
270
272
ilt .assert_equals (lref .count , 0 )
271
273
272
274
-- Bucket mix.
273
275
res , err = ivshard .storage ._call (
274
- ' storage_ref_with_buckets ' , rid , iwait_timeout ,
276
+ ' storage_ref_make_with_buckets ' , rid , iwait_timeout ,
275
277
{bucket_count + 1 , bids [1 ], bucket_count + 2 , bids [2 ],
276
278
bucket_count + 3 })
277
279
ilt .assert_equals (err , nil )
278
280
ilt .assert_equals (res , {
279
- rid = rid ,
281
+ is_done = true ,
280
282
moved = {
281
283
{id = bucket_count + 1 },
282
284
{id = bucket_count + 2 },
@@ -288,7 +290,7 @@ test_group.test_ref_with_buckets_basic = function(g)
288
290
289
291
-- No ref when all buckets are missing.
290
292
res , err = ivshard .storage ._call (
291
- ' storage_ref_with_buckets ' ,
293
+ ' storage_ref_make_with_buckets ' ,
292
294
rid ,
293
295
iwait_timeout ,
294
296
{bucket_count + 1 , bucket_count + 2 }
@@ -315,7 +317,7 @@ test_group.test_ref_with_buckets_timeout = function(g)
315
317
box .space ._bucket :update (
316
318
{bids [1 ]}, {{' =' , 2 , ivconst .BUCKET .SENDING }})
317
319
local res , err = ivshard .storage ._call (
318
- ' storage_ref_with_buckets ' , rid , 0.01 , {bids [2 ]})
320
+ ' storage_ref_make_with_buckets ' , rid , 0.01 , {bids [2 ]})
319
321
box .space ._bucket :update (
320
322
{bids [1 ]}, {{' =' , 2 , ivconst .BUCKET .ACTIVE }})
321
323
t .assert_str_contains (err .message , ' Timeout exceeded' )
@@ -341,7 +343,7 @@ test_group.test_ref_with_buckets_return_last_known_dst = function(g)
341
343
box .space ._bucket :update (
342
344
{bid }, {{' =' , 2 , ivconst .BUCKET .SENT }})
343
345
local res , err = ivshard .storage ._call (
344
- ' storage_ref_with_buckets ' , rid , iwait_timeout , {bid })
346
+ ' storage_ref_make_with_buckets ' , rid , iwait_timeout , {bid })
345
347
ilt .assert_equals (err , nil )
346
348
ilt .assert_equals (res , {moved = {{
347
349
id = bid ,
@@ -378,7 +380,7 @@ test_group.test_ref_with_buckets_move_part_while_referencing = function(g)
378
380
local session_id
379
381
local f = ifiber .new (function ()
380
382
session_id = box .session .id ()
381
- return ivshard .storage ._call (' storage_ref_with_buckets ' , rid ,
383
+ return ivshard .storage ._call (' storage_ref_make_with_buckets ' , rid ,
382
384
iwait_timeout , {bids [1 ], bids [2 ]})
383
385
end )
384
386
f :set_joinable (true )
@@ -395,7 +397,7 @@ test_group.test_ref_with_buckets_move_part_while_referencing = function(g)
395
397
t .assert_equals (err , nil )
396
398
ilt .assert_equals (res , {
397
399
moved = {{id = bids [2 ], dst = id }},
398
- rid = rid ,
400
+ is_done = true ,
399
401
})
400
402
-- Ref was done, because at least one bucket was ok.
401
403
ilt .assert_equals (lref .count , 1 )
@@ -428,7 +430,7 @@ test_group.test_ref_with_buckets_move_all_while_referencing = function(g)
428
430
{bids [3 ]}, {{' =' , 2 , ivconst .BUCKET .SENDING }, {' =' , 3 , id }})
429
431
-- Start referencing.
430
432
local f = ifiber .new (function ()
431
- return ivshard .storage ._call (' storage_ref_with_buckets ' , rid ,
433
+ return ivshard .storage ._call (' storage_ref_make_with_buckets ' , rid ,
432
434
iwait_timeout , {bids [1 ], bids [2 ]})
433
435
end )
434
436
f :set_joinable (true )
@@ -536,10 +538,8 @@ test_group.test_moved_buckets_various_statuses = function(g)
536
538
{{' =' , 2 , ivconst .BUCKET .GARBAGE }})
537
539
_bucket :delete ({bid_404 })
538
540
539
- local res , err = ivshard .storage ._call (' moved_buckets' , bids )
540
- ilt .assert_equals (err , nil )
541
- ilt .assert (res and res .moved )
542
- ilt .assert_items_equals (res .moved , {
541
+ local moved = ivshard .storage .internal .bucket_get_moved (bids )
542
+ ilt .assert_items_equals (moved , {
543
543
{
544
544
id = bid_sent ,
545
545
dst = id_sent ,
0 commit comments