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
66f2517f
Commit
66f2517f
authored
May 02, 2011
by
antirez
Browse files
render migrating and importing slots in cluster nodes info
parent
74a64049
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
66f2517f
...
@@ -1086,6 +1086,21 @@ sds clusterGenNodesDescription(void) {
...
@@ -1086,6 +1086,21 @@ sds clusterGenNodesDescription(void) {
start
=
-
1
;
start
=
-
1
;
}
}
}
}
/* Just for MYSELF node we also dump info about slots that
* we are migrating to other instances or importing from other
* instances. */
if
(
node
->
flags
&
REDIS_NODE_MYSELF
)
{
for
(
j
=
0
;
j
<
REDIS_CLUSTER_SLOTS
;
j
++
)
{
if
(
server
.
cluster
.
migrating_slots_to
[
j
])
{
ci
=
sdscatprintf
(
ci
,
" [%d->%.40s]"
,
j
,
server
.
cluster
.
migrating_slots_to
[
j
]
->
name
);
}
else
if
(
server
.
cluster
.
importing_slots_from
[
j
])
{
ci
=
sdscatprintf
(
ci
,
" [%d<-%.40s]"
,
j
,
server
.
cluster
.
importing_slots_from
[
j
]
->
name
);
}
}
}
ci
=
sdscatlen
(
ci
,
"
\n
"
,
1
);
ci
=
sdscatlen
(
ci
,
"
\n
"
,
1
);
}
}
dictReleaseIterator
(
di
);
dictReleaseIterator
(
di
);
...
@@ -1206,6 +1221,7 @@ void clusterCommand(redisClient *c) {
...
@@ -1206,6 +1221,7 @@ void clusterCommand(redisClient *c) {
}
else
{
}
else
{
addReplyError
(
c
,
"Invalid CLUSTER SETSLOT action or number of arguments"
);
addReplyError
(
c
,
"Invalid CLUSTER SETSLOT action or number of arguments"
);
}
}
addReply
(
c
,
shared
.
ok
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"info"
)
&&
c
->
argc
==
2
)
{
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"info"
)
&&
c
->
argc
==
2
)
{
char
*
statestr
[]
=
{
"ok"
,
"fail"
,
"needhelp"
};
char
*
statestr
[]
=
{
"ok"
,
"fail"
,
"needhelp"
};
int
slots_assigned
=
0
,
slots_ok
=
0
,
slots_pfail
=
0
,
slots_fail
=
0
;
int
slots_assigned
=
0
,
slots_ok
=
0
,
slots_pfail
=
0
,
slots_fail
=
0
;
...
...
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