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
48d74f20
Commit
48d74f20
authored
Feb 20, 2014
by
antirez
Browse files
Sentinel: report instances role switch events.
This is useful mostly for debugging of issues.
parent
8a6774e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
48d74f20
...
...
@@ -1770,6 +1770,14 @@ void sentinelRefreshInstanceInfo(sentinelRedisInstance *ri, const char *info) {
ri
->
role_reported_time
=
mstime
();
ri
->
role_reported
=
role
;
if
(
role
==
SRI_SLAVE
)
ri
->
slave_conf_change_time
=
mstime
();
/* Log the event with +role-change if the new role is coherent or
* with -role-change if there is a mismatch with the current config. */
sentinelEvent
(
REDIS_VERBOSE
,
((
ri
->
flags
&
(
SRI_MASTER
|
SRI_SLAVE
))
==
role
)
?
"+role-change"
:
"-role-change"
,
ri
,
"%@ new reported role is %s"
,
role
==
SRI_MASTER
?
"master"
:
"slave"
,
ri
->
flags
&
SRI_MASTER
?
"master"
:
"slave"
);
}
/* Handle master -> slave role switch. */
...
...
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