Repository navigation
Fix admin reads of claims in larger installed claim rings (0.6) - #688
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
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_slotsrejected any populated claim slot at or above that count, so on a schema installed with a larger claim ring, lists and kind counts failed withinvalid physical claim slot Neven though the partition exists.Take the non-negative slot numbers read from stored rows as installed, using the
ring_slot_numberhelper that #665 introduced for ready slots. This is the change themainforward-port (#687) already carries. No new queries, locks or schema changes.Other slot bounds checked
admin.rshas no other configured-count bound on stored slot numbers. Inqueue_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_fastvalidates each claim's slot against the configuredclaim_slot_count.rescue_stale_receipt_claims_tx,rescue_expired_receipt_deadlines_tx) iterates0..claim_slot_count, andoldest_initialized_claim_slot_txfilters 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
test_schema_only_admin_reads_claims_in_installed_slotinstalls 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 withValidation("invalid physical claim slot 8"). After the fix it passes on both, as do the threetest_receipt_admin_scope_*cases.cargo fmt --all,cargo clippy --all-targets --all-features -- -D warningsandcargo build --workspacepass.