stores: nicer error when sector was lost

This commit is contained in:
Łukasz Magiera 2020-04-29 16:03:44 +02:00
parent a0af4d4d2b
commit 9777ddd2b7
2 changed files with 5 additions and 3 deletions

View File

@ -277,11 +277,9 @@ func (i *Index) StorageBestAlloc(ctx context.Context, allocate SectorFileType, s
for _, p := range i.stores { for _, p := range i.stores {
if sealing && !p.info.CanSeal { if sealing && !p.info.CanSeal {
log.Debugf("alloc: not considering %s; can't seal", p.info.ID)
continue continue
} }
if !sealing && !p.info.CanStore { if !sealing && !p.info.CanStore {
log.Debugf("alloc: not considering %s; can't store", p.info.ID)
continue continue
} }

View File

@ -92,6 +92,10 @@ func (r *Remote) acquireFromRemote(ctx context.Context, s abi.SectorID, fileType
return "", "", "", nil, err return "", "", "", nil, err
} }
if len(si) == 0 {
return "", "", "", nil, xerrors.Errorf("failed to acquire sector %v from remote(%d): not found", s, fileType)
}
sort.Slice(si, func(i, j int) bool { sort.Slice(si, func(i, j int) bool {
return si[i].Weight < si[j].Weight return si[i].Weight < si[j].Weight
}) })