Merge pull request #2313 from xiang90/cluster_mu
etcdserver: move the mutex before what it guardsrelease-2.0
commit
73e67628d9
|
@ -56,14 +56,15 @@ type ClusterInfo interface {
|
||||||
|
|
||||||
// Cluster is a list of Members that belong to the same raft cluster
|
// Cluster is a list of Members that belong to the same raft cluster
|
||||||
type Cluster struct {
|
type Cluster struct {
|
||||||
id types.ID
|
id types.ID
|
||||||
token string
|
token string
|
||||||
members map[types.ID]*Member
|
store store.Store
|
||||||
|
|
||||||
|
sync.Mutex // guards members and removed map
|
||||||
|
members map[types.ID]*Member
|
||||||
// removed contains the ids of removed members in the cluster.
|
// removed contains the ids of removed members in the cluster.
|
||||||
// removed id cannot be reused.
|
// removed id cannot be reused.
|
||||||
removed map[types.ID]bool
|
removed map[types.ID]bool
|
||||||
store store.Store
|
|
||||||
sync.Mutex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewClusterFromString returns a Cluster instantiated from the given cluster token
|
// NewClusterFromString returns a Cluster instantiated from the given cluster token
|
||||||
|
|
Loading…
Reference in New Issue