mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
1aad55b66f
This commit fixes a well known and an annoying issue in Sentinel mode. Cause of this issue: Currently, Redis rewrite process works well in server mode, however in sentinel mode, the sentinel config has variant semantics for different configurations, in example configuration https://github.com/redis/redis/blob/unstable/sentinel.conf, we put comments on these. However the rewrite process only treat the sentinel config as a single option. During rewrite process, it will mess up with the lines and comments. Approaches: In order to solve this issue, we need to differentiate different subconfig options in sentinel separately, for example, sentinel monitor <master-name> <ip> <redis-port> <quorum> we can treat it as sentinel monitor option, instead of the sentinel option. This commit also fixes the dependency issue when putting configurations in sentinel.conf. For example before this commit,we must put `sentinel monitor <master-name> <ip> <redis-port> <quorum>` before `sentinel auth-pass <master-name> <password>` for a single master, otherwise the server cannot start and will return error. This commit fixes this issue, as long as the monitoring master was configured, no matter the sequence is, the sentinel can start and run properly.
25 lines
663 B
Tcl
25 lines
663 B
Tcl
# Sentinel test suite. Copyright (C) 2014 Salvatore Sanfilippo antirez@gmail.com
|
|
# This software is released under the BSD License. See the COPYING file for
|
|
# more information.
|
|
|
|
cd tests/sentinel
|
|
source ../instances.tcl
|
|
|
|
set ::instances_count 5 ; # How many instances we use at max.
|
|
set ::tlsdir "../../tls"
|
|
|
|
proc main {} {
|
|
parse_options
|
|
spawn_instance sentinel $::sentinel_base_port $::instances_count [list "sentinel deny-scripts-reconfig no"] "../tests/includes/sentinel.conf"
|
|
spawn_instance redis $::redis_base_port $::instances_count
|
|
run_tests
|
|
cleanup
|
|
end_tests
|
|
}
|
|
|
|
if {[catch main e]} {
|
|
puts $::errorInfo
|
|
cleanup
|
|
exit 1
|
|
}
|