mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
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:
parent
0d3ac68d65
commit
a95dde77bf
@ -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())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user