-
Notifications
You must be signed in to change notification settings - Fork 112
Check for eligibility on every removed item #4070
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
base: main
Are you sure you want to change the base?
Check for eligibility on every removed item #4070
Conversation
crates/vqueues/src/scheduler/drr.rs
Outdated
| qstate.notify_removed(item_hash); | ||
|
|
||
| // if we aren't eligible check whether the removed item has made us eligible | ||
| // again (e.g. by releasing a concurrency token or by removing the head of the | ||
| // queue). | ||
| if !self.eligible.contains(&qid) { |
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.
This seems to overlap with the change in https://github.com/restatedev/restate/pull/4066/files#diff-02cc9fd99c15c55730f0822a024e9d2c6bd7f4f92d3cc2d8c9d030773f1d6f6d
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.
Yes, you are right. Rebasing this PR on #4066.
This commit integrates vqueues with external state mutations. The way it works is by storing the external state mutation in the VQueueItems table until it gets run by the scheduler. When running the state mutation, we retrieve it from the VQueueItems table and apply the state mutation changes. The external state mutation EntryId is currently derived from the internal inbox_seq_number to generate unique EntryId's. In the future we might give external state mutations an explicit id which could be used to derive the EntryId. Currently, the DRR scheduler reserves a concurrency token for running state mutations. We might want to relax this condition if we see that applying state mutations does not need to be protected by the global concurrency limit.
Introduces a small set of cumulative metrics from the vqueue scheduler to help visualize: - The rate of items in scheduler decisions broken down by action - The enqueue rate (in waiting inbox) - Counters for confirmed/rejected items (confirmed items is low signal and we can remove it)
Before, the DRR scheduler checked for eligibility if the current head item was removed. This was not enough since a vqueue might have been not eligible because it was running out of concurrency tokens. A removed item could have released the concurrency token and thereby it could make the vqueue eligible again if the vqueue contains more items. Hence, we should check on every removed item whether this event had an impact on the vqueue's eligibility.
3edf6ed to
4219335
Compare
Before, the DRR scheduler checked for eligibility if the current head item
was removed. This was not enough since a vqueue might have been not eligible
because it was running out of concurrency tokens. A removed item could have
released the concurrency token and thereby it could make the vqueue eligible
again if the vqueue contains more items. Hence, we should check on every
removed item whether this event had an impact on the vqueue's eligibility.
This PR is based on #4059.