mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #14828 from ahrtr/identify_corrupted_member_20221123
Identify corrupted member depending on quorum
This commit is contained in:
@@ -14,7 +14,10 @@
|
||||
|
||||
package types
|
||||
|
||||
import "strconv"
|
||||
import (
|
||||
"bytes"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// ID represents a generic identifier which is canonically
|
||||
// stored as a uint64 but is typically represented as a
|
||||
@@ -37,3 +40,17 @@ type IDSlice []ID
|
||||
func (p IDSlice) Len() int { return len(p) }
|
||||
func (p IDSlice) Less(i, j int) bool { return uint64(p[i]) < uint64(p[j]) }
|
||||
func (p IDSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
||||
|
||||
func (p IDSlice) String() string {
|
||||
var b bytes.Buffer
|
||||
if p.Len() > 0 {
|
||||
b.WriteString(p[0].String())
|
||||
}
|
||||
|
||||
for i := 1; i < p.Len(); i++ {
|
||||
b.WriteString(",")
|
||||
b.WriteString(p[i].String())
|
||||
}
|
||||
|
||||
return b.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user