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

Plan queue apply overlaps plan verification with plan application to increase throughput #272

Merged
merged 11 commits into from
Oct 12, 2015

Conversation

armon
Copy link
Member

@armon armon commented Oct 12, 2015

The plan apply would previously always do dequeue, verify, apply, respond. This meant that the time spent in apply which is just waiting for a Raft commit would prevent any other verification from happening.

Now, the plan does dequeue and verify, and then does an async apply and respond. While we are waiting for the plan to apply, we optimistically apply the plan to a snapshot of state and begin verifying the next plan. This allows us to overlap the application with the verification to reduce the amount of time spent waiting.

This PR supports only a single level of overlap (apply N, verify N+1), but it can be extended in the future to support K levels of verify-ahead (apply N, verify N+1, ..., verify N+K).

// Naively, we could simply dequeue a plan, verify, apply and then respond.
// However, the plan application is bounded by the Raft apply time and
// subject to some latency. This creates a stall condition, where we are
// not evaluating, but simply waiting for a transaction to complete.
Copy link
Contributor

Choose a reason for hiding this comment

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

complete -> apply.

armon added a commit that referenced this pull request Oct 12, 2015
Plan queue apply overlaps plan verification with plan application to increase throughput
@armon armon merged commit d69ce40 into master Oct 12, 2015
@armon armon deleted the f-apply-overlap branch October 12, 2015 21:35
@github-actions
Copy link

github-actions bot commented May 7, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants