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: sealing: More complete snapdeals abort cleanup #9648
Conversation
8729c91
to
201e59a
Compare
if err := m.sealer.ReleaseUnsealed(ctx.Context(), m.minerSector(sector.SectorType, sector.SectorNumber), []storiface.Range{}); err != nil { | ||
log.Error(err) | ||
} | ||
|
||
if err := m.sealer.ReleaseUnsealed(ctx.Context(), m.minerSector(sector.SectorType, sector.SectorNumber), sector.keepUnsealedRanges(sector.CCPieces, true, cfg.AlwaysKeepUnsealedCopy)); err != nil { | ||
// and makes sure sealed/cache files only exist in long-term-storage | ||
if err := m.sealer.FinalizeSector(ctx.Context(), m.minerSector(sector.SectorType, sector.SectorNumber)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main fix - we weren't cleaning up sealed/cache files at all, and we were passing ranges to keep to ReleaseUnsealed.
201e59a
to
114c1f7
Compare
114c1f7
to
54ae345
Compare
if moveUnsealed != storiface.FTNone && len(keepUnsealed) != 0 { | ||
err = multierr.Append(err, move(moveUnsealed)) | ||
|
||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is there a code block here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just enclosing sealedStores in a tighter scope so it's easier to tell that it's not used anywhere below; basically just a code style thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it important that those are not used below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not important outside making it easier to see where variables are used
storage/sealer/sealtasks/task.go
Outdated
@@ -67,7 +69,8 @@ var shortNames = map[TaskType]string{ | |||
TTCommit1: "C1", | |||
TTCommit2: "C2", | |||
|
|||
TTFinalize: "FIN", | |||
TTFinalize: "FIN", | |||
TTReleaseUnsealed: "FUS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with FUS (to mean FinalizeUnsealed), to be consistent with other finalization-related short names; Tho I guess the task should be called FinalizeUnsealed in that case..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed but kept some other ReleaseUnsealed in less visible places to avoid breaking the API too much; This code will realistically all get replaced when the new scheduler comes, so just a non-confusing UX is probably good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally we should keep the names of the API and tasks consistent considering thats the pattern followed for others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to change the already existing method on the miner api - ReturnReleaseUnsealed was already there; This has the subtle side effect of making lotus-miner technically forward-compatible with workers (e.g. if you downgrade lotus-miner when you have newer versions of workers still running, and trying to return ReleaseUnsealed those results will get recorded correctly)
tbh it doesn't matter that much, just felt like the right approach.
0b5ab12
to
ea9a830
Compare
itests/worker_upgrade_test.go
Outdated
case id == wpaths[0].ID: // worker path | ||
if workers != storiface.FTNone { | ||
require.Len(t, decls, 1) | ||
require.EqualValues(t, decls[0].SectorFileType.Strings(), workers.Strings()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected and actual args are reversed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that's a nitpick :p
Good stuff! Will let you know if we run into it again with this fix. |
Related Issues
Will fix #8491
Might fix:
Proposed Changes
Additional Info
This PR changes some worker APIs, so it bumps the worker API version - IT REQUIRES UPDATING BOTH
lotus-miner
ANDlotus-worker
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps