mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
assert_empty in redis-trib
This commit is contained in:
parent
8c4c50906c
commit
f29d1fb0b2
@ -43,6 +43,14 @@ class ClusterNode
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def assert_empty
|
||||||
|
if !(@r.cluster("info").split("\r\n").index("cluster_known_nodes:1")) ||
|
||||||
|
(@r.info['db0'])
|
||||||
|
puts "Error: Node #{self} is not empty. Either the node already knows other nodes (check with nodes-info) or contains some key in database 0."
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def r
|
def r
|
||||||
@r
|
@r
|
||||||
end
|
end
|
||||||
@ -63,7 +71,7 @@ class RedisTrib
|
|||||||
node = ClusterNode.new(n)
|
node = ClusterNode.new(n)
|
||||||
node.connect
|
node.connect
|
||||||
node.assert_cluster
|
node.assert_cluster
|
||||||
# node.assert_empty
|
node.assert_empty
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user