Merge pull request #10639 from filecoin-project/fix/fail-unseal-removed-sector

fix: unseal: check if sealed/update sector exists
This commit is contained in:
Phi-rjan 2023-04-20 09:03:42 +02:00 committed by GitHub
commit cb22349506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -319,6 +319,15 @@ func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storiface.Secto
return xerrors.Errorf("acquiring unseal sector lock: %w", err)
}
// Check if sealed or update sector file exists
s, err := m.index.StorageFindSector(ctx, sector.ID, storiface.FTSealed|storiface.FTUpdate, 0, false)
if err != nil {
return xerrors.Errorf("finding sealed or updated sector: %w", err)
}
if len(s) == 0 {
return xerrors.Errorf("sealed or updated sector file not found for sector %d", sector.ID)
}
// if the selected worker does NOT have the sealed files for the sector, instruct it to fetch it from a worker that has them and
// put it in the sealing scratch space.
sealFetch := PrepareAction{