From 4b78c4ea1e46f35e26845d57c70c018ff1c0f06e Mon Sep 17 00:00:00 2001 From: Jennifer Wang Date: Wed, 30 Aug 2023 12:21:54 -0400 Subject: [PATCH] ffiwrapper: Fix sector acquire logic in unsealing --- storage/sealer/manager.go | 4 ++-- storage/sealer/worker_local.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/sealer/manager.go b/storage/sealer/manager.go index 3f496b7de..700a5aec5 100644 --- a/storage/sealer/manager.go +++ b/storage/sealer/manager.go @@ -330,7 +330,7 @@ func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storiface.Secto // 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{ + unsealFetch := PrepareAction{ Action: 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)) @@ -359,7 +359,7 @@ func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storiface.Secto selector := newExistingSelector(m.index, sector.ID, storiface.FTSealed|storiface.FTCache, true) log.Debugf("will schedule unseal for sector %d", sector.ID) - err = m.sched.Schedule(ctx, sector, sealtasks.TTUnseal, selector, sealFetch, func(ctx context.Context, w Worker) error { + err = m.sched.Schedule(ctx, sector, sealtasks.TTUnseal, selector, unsealFetch, func(ctx context.Context, w Worker) error { // TODO: make restartable // NOTE: we're unsealing the whole sector here as with SDR we can't really diff --git a/storage/sealer/worker_local.go b/storage/sealer/worker_local.go index 63358e29c..cc4a81599 100644 --- a/storage/sealer/worker_local.go +++ b/storage/sealer/worker_local.go @@ -575,7 +575,7 @@ func (l *LocalWorker) UnsealPiece(ctx context.Context, sector storiface.SectorRe return nil, xerrors.Errorf("unsealing sector: %w", err) } - // todo move unsealed to long term storage (IN MANAGER< NOT HERE!!) + // note: the unsealed file is moved to long-term storage in Manager.SectorsUnsealPiece storageTypes := []storiface.SectorFileType{storiface.FTSealed, storiface.FTCache, storiface.FTUpdate, storiface.FTUpdateCache} for _, fileType := range storageTypes {