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
2507e366
Commit
2507e366
authored
Dec 13, 2013
by
antirez
Browse files
Sentinel: dead code removed.
parent
f9e9448a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
2507e366
...
...
@@ -1640,8 +1640,6 @@ void sentinelRefreshInstanceInfo(sentinelRedisInstance *ri, const char *info) {
sds *lines;
int numlines, j;
int role = 0;
int
runid_changed
=
0
;
/* true if runid changed. */
int
first_runid
=
0
;
/* true if this is the first runid we receive. */
/* The following fields must be reset to a given value in the case they
* are not found at all in the INFO output. */
...
...
@@ -1657,10 +1655,8 @@ void sentinelRefreshInstanceInfo(sentinelRedisInstance *ri, const char *info) {
if (sdslen(l) >= 47 && !memcmp(l,"run_id:",7)) {
if (ri->runid == NULL) {
ri->runid = sdsnewlen(l+7,40);
first_runid
=
1
;
} else {
if (strncmp(ri->runid,l+7,40) != 0) {
runid_changed
=
1
;
sentinelEvent(REDIS_NOTICE,"+reboot",ri,"%@");
sdsfree(ri->runid);
ri->runid = sdsnewlen(l+7,40);
...
...
@@ -3236,17 +3232,12 @@ void sentinelFailoverReconfNextSlave(sentinelRedisInstance *master) {
void sentinelFailoverSwitchToPromotedSlave(sentinelRedisInstance *master) {
sentinelRedisInstance *ref = master->promoted_slave ?
master->promoted_slave : master;
sds
old_master_ip
;
int
old_master_port
;
sentinelEvent(REDIS_WARNING,"+switch-master",master,"%s %s %d %s %d",
master->name, master->addr->ip, master->addr->port,
ref->addr->ip, ref->addr->port);
old_master_ip
=
sdsdup
(
master
->
addr
->
ip
);
old_master_port
=
master
->
addr
->
port
;
sentinelResetMasterAndChangeAddress(master,ref->addr->ip,ref->addr->port);
sdsfree
(
old_master_ip
);
}
void sentinelFailoverStateMachine(sentinelRedisInstance *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