fix(blobnode): delete local disk after it is repaired, fix access DiskNotFound

@formatter:off

Signed-off-by: mawei029 <mawei2@oppo.com>
This commit is contained in:
mawei029 2025-02-20 14:49:14 +08:00 committed by 梁曟風
parent 0d3ac68d65
commit a95dde77bf

View File

@ -179,7 +179,7 @@ func (s *Service) waitRepairAndClose(ctx context.Context, disk core.DiskAPI) {
continue
}
if info.Status >= proto.DiskStatusRepairing {
if info.Status >= proto.DiskStatusRepaired {
span.Infof("disk:%d path:%s status:%v", diskID, info.Path, info.Status)
break
}
@ -189,8 +189,8 @@ func (s *Service) waitRepairAndClose(ctx context.Context, disk core.DiskAPI) {
config := disk.GetConfig()
s.reportOnlineDisk(&config.HostInfo, config.Path)
// after the repair is triggered, the handle can be safely removed
span.Infof("Delete %d from the map table of the service", diskID)
// after the repair is finish, the handle can be safely removed. if delete disk at repairing, access will DiskNotFound
span.Warnf("Delete %d from the map table of the service", diskID)
s.lock.Lock()
delete(s.Disks, disk.ID())