mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
enhance(metanode).add interface of IsRestoring to raft store for better performace while do IsFollowerRead jugement
Signed-off-by: leonrayang <chl696@sina.com>
This commit is contained in:
parent
179b964033
commit
9db9e6ed1f
@ -222,7 +222,7 @@ func (rs *RaftServer) IsRestoring(id uint64) bool {
|
||||
rs.mu.RLock()
|
||||
defer rs.mu.RUnlock()
|
||||
if raft, ok := rs.rafts[id]; ok {
|
||||
return raft.restoringSnapshot.Get() || raft.applied() == 0
|
||||
return raft.restoringSnapshot.Get() && raft.applied() == 0
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@ -900,8 +900,7 @@ func (mp *metaPartition) IsFollowerRead() (ok bool) {
|
||||
return false
|
||||
}
|
||||
|
||||
status := mp.raftPartition.Status()
|
||||
if status == nil || status.RestoringSnapshot || status.Applied == 0 {
|
||||
if mp.raftPartition.IsRestoring() {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user