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: post: restrict recoveries per deadline #9111

Merged
merged 2 commits into from
Aug 2, 2022

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Aug 2, 2022

Related Issues

#9106 only enforced the limit when examining a new partition for recoveries -- if the number of faults in a single partition was greater than the limit (the case we're interested in), it would just add all the faults anyway.

Proposed Changes

Enforce the limit strictly -- we should never go over the limit now, and instead will trim a recovery bitfield for only those sectors that can still fit.

Additional Info

Please review this PR carefully, its impact is high!

Checklist

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

  • All commits have a clear commit message.
  • The 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, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@arajasek arajasek requested a review from a team as a code owner August 2, 2022 16:32
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Looks good, I'm not sure if I see any other way in which this can be broken

I guess it shouldn't be that hard to repurpose one of wdpost itests to test this (set the env var, see limited recovery), so that may be nice to do


log.Warnf("only adding %d sectors to respect recoveringSectorLimit %d", maxNewRecoverable, recoveringSectorLimit)

recovered = bitfield.NewFromSet(recoverySlice[0:maxNewRecoverable])
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically that 0 isn't needed

Suggested change
recovered = bitfield.NewFromSet(recoverySlice[0:maxNewRecoverable])
recovered = bitfield.NewFromSet(recoverySlice[:maxNewRecoverable])

@jennijuju
Copy link
Member

in support of a test

@arajasek arajasek enabled auto-merge August 2, 2022 19:29
@arajasek arajasek merged commit c0d2f24 into master Aug 2, 2022
@arajasek arajasek deleted the asr/fix-rec-setcor-limit branch August 2, 2022 19:44
@arajasek arajasek mentioned this pull request Aug 2, 2022
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.

3 participants