fix(data): When loading the disk, strengthen the checking before removing the duplicated data partition directories.

Signed-off-by: true1064 <tangjingyu@oppo.com>
This commit is contained in:
true1064 2024-06-19 19:04:59 +08:00 committed by longerfly
parent 981b298ca3
commit 035fafbf52

View File

@ -297,9 +297,16 @@ func (manager *SpaceManager) LoadDisk(path string, reservedSpace, diskRdonlySpac
if loadedDp, has := manager.partitions[dp.partitionID]; !has {
manager.partitions[dp.partitionID] = dp
manager.partitionMutex.Unlock()
log.LogDebugf("action[LoadDisk] put partition(%v) to manager manager.", dp.partitionID)
log.LogDebugf("action[LoadDisk] put partition(%v) to manager.", dp.partitionID)
} else {
manager.partitionMutex.Unlock()
if loadedDp.disk.Path == dp.disk.Path {
log.LogWarnf("[LoadDisk] dp(%v) is loaded, to load(%v), but disk path is the same",
loadedDp.info(), dp.info())
return
}
log.LogWarnf("action[LoadDisk] dp(%v) is loaded, to load(%v).", loadedDp.info(), dp.info())
_, _, infos, err := dp.fetchReplicasFromMaster()
if err != nil {