mirror of
https://github.com/redis/redis.git
synced 2026-01-09 19:38:06 -05:00
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:
@@ -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]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user