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

Carry over buffered tasks across BP sessions #5169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryoqun
Copy link
Collaborator

@ryoqun ryoqun commented Mar 6, 2025

Problem

because leader scheduler is grouped by 4 consecutive slots, special treatment is needed for very efficient hangover across banks.

Summary of Changes

Now that #4949 has landed, it's now possible for the (singleton) block production unified scheduler to carry over buffered tasks to next bank (= session) seamlessly with customized session switching conditions.

also note that there should be no functional change to block verification scheduler behavior.

extracted from #3946

@ryoqun ryoqun requested a review from apfitzge March 6, 2025 13:42
@@ -1487,7 +1548,9 @@ impl<S: SpawnableScheduler<TH>, TH: TaskHandler> ThreadManager<S, TH> {
session_result_sender
.send(result_with_timings)
.expect("always outlived receiver");
state_machine.reinitialize();
if matches!(scheduling_mode, BlockVerification) {
state_machine.reinitialize();
Copy link
Collaborator Author

@ryoqun ryoqun Mar 6, 2025

Choose a reason for hiding this comment

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

so, state_machine won't be reinitialize()-d for BlockProduction anymore. along with this, proper (Tasks-related) oom mitigation will be addressed by later pr, while that concern is temporarily becoming more prominent as of this pr.

@@ -3014,17 +3082,53 @@ mod tests {
let bank = Bank::new_for_tests(&genesis_config);
let (bank, _bank_forks) = setup_dummy_fork_graph(bank);
let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64));
let pool = SchedulerPool::<PooledScheduler<StallingHandler>, _>::new_dyn(
let pool = SchedulerPool::<PooledScheduler<StallingHandler>, _>::new(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

needed to call .register_banking_stage(), which is outside the dyn trait definition.

@ryoqun ryoqun force-pushed the cross-session-carry-over branch from ede407c to 9b3163f Compare March 6, 2025 13:56
@ryoqun ryoqun force-pushed the cross-session-carry-over branch from 9b3163f to 1851179 Compare March 6, 2025 14:02
@apfitzge
Copy link

apfitzge commented Mar 6, 2025

@ryoqun, you may want to rebase on master to pick this up: #5160. I see you're hitting the flaky tests that were recently fixed.

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.

2 participants