replica unseal with work with worker fetch over rpc

This commit is contained in:
Geoff Stuart 2022-05-02 15:34:45 -04:00
parent 94ceb0355d
commit b50f4a57f0

View File

@ -282,15 +282,10 @@ func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storage.SectorR
sealFetch := func(ctx context.Context, worker Worker) error {
log.Debugf("copy sealed/cache sector data for sector %d", sector.ID)
_, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy))
if err != nil && !xerrors.Is(err, storiface.ErrSectorNotFound) {
return err
}
_, err2 := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTUpdate|storiface.FTUpdateCache, storiface.PathSealing, storiface.AcquireCopy))
if err2 != nil && !xerrors.Is(err, storiface.ErrSectorNotFound) {
return err
}
if err != nil && err2 != nil {
return xerrors.Errorf("cannot unseal piece. No sealed or updated sector found")
return xerrors.Errorf("cannot unseal piece. error fetching sealed data: %w. error fetching replica data: %w", err, err2)
}
return nil