mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Use newbe instead of s.be to avoid potential race
`s.cluster.SetBackend(s.be)` is not in critical section. Using `newbe` instead of `s.be` can avoid potential data race.
This commit is contained in:
@@ -1291,7 +1291,7 @@ func (s *EtcdServer) applySnapshot(ep *etcdProgress, apply *apply) {
|
||||
plog.Info("finished recovering store v2")
|
||||
}
|
||||
|
||||
s.cluster.SetBackend(s.be)
|
||||
s.cluster.SetBackend(newbe)
|
||||
|
||||
if lg != nil {
|
||||
lg.Info("restoring cluster configuration")
|
||||
|
||||
Reference in New Issue
Block a user