(ctx context.Context, node store.Node)
| 105 | } |
| 106 | |
| 107 | func (c *ClusterChecker) probeNode(ctx context.Context, node store.Node) (int64, error) { |
| 108 | clusterInfo, err := node.GetClusterInfo(ctx) |
| 109 | if err != nil { |
| 110 | // We need to use the string contains to check the error message |
| 111 | // since Kvrocks wrongly returns the error message with `ERR` prefix. |
| 112 | // And it's fixed in PR: https://github.com/apache/kvrocks/pull/2362, |
| 113 | // but we need to be compatible with the old version here. |
| 114 | if strings.Contains(err.Error(), ErrRestoringBackUp.Error()) { |
| 115 | return -1, ErrRestoringBackUp |
| 116 | } else if strings.Contains(err.Error(), ErrClusterNotInitialized.Error()) { |
| 117 | return -1, ErrClusterNotInitialized |
| 118 | } else { |
| 119 | return -1, err |
| 120 | } |
| 121 | } |
| 122 | return clusterInfo.CurrentEpoch, nil |
| 123 | } |
| 124 | |
| 125 | func (c *ClusterChecker) increaseFailureCount(shardIndex int, node store.Node) int64 { |
| 126 | id := node.ID() |
no test coverage detected