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
5cdefb7c
Commit
5cdefb7c
authored
Jun 10, 2014
by
antirez
Browse files
Cluster: cluster_my_epoch added to CLUSTER INFO output.
parent
2213f283
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
5cdefb7c
...
@@ -3564,6 +3564,7 @@ void clusterCommand(redisClient *c) {
...
@@ -3564,6 +3564,7 @@ void clusterCommand(redisClient *c) {
/* CLUSTER INFO */
/* CLUSTER INFO */
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
;
uint64_t
myepoch
;
int
j
;
int
j
;
for
(
j
=
0
;
j
<
REDIS_CLUSTER_SLOTS
;
j
++
)
{
for
(
j
=
0
;
j
<
REDIS_CLUSTER_SLOTS
;
j
++
)
{
...
@@ -3580,6 +3581,9 @@ void clusterCommand(redisClient *c) {
...
@@ -3580,6 +3581,9 @@ void clusterCommand(redisClient *c) {
}
}
}
}
myepoch
=
(
nodeIsSlave
(
myself
)
&&
myself
->
slaveof
)
?
myself
->
slaveof
->
configEpoch
:
myself
->
configEpoch
;
sds
info
=
sdscatprintf
(
sdsempty
(),
sds
info
=
sdscatprintf
(
sdsempty
(),
"cluster_state:%s
\r\n
"
"cluster_state:%s
\r\n
"
"cluster_slots_assigned:%d
\r\n
"
"cluster_slots_assigned:%d
\r\n
"
...
@@ -3589,6 +3593,7 @@ void clusterCommand(redisClient *c) {
...
@@ -3589,6 +3593,7 @@ void clusterCommand(redisClient *c) {
"cluster_known_nodes:%lu
\r\n
"
"cluster_known_nodes:%lu
\r\n
"
"cluster_size:%d
\r\n
"
"cluster_size:%d
\r\n
"
"cluster_current_epoch:%llu
\r\n
"
"cluster_current_epoch:%llu
\r\n
"
"cluster_my_epoch:%llu
\r\n
"
"cluster_stats_messages_sent:%lld
\r\n
"
"cluster_stats_messages_sent:%lld
\r\n
"
"cluster_stats_messages_received:%lld
\r\n
"
"cluster_stats_messages_received:%lld
\r\n
"
,
statestr
[
server
.
cluster
->
state
],
,
statestr
[
server
.
cluster
->
state
],
...
@@ -3599,6 +3604,7 @@ void clusterCommand(redisClient *c) {
...
@@ -3599,6 +3604,7 @@ void clusterCommand(redisClient *c) {
dictSize
(
server
.
cluster
->
nodes
),
dictSize
(
server
.
cluster
->
nodes
),
server
.
cluster
->
size
,
server
.
cluster
->
size
,
(
unsigned
long
long
)
server
.
cluster
->
currentEpoch
,
(
unsigned
long
long
)
server
.
cluster
->
currentEpoch
,
(
unsigned
long
long
)
myepoch
,
server
.
cluster
->
stats_bus_messages_sent
,
server
.
cluster
->
stats_bus_messages_sent
,
server
.
cluster
->
stats_bus_messages_received
server
.
cluster
->
stats_bus_messages_received
);
);
...
...
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