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