fix(partition-keys): make claims nonblocking - #321
Conversation
NikolayS
left a comment
There was a problem hiding this comment.
REV rubric review
This is a manual execution of the repository's five applicable REV rubrics because the automated ultrareview quota was unavailable. It is not bot output. SOC2 was omitted.
- Bug/security:
SKIP LOCKEDplus the existence check distinguishes busy from absent slots without blocking; no additional defect found. - Tests: the real two-session contender, expiry, epoch, and finite-TTL paths are adequate; CI is 17/17 green. Initial RED is retrospective.
- Docs/guidelines: final shell hardening adds the required safe IFS and reproducible psql form. The historical
style:commit conflicts with the repo-specific type list.
Blocking patch findings: none. Merge-order constraint: this PR is stacked on #311 and must merge after it; rerun combined checks if the parent head changes. Exact real-user two-session evidence remains required. This COMMENT review is not an approval.
|
Real-user verification evidence for head I installed the stacked head into a fresh disposable database, then ran the real multi-backend harness: PAGER=cat psql --no-psqlrc "$PGQUE_TEST_DSN" --set=ON_ERROR_STOP=1 \
--file=devel/sql/pgque.sql
PGQUE_TEST_DSN="$PGQUE_TEST_DSN" tests/two_session_slot_claim.sh
bash -n tests/two_session_slot_claim.sh
shellcheck tests/two_session_slot_claim.sh
bash build/transform.sh
git diff --checkAgainst the parent behavior, the contender hit the harness timeout while waiting on an uncommitted slot-row lock: Against this head, the contender returned The harness uses distinct RED/GREEN chronology: retrospective for the SQL behavior. The nonblocking implementation and regression were not published as separate test-first RED and GREEN commits. I independently replayed the harness on the parent to confirm RED and on this head to confirm GREEN. The later harness-only hardening did not alter the SQL behavior. Full CI: 17/17 checks passed. This comment records test evidence only; it is not a review or merge decision. |
Stack
This PR is intentionally stacked on #311 because both changes touch the partition lease implementation. Review only the commit above
agent/fix-partition-lease-boundary.What changed
claim_slot;NULLwhen another transaction currently owns the slot row, allowing a first-free scan to continue;Why
The API contract says a busy claim returns
NULL; it previously blocked onSELECT ... FOR UPDATE. A slow claim/renew/receive transaction could therefore head-of-line-block a worker scanning for any free slot.Fixes #309.
Validation
Red evidence on the parent/current behavior:
Green checks:
NULLbehind an uncommitted lease row, existing lease-expiry/epoch recovery still passes;bash build/transform.sh;git diff --check.This is intentionally a draft and has not been merged.