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

Skip shrink until startup verification is complete #34209

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

brooksprumo
Copy link
Contributor

Problem

Please refer to #34180.

Summary of Changes

Skip 'shrink' until after startup verification has completed.

This implementation was chosen instead of getting all the snapshot storages as passing them into verify_accounts_hash() so that the fix would be the least invasive. As this will be more of an issue once IncrementalAccountsHash is enabled (because we do two accounts hash calculations at startup), we want to backport this fix all the way to v1.16, and thus a minimal PR is preferred.

Skipping shrink until the startup verification is complete is also safe. We used to pause everything until startup verification was complete, so reigning in one thing should be fine. (Note this will not affect correctness of the foreground transaction processing at all.)

Fixes #34180

@brooksprumo brooksprumo added v1.16 PRs that should be backported to v1.16 v1.17 PRs that should be backported to v1.17 labels Nov 22, 2023
@brooksprumo brooksprumo self-assigned this Nov 22, 2023
Copy link
Contributor

mergify bot commented Nov 22, 2023

Backports to the stable branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule.

Copy link
Contributor

mergify bot commented Nov 22, 2023

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #34209 (e68535f) into master (53c723a) will decrease coverage by 0.1%.
Report is 1 commits behind head on master.
The diff coverage is 25.0%.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34209     +/-   ##
=========================================
- Coverage    81.9%    81.9%   -0.1%     
=========================================
  Files         819      819             
  Lines      219425   219427      +2     
=========================================
- Hits       179854   179842     -12     
- Misses      39571    39585     +14     

@brooksprumo brooksprumo marked this pull request as ready for review November 23, 2023 12:50
Copy link
Contributor

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

lgtm

bank.shrink_ancient_slots();
// See justification below for why we skip 'shrink' here.
if bank.is_startup_verification_complete() {
bank.shrink_ancient_slots();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can we add a log when we skip shrink due to startup verification?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this may cause lots of messages in the log. Let me test it out and report back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to merge this PR for now so that the backports can get started. I'll make sure to test out how logs look, and then open up a PR as needed.

Copy link
Contributor

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

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

lgtm. ty

@brooksprumo brooksprumo merged commit da9fad8 into solana-labs:master Nov 27, 2023
34 checks passed
@brooksprumo brooksprumo deleted the iah/no-shrink branch November 27, 2023 15:57
mergify bot pushed a commit that referenced this pull request Nov 27, 2023
(cherry picked from commit da9fad8)

# Conflicts:
#	runtime/src/accounts_background_service.rs
mergify bot pushed a commit that referenced this pull request Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.16 PRs that should be backported to v1.16 v1.17 PRs that should be backported to v1.17
Projects
Development

Successfully merging this pull request may close these issues.

Initial accounts hash verification panics if shrink is in progress
3 participants