fix(knowledge): index the connector tombstone check so a sync stops scanning the whole document table - #8122
Conversation
…canning the whole document table
|
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 4 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 4 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
document (connector_id) WHERE archived_at IS NULL AND (deleted_at IS NOT NULL OR content_hash IS NULL), the exact predicate of the connector sync's tombstone checkSELECT id … LIMIT 1on every connector sync; the planner estimates thousands of matches and picks a sequential scan expecting to stop early, so a connector with no tombstoned documents reads the entire document table on every sync. Under I/O pressure that statement hits the 60 s statement timeout, the sync fails with SQLSTATE 57014, and ten such failures disable the connectorType of Change
Testing
bun run check:migrations origin/stagingpassesChecklist