improvement(knowledge): scan processing recovery per connector and prune finished outbox events - #8330
Conversation
…une finished outbox events
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Fix all with cubic | Re-trigger cubic
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 11 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
Summary
(uploaded_at, id)recovery index, joining each document to its knowledge base and connector, and rejecting it only afterwards. Retained inputs of paused or dormant sources sit at the front of that order, so every call read through all of them first. Follow-up batches (NOT INattempted connectors) walked the same range againdoc_connector_processing_recovery_idx (connector_id, uploaded_at, id)with aCROSS JOIN LATERAL, then takes the oldest overall. Paused sources cost nothing. Batch size, the follow-up batches for refused connectors, blocked knowledge bases, the lock-time recheck, and liveness are unchanged, so recovery picks the same candidates as beforedoc_processing_recovery_idxstays for now and is dropped in a later contract migrationoutbox_eventnever deleted completed rows. The outbox processor now prunescompletedrows older than 7 days in bounded,SKIP LOCKEDbatches, only forknowledge.document.processing.recoverandknowledge.document.storage.cleanup. Both have random ids, and nothing reads their completed rows. Every other event type is kept, including idempotency-keyed ones and the checkpoint expiry events, whose completed rows are read back by id, as are pending, processing, and dead-letter rowsType of Change
Testing
stored-document-recovery.integration.ts:retention.integration.ts: deletes only old completed allowlisted rows and drains past one batch. Removing the status, age, or type filter, or the batch loop, turns it redcheck:migrations origin/stagingpassescheck:audits, and the recovery, outbox, and document unit suites passChecklist