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

catchup: make unsupported block handling more deterministic #5673

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

zeldovich
Copy link
Contributor

The catchup code had a race where, upon seeing an unsupported block in the future, the catchup logic would cancel the current pipeline of block fetches. Depending on the timing, this might either make some progress or not fetch any blocks at all.

The new logic is more deterministic: it tries to always fetch all blocks up until the last supported block, and when the ledger reaches the last supported block, the catchup service stops.

The catchup code had a race where, upon seeing an unsupported block
in the future, the catchup logic would cancel the current pipeline of
block fetches.  Depending on the timing, this might either make some
progress or not fetch any blocks at all.

The new logic is more deterministic: it tries to always fetch all blocks
up until the last supported block, and when the ledger reaches the last
supported block, the catchup service stops.
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #5673 (a73ebaa) into master (bf60d55) will increase coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 86.11%.

@@            Coverage Diff             @@
##           master    #5673      +/-   ##
==========================================
+ Coverage   55.15%   55.16%   +0.01%     
==========================================
  Files         465      465              
  Lines       65003    65011       +8     
==========================================
+ Hits        35850    35862      +12     
- Misses      26760    26761       +1     
+ Partials     2393     2388       -5     
Files Changed Coverage Δ
catchup/service.go 71.33% <86.11%> (+0.30%) ⬆️

... and 8 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

algorandskiy
algorandskiy previously approved these changes Aug 16, 2023
Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

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

This is a welcome fix. However, I share @algorandskiy 's concern.
I have a suggestion to trigger the monitor only after an unsupported is detected.
I have a draft for this here.

@zeldovich
Copy link
Contributor Author

Fair enough.

How about the change I just pushed, to start the unsupportedRoundMonitor only after we see some unsupported block?

Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

Good

@algorandskiy
Copy link
Contributor

the GH-CI integration stuck, closing and reopening to retrigger.

Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

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

Very nice.

@algorandskiy algorandskiy merged commit 53fc1ba into algorand:master Aug 17, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants