mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 10:06:14 +00:00
fix(master): fix panic caused by lack of locking during concurrent access to the rafts map.
close: #1000356742 Signed-off-by: shuqiang-zheng <zhengshuqiang@oppo.com>
This commit is contained in:
parent
65ac8ca7b2
commit
5635b02677
@ -40,9 +40,12 @@ type RaftServer struct {
|
||||
func (rs *RaftServer) RemoveRaftForce(raftId uint64, cc *proto.ConfChange) {
|
||||
var s *raft
|
||||
var ok bool
|
||||
rs.mu.RLock()
|
||||
if s, ok = rs.rafts[raftId]; !ok {
|
||||
rs.mu.RUnlock()
|
||||
return
|
||||
}
|
||||
rs.mu.RUnlock()
|
||||
// repl apply
|
||||
peerChange := cc.Peer
|
||||
for _, replica := range s.raftFsm.replicas {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user