New INFO field "min_slaves_good_slaves".

When min-slaves-to-write feature is active, this field reports the
number of slaves considered good (online state, lag within the specified
range).
This commit is contained in:
antirez 2013-05-30 12:18:31 +02:00
parent 1a54d5963e
commit 88441bf18f

View File

@ -2326,9 +2326,20 @@ sds genRedisInfoString(char *section) {
server.slave_priority, server.slave_priority,
server.repl_slave_ro); server.repl_slave_ro);
} }
info = sdscatprintf(info, info = sdscatprintf(info,
"connected_slaves:%lu\r\n", "connected_slaves:%lu\r\n",
listLength(server.slaves)); listLength(server.slaves));
/* If min-slaves-to-write is active, write the number of slaves
* currently considered 'good'. */
if (server.repl_min_slaves_to_write &&
server.repl_min_slaves_max_lag) {
info = sdscatprintf(info,
"min_slaves_good_slaves:%d\r\n",
server.repl_good_slaves_count);
}
if (listLength(server.slaves)) { if (listLength(server.slaves)) {
int slaveid = 0; int slaveid = 0;
listNode *ln; listNode *ln;