Skip to content

Conversation

@tillrohrmann
Copy link
Contributor

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.

Comment on lines 382 to 387
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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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.

tillrohrmann and others added 4 commits December 2, 2025 12:39
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.
@tillrohrmann tillrohrmann force-pushed the vqueues/fix-eligibility branch from 3edf6ed to 4219335 Compare December 2, 2025 11:52
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