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

feat: sealing: load SectorsSummary from sealing SectorStats instead of calling API each time #11353

Merged

Conversation

FlorianRuen
Copy link
Contributor

@FlorianRuen FlorianRuen commented Oct 25, 2023

Related Issues

filecoin-project/boost#1733
filecoin-project/boost#1747
(summary of these issues is available in Additional Info below)

Proposed Changes

Based on the discussions in the two issues mentioned above, and initial issue by @ze42 and @cryptowhizzard, I propose to retrieve the information from the stats (prometheus) rather than from the API.

This PR was quickly discussed by @s0nik42 with @magik6k, and here is a list of changes mades:

  • Create a method in Sealing called SectorsSummary in order to return the stats by states available in SectorStats
  • Update the SectorsSummary method in StorageMinerAPI, to use the previous method. This allows to return the result more quickly (already updated with each state modification), and to avoid recalculating it from the list of sectors each time.

Additional Info

This is a quick summary to explain the why and why of this change

  1. I provide this change, because @cryptowhizzard report a boost issue when receiving 200+ online deals.
  2. After some investigations, the problem is caused by the deal filter, that need to compute a lot of info = massive delays.
  3. Going deeper into the deal filter code, the call that causes this delay is SectorsSummary, that will fill the proposal SealingPipelineState.SectorStates, because it iterates over all sectors to compute the states
  4. This call can be very slow, espececially on 30 PB+ like @cryptowhizzard
  5. But the sector states are already available in Prometheus, each time a sector is updated
  6. This change proposes to get them directly from Prometheus, in order to drastically reduce the delays

Once this is done, our wish with CIDgravity is to add information in the proposal, information available on boost directly (checkpoints, see issue #1747 here)

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
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@FlorianRuen FlorianRuen requested a review from a team as a code owner October 25, 2023 17:13
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.

Sorry for taking so long to get to this. Also thanks for the PR!

One thing to address, the current version can make lotus-miner crash occasionally.

storage/pipeline/sealing.go Outdated Show resolved Hide resolved
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.

Thanks for the PR!

@magik6k magik6k merged commit b243c40 into filecoin-project:master Nov 7, 2023
87 checks passed
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.

None yet

2 participants