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
5d5fe340
Commit
5d5fe340
authored
Jun 17, 2011
by
antirez
Browse files
new INFO filed master_link_down_since_seconds
parent
b04e800b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
5d5fe340
...
...
@@ -523,6 +523,7 @@ void freeClient(redisClient *c) {
if
(
c
->
flags
&
REDIS_MASTER
)
{
server
.
master
=
NULL
;
server
.
replstate
=
REDIS_REPL_CONNECT
;
server
.
repl_down_since
=
time
(
NULL
);
/* Since we lost the connection with the master, we should also
* 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
...
...
src/redis.c
View file @
5d5fe340
...
...
@@ -853,6 +853,7 @@ void initServerConfig() {
server.replstate = REDIS_REPL_NONE;
server.repl_syncio_timeout = REDIS_REPL_SYNCIO_TIMEOUT;
server.repl_serve_stale_data = 1;
server.repl_down_since = -1;
/* Double constants initialization */
R_Zero = 0.0;
...
...
@@ -1317,7 +1318,14 @@ sds genRedisInfoString(void) {
(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) {
lockThreadedIO();
info = sdscatprintf(info,
...
...
src/redis.h
View file @
5d5fe340
...
...
@@ -452,6 +452,7 @@ struct redisServer {
char
*
repl_transfer_tmpfile
;
/* slave-> master SYNC temp file name */
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? */
time_t
repl_down_since
;
/* unix time at which link with master went down */
/* Limits */
unsigned
int
maxclients
;
unsigned
long
long
maxmemory
;
...
...
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