Repository navigation
Conversation
carte7000
force-pushed
the
feat/indexer/replica/work-state
branch
from
November 23, 2026 20:00
8b82bce to
8db2592
Compare
carte7000
marked this pull request as ready for review
November 23, 2026 20:56
tt-cll
previously approved these changes
Nov 23, 2026
HelloKashif
reviewed
Nov 24, 2026
Comment on lines
+64
to
+68
| ClaimWork(ctx context.Context, limit int, lease, window time.Duration) ([]WorkClaim, error) | ||
| // SettleWork ends one attempt while the claim is held; it returns ErrClaimLost when it is not. | ||
| SettleWork(ctx context.Context, s WorkSettlement) (MessageStatus, error) | ||
| // ExpireWork times out up to limit PROCESSING messages that are not leased and are past their deadline. | ||
| ExpireWork(ctx context.Context, window time.Duration, limit int) (int64, error) |
Contributor
There was a problem hiding this comment.
Is applying a window change to in-flight messages a requirement? Why not also store each message's deadline in the table? If we stamp retry_deadline at insert it would avoid replicas/the replay CLI disagreeing during config rollouts and stop --force from moving deadlines.
Add attempt_count, next_attempt_at, retry_deadline and trace_parent to indexer.messages, and a partial index on the due PROCESSING rows. Add ClaimWork, SettleWork, ExpireWork and CountProcessingMessages to IndexerStorage. A claim leases due rows with FOR UPDATE SKIP LOCKED and increments attempt_count, which is the claim token. A settle changes the row only while the token matches. Postgres decides the deadline with its own clock. The message insert writes trace_parent. PersistDiscoveryBatch calls an optional callback after a commit with messages. Add the indexer_worker_queue_size gauge. Nothing calls the new methods yet, so the worker does not change. An EXPLAIN test writes the plan of each query to testdata. The index build blocks writes to indexer.messages.
carte7000
force-pushed
the
feat/indexer/replica/work-state
branch
from
November 24, 2026 19:09
8db2592 to
99daee3
Compare
Contributor
|
Code coverage report:
Files added (in
|
tt-cll
approved these changes
Nov 24, 2026
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.
Add attempt_count, next_attempt_at, retry_deadline and trace_parent to indexer.messages, and a partial index on the due PROCESSING rows.
Add ClaimWork, SettleWork, ExpireWork and CountProcessingMessages to IndexerStorage. A claim leases due rows with FOR UPDATE SKIP LOCKED and increments attempt_count, which is the claim token. A settle changes the row only while the token matches. Postgres decides the deadline with its own clock.
The message insert writes trace_parent. PersistDiscoveryBatch calls an optional callback after a commit with messages. Add the indexer_worker_queue_size gauge.
Nothing calls the new methods yet, so the worker does not change. An EXPLAIN test writes the plan of each query to testdata.
The index build blocks writes to indexer.messages.