We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93c01ea commit 42679bcCopy full SHA for 42679bc
pkg/client/redis/client.go
@@ -109,12 +109,20 @@ OUTER:
109
slaveInfo := reflect.ValueOf(slaveInfoBlob)
110
for key, value := range slaveInfoBlob.([]interface{}) {
111
stringValue := value.(string)
112
+ // When the master node becomes a slave node, runid will become empty
113
+ if stringValue == "runid" {
114
+ runID := fmt.Sprintf("%+v", slaveInfo.Index(key+1))
115
+ if runID == "" {
116
+ nSlaves += 1
117
+ continue OUTER
118
+ }
119
120
if stringValue == "slave-priority" {
121
slavePriority := fmt.Sprintf("%+v", slaveInfo.Index(key+1))
122
if slavePriority == "1" {
123
nSlaves += 1
124
125
}
- continue OUTER
126
127
128
0 commit comments