Repository navigation
Conversation
psteinroe
force-pushed
the
perf/group-backlog-claim
branch
from
October 2, 2026 23:04
e045a8a to
a9bec83
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents a known limitation of
groupConcurrency. A claim skips the pending executions of full groups one by one in claim order, so a very large backlog in one group slows every claim of that task until it drains. With 100k pending rows in one full group, every claim reads all of them to find 10 claimable rows in other groups (about 48 ms instead of 0.5 ms). pg-boss #842 hit the same issue. The note recommends spreading bulk work across groups or moving it to a separate task or queue.What was tried and why it was dropped
The first version of this PR fixed the claim. When full groups held a large backlog ahead of the batch, the claim walked the task's groups and took the head of each open group. It was rejected as too costly:
groupConcurrency: 1under load, the checks would run on nearly every grouped claim.No simpler approach meets the constraints (no regression in the common scenarios, no index covering ungrouped rows, no thresholds, a small diff):
"group"toget_task_executions. This would let full-group rows be rejected inside the index, but it changes an index over every row. The scan also stays proportional to the backlog and still fetches each heap row, becausequeueandis_availableare evaluated as heap filters.A real fix probably needs per-group state, for example keeping only each group's head claimable. That is a larger design change than this PR.