package sdlgoredis
import (
+ "fmt"
"github.com/go-redis/redis/v7"
+ "strconv"
)
type Sentinel struct {
state.PrimaryDbState = *pState
state.ReplicasDbState = rState
state.SentinelsDbState = sState
+
+ cnt, err := strconv.Atoi(s.Cfg.nodeCnt)
+ if err != nil {
+ state.Err = fmt.Errorf("Sentinel DBAAS_NODE_COUNT configuration value '%s' conversion to integer failed", s.Cfg.nodeCnt)
+ return state, state.Err
+ }
+ state.ConfigNodeCnt = cnt
+
if pErr != nil {
return state, pErr
}
if redisErr == nil {
for _, redisSentinel := range redisVal {
sentinelState := readSentinelState(redisSentinel.([]interface{}))
- states.States = append(states.States, sentinelState)
+ // Ignore a sentinel entry with zero port, because missing of fix
+ // for the Redis Bug #9240.
+ if sentinelState.Fields.Port != "0" {
+ states.States = append(states.States, sentinelState)
+ }
}
}
states.Err = redisErr