mirror of
https://github.com/fluencelabs/redis
synced 2025-05-25 08:31:18 +00:00
new INFO filed master_link_down_since_seconds
This commit is contained in:
parent
b04e800b98
commit
5d5fe340e0
@ -523,6 +523,7 @@ void freeClient(redisClient *c) {
|
|||||||
if (c->flags & REDIS_MASTER) {
|
if (c->flags & REDIS_MASTER) {
|
||||||
server.master = NULL;
|
server.master = NULL;
|
||||||
server.replstate = REDIS_REPL_CONNECT;
|
server.replstate = REDIS_REPL_CONNECT;
|
||||||
|
server.repl_down_since = time(NULL);
|
||||||
/* Since we lost the connection with the master, we should also
|
/* Since we lost the connection with the master, we should also
|
||||||
* close the connection with all our slaves if we have any, so
|
* close the connection with all our slaves if we have any, so
|
||||||
* when we'll resync with the master the other slaves will sync again
|
* when we'll resync with the master the other slaves will sync again
|
||||||
|
@ -853,6 +853,7 @@ void initServerConfig() {
|
|||||||
server.replstate = REDIS_REPL_NONE;
|
server.replstate = REDIS_REPL_NONE;
|
||||||
server.repl_syncio_timeout = REDIS_REPL_SYNCIO_TIMEOUT;
|
server.repl_syncio_timeout = REDIS_REPL_SYNCIO_TIMEOUT;
|
||||||
server.repl_serve_stale_data = 1;
|
server.repl_serve_stale_data = 1;
|
||||||
|
server.repl_down_since = -1;
|
||||||
|
|
||||||
/* Double constants initialization */
|
/* Double constants initialization */
|
||||||
R_Zero = 0.0;
|
R_Zero = 0.0;
|
||||||
@ -1317,7 +1318,14 @@ sds genRedisInfoString(void) {
|
|||||||
(int)(time(NULL)-server.repl_transfer_lastio)
|
(int)(time(NULL)-server.repl_transfer_lastio)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (server.replstate != REDIS_REPL_CONNECTED) {
|
||||||
|
info = sdscatprintf(info,
|
||||||
|
"master_link_down_since_seconds:%ld\r\n",
|
||||||
|
(long)time(NULL)-server.repl_down_since);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (server.vm_enabled) {
|
if (server.vm_enabled) {
|
||||||
lockThreadedIO();
|
lockThreadedIO();
|
||||||
info = sdscatprintf(info,
|
info = sdscatprintf(info,
|
||||||
|
@ -452,6 +452,7 @@ struct redisServer {
|
|||||||
char *repl_transfer_tmpfile; /* slave-> master SYNC temp file name */
|
char *repl_transfer_tmpfile; /* slave-> master SYNC temp file name */
|
||||||
time_t repl_transfer_lastio; /* unix time of the latest read, for timeout */
|
time_t repl_transfer_lastio; /* unix time of the latest read, for timeout */
|
||||||
int repl_serve_stale_data; /* Serve stale data when link is down? */
|
int repl_serve_stale_data; /* Serve stale data when link is down? */
|
||||||
|
time_t repl_down_since; /* unix time at which link with master went down */
|
||||||
/* Limits */
|
/* Limits */
|
||||||
unsigned int maxclients;
|
unsigned int maxclients;
|
||||||
unsigned long long maxmemory;
|
unsigned long long maxmemory;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user