Skip to content

A document waits for one queued extraction - #1554

Open
gedaiu wants to merge 1 commit into
deeplethe:devfrom
re-cinq:fix/one-queued-extraction-1514b
Open

gedaiu wants to merge 1 commit into
deeplethe:devfrom
re-cinq:fix/one-queued-extraction-1514b

Conversation

@gedaiu

@gedaiu gedaiu commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Thank you for the guidance on #1514, it made this much better than what we first ran.

When a document changes while its extraction is still queued, it now folds into that job instead of adding another, since the job reads the chunks when it runs. Following your three points, it folds only into a job that has not been tried yet (attempts = 0), so a new version does not inherit the backoff of a failing one. A unique partial index and ON CONFLICT DO NOTHING enforce it, so two pushes at once cannot both get in. The migration removes the duplicates already queued first and keeps the oldest.

On the memory path I added proposed_by and proposed_token to the index key, with NULL read as empty, so a push by a different person still gets its own job and review credits the right one. The path without a proposer folds as before. If you would rather key on document_id alone and handle the proposer another way, I am happy to change it.

Requeueing failed jobs now skips a failed extraction that already has a waiting twin, and brings back only the oldest of several failed twins, so the bulk requeue cannot trip the new index. The others stay failed with their errors kept.

Closes #1514

Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
@gedaiu

gedaiu commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

@WaylandYang this follows your three points from #1514 and it's green. The one thing I'd love your view on is the proposer fields in the index key. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant