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
a0afa66f
Commit
a0afa66f
authored
Nov 13, 2013
by
antirez
Browse files
Sentinel: being a master and reporting as slave is considered SDOWN.
parent
17718fdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
a0afa66f
...
...
@@ -2319,8 +2319,18 @@ void sentinelCheckSubjectivelyDown(sentinelRedisInstance *ri) {
sentinelKillLink
(
ri
,
ri
->
pc
);
}
/* Update the subjectively down flag. */
if
(
elapsed
>
ri
->
down_after_period
)
{
/* Update the subjectively down flag. We believe the instance is in SDOWN
* state if:
* 1) It is not replying.
* 2) We believe it is a master, it reports to be a slave for enough time
* to meet the down_after_period, plus enough time to get two times
* INFO report from the instance. */
if
(
elapsed
>
ri
->
down_after_period
||
(
ri
->
flags
&
SRI_MASTER
&&
ri
->
role_reported
==
SRI_SLAVE
&&
mstime
()
-
ri
->
role_reported_time
>
(
ri
->
down_after_period
+
SENTINEL_INFO_PERIOD
*
2
)))
{
/* Is subjectively down */
if
((
ri
->
flags
&
SRI_S_DOWN
)
==
0
)
{
sentinelEvent
(
REDIS_WARNING
,
"+sdown"
,
ri
,
"%@"
);
...
...
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