Fix timing issue for sentinel master-reboot test (#14312)

From the following logs, if we are in a slow environment, the election
process of sentinels may become very slow.
Even if the master instance that was restarted and is slowly loading RDB
has already been loaded, the election just gets started.

This PR makes the master load the RDB more slowly, and fixes the missing
of reseting reset `key-load-delay` for the master node.
This commit is contained in:
debing.sun
2025-09-05 14:49:19 +08:00
committed by GitHub
parent 34da5b7860
commit 64546d2009

View File

@@ -40,7 +40,7 @@ test "Master reboot in very short time" {
set addr [S 0 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster]
assert {[lindex $addr 1] == $old_port}
R $master_id debug populate 10000
R $master_id debug populate 20000
R $master_id bgsave
R $master_id config set key-load-delay 1500
R $master_id config set loading-process-events-interval-bytes 1024
@@ -63,6 +63,10 @@ test "Master reboot in very short time" {
}
}
# Reset configuration to avoid unnecessary delays
R $master_id config set key-load-delay 0
R $master_id config rewrite
set addr [S 0 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster]
set master_id [get_instance_id_by_port redis [lindex $addr 1]]