Commit d8158771 authored by antirez's avatar antirez
Browse files

Sentinel: INFO-CACHE comments reworked a bit.

Changed in order to make them more review friendly, based on the
experience of reviewing the code myself.
parent c83a9172
......@@ -2786,14 +2786,10 @@ void sentinelCommand(redisClient *c) {
sentinelSetCommand(c);
} else if (!strcasecmp(c->argv[1]->ptr,"info-cache")) {
if (c->argc < 2) goto numargserr;
/* Reply format:
* 1.) master name
* 2.) 1.) info from master
* 2.) info from replica
* ...
* 3.) other master name
* ...
*/
/* Create an ad-hoc dictionary type so that we can iterate
* a dictionary composed of just the master groups the user
* requested. */
dictType copy_keeper = instancesDictType;
copy_keeper.valDestructor = NULL;
dict *masters_local = sentinel.masters;
......@@ -2808,8 +2804,14 @@ void sentinelCommand(redisClient *c) {
}
}
/* Now we can iterate over individually requested masters the
* same way we iterate over the entire sentinel->masters dict. */
/* Reply format:
* 1.) master name
* 2.) 1.) info from master
* 2.) info from replica
* ...
* 3.) other master name
* ...
*/
addReplyMultiBulkLen(c,dictSize(masters_local) * 2);
dictIterator *di;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment