X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/dd9ad570622cc7a164173d4cb6103655482a9b9f..4b1f6ad3e7a5c7c28618e43e7539c9a937bf8521:/src/redis-trib.rb?ds=sidebyside diff --git a/src/redis-trib.rb b/src/redis-trib.rb index fa0e8c6d..1b83e19c 100755 --- a/src/redis-trib.rb +++ b/src/redis-trib.rb @@ -319,7 +319,7 @@ class RedisTrib # divisibility. Like we have 3 nodes and need to get 10 slots, we take # 4 from the first, and 3 from the rest. So the biggest is always the first. sources = sources.sort{|a,b| b.slots.length <=> a.slots.length} - source_tot_slots = sources.inject {|a,b| a.slots.length+b.slots.length} + source_tot_slots = sources.inject(0) {|sum,source| sum+source.slots.length} sources.each_with_index{|s,i| # Every node will provide a number of slots proportional to the # slots it has assigned. @@ -357,7 +357,7 @@ class RedisTrib keys = source.r.cluster("getkeysinslot",slot,10) break if keys.length == 0 keys.each{|key| - source.r.migrate(target.info[:host],target.info[:port],key,0,1) + source.r.migrate(target.info[:host],target.info[:port],key,0,1000) print "." if o[:verbose] STDOUT.flush }