Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unseal: check if sealed/update sector exists #10639

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions storage/sealer/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down