Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
164b6bba
Commit
164b6bba
authored
May 19, 2015
by
antirez
Browse files
Merge branch 'sentinel-32' into unstable
parents
eb138f15
d614f1c3
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
164b6bba
This diff is collapsed.
Click to expand it.
tests/sentinel/tests/06-ckquorum.tcl
0 → 100644
View file @
164b6bba
# Test for the SENTINEL CKQUORUM command
source
"../tests/includes/init-tests.tcl"
set num_sentinels
[
llength $::sentinel_instances
]
test
"CKQUORUM reports OK and the right amount of Sentinels"
{
foreach_sentinel_id id
{
assert_match
"*OK
$num
_sentinels usable*"
[
S $id SENTINEL CKQUORUM mymaster
]
}
}
test
"CKQUORUM detects quorum cannot be reached"
{
set orig_quorum
[
expr
{
$num
_sentinels/2+1
}]
S 0 SENTINEL SET mymaster quorum
[
expr
{
$num
_sentinels+1
}]
catch
{[
S 0 SENTINEL CKQUORUM mymaster
]}
err
assert_match
"*NOQUORUM*"
$err
S 0 SENTINEL SET mymaster quorum $orig_quorum
}
test
"CKQUORUM detects failover authorization cannot be reached"
{
set orig_quorum
[
expr
{
$num
_sentinels/2+1
}]
S 0 SENTINEL SET mymaster quorum 1
kill_instance sentinel 1
kill_instance sentinel 2
kill_instance sentinel 3
after 5000
catch
{[
S 0 SENTINEL CKQUORUM mymaster
]}
err
assert_match
"*NOQUORUM*"
$err
S 0 SENTINEL SET mymaster quorum $orig_quorum
restart_instance sentinel 1
restart_instance sentinel 2
restart_instance sentinel 3
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment