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

retryable_indexes allocated and dropped by scheduler #4157

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

Conversation

apfitzge
Copy link

Problem

  • Communication pattern between the scheduler and worker thread allocations is a bit off.
  • Currently, the scheduler sends a ConsumeWork and the workers respond with FinishedConsumeWork which holds an additional Vec<usize> representing the retryable transactions
  • This leads to the worker threads consistently allocating vectors that are then dropped by the scheduler thread

Summary of Changes

  • Pre-allocate retryable_indexes on work message which is then populated by the workers and returned for inspection/deallocation by the scheduler thread

Fixes #

@apfitzge apfitzge self-assigned this Dec 17, 2024
Comment on lines +118 to +125
// Copy retryable indexes back to return message
work.retryable_indexes.extend(
output
.execute_and_commit_transactions_output
.retryable_transaction_indexes
.iter()
.cloned(),
);
Copy link
Author

Choose a reason for hiding this comment

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

Copying the indexes here - possible to improve further by allowing the consumer to fill this in directly. But for now this PR just gets rid of the wonky allocation/deallocation pattern

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.

1 participant