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