-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
complete -> apply.
Plan queue apply overlaps plan verification with plan application to increase throughput
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. |
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).