mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(master): use lock to set dp markDecommission
Signed-off-by: chihe <chihe@oppo.com>
This commit is contained in:
parent
78bbb209f2
commit
b8742d469a
@ -1548,7 +1548,7 @@ func (dp *DataPartition) hasNodeIDConflict(addr string, nodeID uint64) error {
|
||||
|
||||
func (dp *DataPartition) info() string {
|
||||
diskPath := ""
|
||||
if dp.disk == nil {
|
||||
if dp.disk != nil {
|
||||
diskPath = dp.disk.Path
|
||||
}
|
||||
return fmt.Sprintf("id(%v)_disk(%v)_type(%v)", dp.partitionID, diskPath, dp.partitionType)
|
||||
|
||||
@ -583,6 +583,8 @@ func (dataNode *DataNode) GetDecommissionFailedDP(c *Cluster) (error, []uint64)
|
||||
}
|
||||
|
||||
func (dataNode *DataNode) markDecommission(targetAddr string, raftForce bool, limit int) {
|
||||
dataNode.DecommissionSyncMutex.Lock()
|
||||
defer dataNode.DecommissionSyncMutex.Unlock()
|
||||
dataNode.SetDecommissionStatus(markDecommission)
|
||||
dataNode.DecommissionRaftForce = raftForce
|
||||
dataNode.DecommissionDstAddr = targetAddr
|
||||
|
||||
Loading…
Reference in New Issue
Block a user