From 69017fa232093728a84dfcb1befe7bc4b204c182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20S=C3=B6derqvist?= Date: Wed, 16 Mar 2022 18:11:38 +0100 Subject: Fix redis-cli CLUSTER SETSLOT race conditions (#10381) After migrating a slot, send CLUSTER SETSLOT NODE to the destination node first to make sure the slot isn't left without an owner in case the destination node crashes before it is set as new owner. When informing the source node, it can happen that the destination node has already informed it and if the source node has lost its last slot, it has already turned itself into a replica. Redis-cli should ignore this error in this case. --- tests/support/server.tcl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/support') diff --git a/tests/support/server.tcl b/tests/support/server.tcl index b06bd73ba..9d0c4510d 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -684,6 +684,14 @@ proc start_server {options {code undefined}} { } } +# Start multiple servers with the same options, run code, then stop them. +proc start_multiple_servers {num options code} { + for {set i 0} {$i < $num} {incr i} { + set code [list start_server $options $code] + } + uplevel 1 $code +} + proc restart_server {level wait_ready rotate_logs {reconnect 1} {shutdown sigterm}} { set srv [lindex $::servers end+$level] if {$shutdown ne {sigterm}} { -- cgit v1.2.1