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: sealing pipeline: Clear CreationTime when starting sector upgrade #9642

Merged
merged 2 commits into from
Nov 14, 2022

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Nov 14, 2022

Related Issues

Fixes #9478

Proposed Changes

Clear sector.CreationTime when starting sector upgrade

Additional Info

The sector state has a CreationTime field which holds the time of the first AddPiece performed on a sector.

Initially when a sector is created, this field will be 0, but after the first deal is inserted into the sector, we set that field to now.

If the sector isn't 100% full after AddPiece, it will return to WaitDeals to wait for more date, and use CreationTime+WaitDealsDelay to decide how long to wait for:

  • This is fine for new sectors because they have just been created
  • This is also fine for SnapDeals on CC sectors
  • But it is not fine when doing SnapDeals on a sector which previously accepted deal data, for example aborted SnapDeals sector - because CreationTime was already set on it, we may have assigned some deals to the sector, entered SnapDealsWaitDeals, and looked at CreationTime, which was already there, set to some old value, and immediately went to Packing - which lost all assigned deals, and failed the upgrade because the sector had no deals..

The fix is to simply clear CreationTime when starting sector upgrade.

Example input logs when that happened:

2022-11-11T17:56:29.748+0100	INFO	sectors	pipeline/input.go:279	Adding piece for deal 15xxxxxx (publish msg: bafy2....)
2022-11-11T17:56:29.751+0100	DEBUG	sectors	pipeline/input.go:477	updateInput matching	{"matches": 0, "toAssign": 3, "openSectors": 0, "pieces": 3}
2022-11-11T17:56:29.751+0100	DEBUG	sectors	pipeline/input.go:512	updateInput matching done	{"matches": 0, "toAssign": 3, "assigned": 0, "openSectors": 0, "pieces": 3}
2022-11-11T17:56:29.751+0100	ERROR	sectors	pipeline/input.go:515	we are trying to create a new sector with open sectors map[]
2022-11-11T17:56:29.751+0100	INFO	sectors	pipeline/input.go:699	new deal sector decision	{"sealing": 0, "maxSeal": 0, "maxUpgrade": 0, "preferNew": false, "canCreate": true, "canUpgrade": true, "shouldUpgrade": true}
2022-11-11T17:56:29.758+0100	INFO	sectors	pipeline/input.go:645	Upgrading sector	{"number": "2000", "type": "deal", "proofType": 8, "expiration": "38xxxxx", "pledge": "0.26.. FIL"}
2022-11-11T17:56:29.761+0100	INFO	sectors	pipeline/input.go:145	starting to seal deal sector	{"sector": "2000", "trigger": "wait-timeout"}

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@magik6k magik6k requested a review from a team as a code owner November 14, 2022 17:43
@magik6k magik6k force-pushed the fix/snapsector-clear-ctime branch from 97d4599 to efe2d8d Compare November 14, 2022 17:46
Copy link
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most excellente!

@magik6k magik6k merged commit 51e92c9 into master Nov 14, 2022
@magik6k magik6k deleted the fix/snapsector-clear-ctime branch November 14, 2022 19:52
@Shekelme
Copy link

I still can't seal the snap-deal into Available sector with 1.19.0-rc2.
2022-12-12T18:19:48.823+0700 ERROR sectors pipeline/input.go:581 we are trying to create a new sector with open sectors map[{8240 1192}:0xc011321680 {8240 1194}:0xc010881860]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snaping sectors fail with error "got error event sealing.SectorAbortUpgrade: sector had no deals"
4 participants