Skip to content

Fix admin reads of claims in larger installed claim rings (0.6) - #688

Merged
hardbyte merged 2 commits into
release/0.6.6from
brian/admin-installed-claim-slots-0.6
Nov 8, 2026
Merged

hardbyte merged 2 commits into
release/0.6.6from
brian/admin-installed-claim-slots-0.6

Conversation

@hardbyte

@hardbyte hardbyte commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Admin job lists and kind counts open the active queue-storage schema with the default configuration, so they carry the default claim slot count (8). queue_storage_populated_claim_slots rejected any populated claim slot at or above that count, so on a schema installed with a larger claim ring, lists and kind counts failed with invalid physical claim slot N even though the partition exists.

Take the non-negative slot numbers read from stored rows as installed, using the ring_slot_number helper that #665 introduced for ready slots. This is the change the main forward-port (#687) already carries. No new queries, locks or schema changes.

Other slot bounds checked

admin.rs has no other configured-count bound on stored slot numbers. In queue_storage.rs, the remaining claim-slot bounds are runtime and maintenance paths that use the writer's own configuration, so this PR leaves them alone:

  • complete_receipt_runtime_batch_fast validates each claim's slot against the configured claim_slot_count.
  • Receipt rescue (rescue_stale_receipt_claims_tx, rescue_expired_receipt_deadlines_tx) iterates 0..claim_slot_count, and oldest_initialized_claim_slot_tx filters by it.

They would only miss or reject higher slots on a runtime configured with fewer claim slots than are installed. None of the schema-only callers (admin, DLQ, reschedule, batch operations, awa storage rebuild-terminal-counters) reach them.

Validation

  • New test_schema_only_admin_reads_claims_in_installed_slot installs a claim ring two slots larger than the default, rotates claims into slot 8, claims a job there, then lists running jobs and kind counts through the admin API's schema-only store. Before the fix it fails on PostgreSQL 17 and 18 with Validation("invalid physical claim slot 8"). After the fix it passes on both, as do the three test_receipt_admin_scope_* cases.
  • cargo fmt --all, cargo clippy --all-targets --all-features -- -D warnings and cargo build --workspace pass.

Admin job lists and kind counts open the active queue-storage schema
with the default configuration, so they carry the default claim slot
count. Populated claim slots read from the database were rejected when
at or above that count, failing lists and kind counts with
"invalid physical claim slot N" on a schema installed with a larger
claim ring, even though the partition exists.

Take the non-negative slot numbers read from stored rows as installed,
as is already done for ready slots.
@hardbyte hardbyte added the full-ci Run the full CI matrix (Python build+test, E2E) on this PR label Nov 8, 2026
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 38cf0dae-3fd2-4b22-8035-4f943b7d6657

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hardbyte
hardbyte marked this pull request as ready for review November 8, 2026 10:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T10:03:50.244388Z d6ee3a8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…min-installed-claim-slots-0.6

# Conflicts:
#	CHANGELOG.md
@hardbyte
hardbyte merged commit 8429aae into release/0.6.6 Nov 8, 2026
60 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run the full CI matrix (Python build+test, E2E) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant