Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
44c5bce0
Commit
44c5bce0
authored
Feb 20, 2019
by
artix
Committed by
antirez
Feb 22, 2019
Browse files
Cluster Manager: fix replica assigment anti-affinity (create)
Fix issue #5849
parent
f066e526
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
44c5bce0
...
@@ -4675,6 +4675,12 @@ static int clusterManagerCommandCreate(int argc, char **argv) {
...
@@ -4675,6 +4675,12 @@ static int clusterManagerCommandCreate(int argc, char **argv) {
cursor
+=
slots_per_node
;
cursor
+=
slots_per_node
;
}
}
/* Rotating the list sometimes helps to get better initial
* anti-affinity before the optimizer runs. */
clusterManagerNode
*
first_node
=
interleaved
[
0
];
for
(
i
=
0
;
i
<
(
interleaved_len
-
1
);
i
++
)
interleaved
[
i
]
=
interleaved
[
i
+
1
];
interleaved
[
interleaved_len
-
1
]
=
first_node
;
int
assign_unused
=
0
,
available_count
=
interleaved_len
;
int
assign_unused
=
0
,
available_count
=
interleaved_len
;
assign_replicas:
assign_replicas:
for
(
i
=
0
;
i
<
masters_count
;
i
++
)
{
for
(
i
=
0
;
i
<
masters_count
;
i
++
)
{
...
...
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