Fix the bug of SectorRetryFinalize dead loop after SubmitCommitAggregate while FinalizeEarly is true #6651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
with FinalizeEarly set to true:
Before SubmitCommitAggregate and everything is find and sectors were finalized:
Also the data were all downloaded to the final storage server and all the sectors were on state SubmitCommitAggregate:
After SubmitCommitAggregate by force publish and the sectors state keep firing the following state changes:
since the sectors were deleted before the SubmitCommitAggregate finalize call and the call to Finalize now will fire SectorFinalizeFailed CUZ of sector not found, it then fire FinalizeFailed and enter the following SectorRetryFinalize dead loop.
BUG: it keeps retrying finalize sectors and the sectors state will always be FinalizedFailed.
About this PR:
1, Add handleCommitFinalizeSector to handler the commit finalize and it keeps retry until the finalize finished.
2, Ignore the finalize failed during handleFinalizeSector if cfg.FinalizeEarly is true since the commit finalize will handle this situation, the second call of finalize will return update the sector state to proving (For FinalizeEarly is set to true and ignore finalize retry).
3, everything as usual if cfg.FinalizeEarly is set to false.
now second calling of finalize failed:
And all sectors state were updated to Proving: