Skip to content

Commit

Permalink
implement FAILOVER command (#8315)
Browse files Browse the repository at this point in the history
Implement FAILOVER command, which coordinates failover
between the server and one of its replicas.
  • Loading branch information
allenfarris authored Jan 28, 2021
1 parent 2630189 commit 0d18a1e
Show file tree
Hide file tree
Showing 7 changed files with 679 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,7 @@ NULL
c->argc == 4))
{
/* CLIENT PAUSE TIMEOUT [WRITE|ALL] */
long long duration;
mstime_t end;
int type = CLIENT_PAUSE_ALL;
if (c->argc == 4) {
if (!strcasecmp(c->argv[3]->ptr,"write")) {
Expand All @@ -2694,9 +2694,9 @@ NULL
}
}

if (getTimeoutFromObjectOrReply(c,c->argv[2],&duration,
if (getTimeoutFromObjectOrReply(c,c->argv[2],&end,
UNIT_MILLISECONDS) != C_OK) return;
pauseClients(duration, type);
pauseClients(end, type);
addReply(c,shared.ok);
} else if (!strcasecmp(c->argv[1]->ptr,"tracking") && c->argc >= 3) {
/* CLIENT TRACKING (on|off) [REDIRECT <id>] [BCAST] [PREFIX first]
Expand Down
Loading

0 comments on commit 0d18a1e

Please sign in to comment.