Browse files

replication asynchronous SYNC information in INFO output

  • Loading branch information...
1 parent f643391 commit 12ebe2ac17a26ecf263f90b2acdf03db29b00223 @antirez committed Nov 4, 2010
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/redis.c
View
13 src/redis.c
@@ -1183,12 +1183,23 @@ sds genRedisInfoString(void) {
"master_port:%d\r\n"
"master_link_status:%s\r\n"
"master_last_io_seconds_ago:%d\r\n"
+ "master_sync_in_progress:%d\r\n"
,server.masterhost,
server.masterport,
(server.replstate == REDIS_REPL_CONNECTED) ?
"up" : "down",
- server.master ? ((int)(time(NULL)-server.master->lastinteraction)) : -1
+ server.master ? ((int)(time(NULL)-server.master->lastinteraction)) : -1,
+ server.replstate == REDIS_REPL_TRANSFER
);
+
+ if (server.replstate == REDIS_REPL_TRANSFER) {
+ info = sdscatprintf(info,
+ "master_sync_left_bytes:%ld\r\n"
+ "master_sync_last_io_seconds_ago:%d\r\n"
+ ,(long)server.repl_transfer_left,
+ (int)(time(NULL)-server.repl_transfer_lastio)
+ );
+ }
}
if (server.vm_enabled) {
lockThreadedIO();

0 comments on commit 12ebe2a

Please sign in to comment.