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
9fb160b1
Commit
9fb160b1
authored
Jan 24, 2019
by
artix
Browse files
Cluster Manager: remove unused code elements
parent
f99e0f59
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
9fb160b1
...
@@ -1934,7 +1934,6 @@ typedef struct clusterManagerNode {
...
@@ -1934,7 +1934,6 @@ typedef struct clusterManagerNode {
int flags;
int flags;
list *flags_str; /* Flags string representations */
list *flags_str; /* Flags string representations */
sds replicate; /* Master ID if node is a slave */
sds replicate; /* Master ID if node is a slave */
list replicas;
int dirty; /* Node has changes that can be flushed */
int dirty; /* Node has changes that can be flushed */
uint8_t slots[CLUSTER_MANAGER_SLOTS];
uint8_t slots[CLUSTER_MANAGER_SLOTS];
int slots_count;
int slots_count;
...
@@ -2466,21 +2465,17 @@ static int clusterManagerGetAntiAffinityScore(clusterManagerNodeArray *ipnodes,
...
@@ -2466,21 +2465,17 @@ static int clusterManagerGetAntiAffinityScore(clusterManagerNodeArray *ipnodes,
clusterManagerNode *node = node_array->nodes[j];
clusterManagerNode *node = node_array->nodes[j];
if (node == NULL) continue;
if (node == NULL) continue;
if (!ip) ip = node->ip;
if (!ip) ip = node->ip;
sds types
, otypes
;
sds types;
/
/
We always use the Master ID as key
/
*
We always use the Master ID as key
. */
sds key = (!node->replicate ? node->name : node->replicate);
sds key = (!node->replicate ? node->name : node->replicate);
assert(key != NULL);
assert(key != NULL);
dictEntry *entry = dictFind(related, key);
dictEntry *entry = dictFind(related, key);
if (entry) otypes = (sds) dictGetVal(entry);
if (entry) types = sdsdup((sds) dictGetVal(entry));
else {
else types = sdsempty();
otypes = sdsempty();
/* Master type 'm' is always set as the first character of the
dictAdd(related, key, otypes);
* types string. */
}
if (!node->replicate) types = sdscatprintf(types, "m%s", types);
// Master type 'm' is always set as the first character of the
else types = sdscat(types, "s");
// types string.
otypes = sdsdup(otypes);
if (!node->replicate) types = sdscatprintf(otypes, "m%s", otypes);
else types = sdscat(otypes, "s");
dictReplace(related, key, types);
dictReplace(related, key, types);
}
}
/* Now it's trivial to check, for each related group having the
/* Now it's trivial to check, for each related group having the
...
...
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