2014-04-24 09:08:22 +00:00
|
|
|
# Sentinel test suite. Copyright (C) 2014 Salvatore Sanfilippo antirez@gmail.com
|
2014-07-31 18:25:48 +00:00
|
|
|
# This software is released under the BSD License. See the COPYING file for
|
2014-04-24 09:08:22 +00:00
|
|
|
# more information.
|
|
|
|
|
|
|
|
cd tests/sentinel
|
|
|
|
source ../instances.tcl
|
|
|
|
|
2014-04-29 14:17:15 +00:00
|
|
|
set ::instances_count 5 ; # How many instances we use at max.
|
2019-09-12 08:10:22 +00:00
|
|
|
set ::tlsdir "../../tls"
|
2014-04-29 14:17:15 +00:00
|
|
|
|
2014-04-24 09:08:22 +00:00
|
|
|
proc main {} {
|
|
|
|
parse_options
|
2021-02-08 15:02:46 +00:00
|
|
|
if {$::leaked_fds_file != ""} {
|
|
|
|
set ::env(LEAKED_FDS_FILE) $::leaked_fds_file
|
|
|
|
}
|
Sentinel: Fix Config Dependency and Rewrite Sequence (#8271)
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.
2021-01-26 07:31:54 +00:00
|
|
|
spawn_instance sentinel $::sentinel_base_port $::instances_count [list "sentinel deny-scripts-reconfig no"] "../tests/includes/sentinel.conf"
|
2014-04-24 09:08:22 +00:00
|
|
|
spawn_instance redis $::redis_base_port $::instances_count
|
|
|
|
run_tests
|
|
|
|
cleanup
|
2015-03-30 12:29:01 +00:00
|
|
|
end_tests
|
2014-04-24 09:08:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if {[catch main e]} {
|
|
|
|
puts $::errorInfo
|
|
|
|
cleanup
|
2014-06-18 12:10:04 +00:00
|
|
|
exit 1
|
2014-04-24 09:08:22 +00:00
|
|
|
}
|