etcdserver: fix data race in Cluster struct

This commit is contained in:
Yicheng Qin
2014-11-05 12:40:51 -08:00
parent c3b0de943c
commit 211c5e3e29
2 changed files with 28 additions and 31 deletions

View File

@ -1382,31 +1382,6 @@ func (w *waitWithResponse) Register(id uint64) <-chan interface{} {
}
func (w *waitWithResponse) Trigger(id uint64, x interface{}) {}
type clusterStoreRecorder struct {
recorder
}
func (cs *clusterStoreRecorder) Add(m Member) {
cs.record(action{name: "Add", params: []interface{}{m}})
}
func (cs *clusterStoreRecorder) Get() Cluster {
cs.record(action{name: "Get"})
return Cluster{}
}
func (cs *clusterStoreRecorder) Remove(id uint64) {
cs.record(action{name: "Remove", params: []interface{}{id}})
}
func (cs *clusterStoreRecorder) IsRemoved(id uint64) bool { return false }
type removedClusterStore struct {
removed map[uint64]bool
}
func (cs *removedClusterStore) Add(m Member) {}
func (cs *removedClusterStore) Get() Cluster { return Cluster{} }
func (cs *removedClusterStore) Remove(id uint64) {}
func (cs *removedClusterStore) IsRemoved(id uint64) bool { return cs.removed[id] }
type nopSender struct{}
func (s *nopSender) Send(m []raftpb.Message) {}