Repository navigation
feat(worker): configurable queue-storage prune lock timeout and prune outcome metrics #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2f4fddc
72bd415
96a8d50
50b8ddd
2be1f71
986a7d1
0d74275
b09306c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -930,6 +930,7 @@ async def start( | |
| queue_storage_queue_rotate_interval_ms: int = 1000, | ||
| queue_storage_lease_rotate_interval_ms: int = 250, | ||
| queue_storage_claim_rotate_interval_ms: int | None = None, | ||
| queue_storage_prune_lock_timeout_ms: int | None = None, | ||
| queue_storage_rotate_min_slot_age_ms: int | None = None, | ||
| queue_storage_rotate_target_slot_bytes: int | None = None, | ||
| queue_storage_rotate_min_slot_rows: int | None = None, | ||
|
|
@@ -967,6 +968,18 @@ async def start( | |
| counters. Exact reads include pending deltas, so the default favors | ||
| fewer hot counter updates over immediate folding. | ||
|
|
||
| ``queue_storage_prune_lock_timeout_ms`` sets the PostgreSQL | ||
| ``lock_timeout`` the maintenance leader uses when pruning the queue, | ||
| lease and claim rings (default 10 ms). Each lock acquisition gets its | ||
| own timeout; this does not bound the whole prune. Among queue prune's | ||
|
Comment on lines
+973
to
+974
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify which locks use the configured timeout. The prune functions acquire slot-row locks before setting this timeout. A blocked slot-row lock can therefore wait indefinitely under PostgreSQL’s default timeout settings. Qualify the scope so operators do not assume every prune lock is bounded. (raw.githubusercontent.com)
|
||
| initial partition locks, only ``ready_segments`` waits; the others use | ||
| ``NOWAIT``. Later reads and writes also run under the timeout. A lock | ||
| timeout rolls back the prune and counts it as ``blocked``; the | ||
| maintenance loop retries on a later tick. Raise it when ``blocked`` | ||
| outcomes persist, keeping it well below the server's | ||
| ``deadlock_timeout`` and ``statement_timeout`` (a warning is logged at | ||
| start otherwise). Must be > 0. | ||
|
|
||
| Queue dicts also accept ``claimers`` and ``claim_batch_size`` for hot | ||
| queue-storage queues. ``claimers`` adds dispatcher/claimer loops that | ||
| share the queue's worker permits; benchmark ``2`` or ``4`` before | ||
|
|
@@ -996,6 +1009,7 @@ async def start( | |
| queue_storage_queue_rotate_interval_ms=queue_storage_queue_rotate_interval_ms, | ||
| queue_storage_lease_rotate_interval_ms=queue_storage_lease_rotate_interval_ms, | ||
| queue_storage_claim_rotate_interval_ms=queue_storage_claim_rotate_interval_ms, | ||
| queue_storage_prune_lock_timeout_ms=queue_storage_prune_lock_timeout_ms, | ||
| queue_storage_rotate_min_slot_age_ms=queue_storage_rotate_min_slot_age_ms, | ||
| queue_storage_rotate_target_slot_bytes=queue_storage_rotate_target_slot_bytes, | ||
| queue_storage_rotate_min_slot_rows=queue_storage_rotate_min_slot_rows, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an operator supplies a timeout above PostgreSQL's maximum
lock_timeout(2,147,483,647 ms, such asDuration::from_secs(30 * 24 * 60 * 60)), this validation accepts it, whileset_prune_lock_timeout_txformats the much larger value andset_configfails at runtime. Consequently every ring prune and terminal-delta rollup returns an error instead of recycling storage; reject values above PostgreSQL's supported range during configuration rather than allowing the client to build.Useful? React with 👍 / 👎.