From b50f4a57f0969c59923b4fc210c78f834f31bad1 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Mon, 2 May 2022 15:34:45 -0400 Subject: [PATCH] replica unseal with work with worker fetch over rpc --- extern/sector-storage/manager.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/extern/sector-storage/manager.go b/extern/sector-storage/manager.go index fcbe141b0..8a41aa8f1 100644 --- a/extern/sector-storage/manager.go +++ b/extern/sector-storage/manager.go @@ -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