Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball committed May 2, 2022
1 parent 98637b3 commit 2134f16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions extern/sector-storage/ffiwrapper/sealer_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ func (sb *Sealer) tryDecodeUpdatedReplica(ctx context.Context, sector storage.Se
}
defer done()

sealedPaths, releaseSectorKey, err := sb.AcquireSectorKeyOrRegenerate(ctx, sector, randomness)
sealedPaths, done2, err := sb.AcquireSectorKeyOrRegenerate(ctx, sector, randomness)
if err != nil {
return false, xerrors.Errorf("acquiring sealed sector: %w", err)
}
defer releaseSectorKey()
defer done2()

// Sector data stored in replica update
updateProof, err := sector.ProofType.RegisteredUpdateProof()
Expand Down
14 changes: 9 additions & 5 deletions extern/sector-storage/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,15 @@ 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 {
_, err2 := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTUpdate|storiface.FTUpdateCache, storiface.PathSealing, storiface.AcquireCopy))
if err2 != nil {
return xerrors.Errorf("copy sealed/cache sector data: %w %w", err, err2)
}
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 nil
Expand Down

0 comments on commit 2134f16

Please sign in to comment.