fix(knowledge): release kept connector documents in the background so removing a large source cannot time out - #8165
Conversation
… removing a large source cannot time out
|
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 26 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
|
…it when the release finishes
|
@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.
All reported issues were addressed across 28 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
…use credentials to removed connectors
|
@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 31 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
|
@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 32 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
ON DELETE SET NULLnulledconnector_idon every document, andprojection_source_acl_syncthen rewrote every enabled chunk inembedding_searchandembedding_keyword_tin. Those rows are indexed onconnector_id, so none of the updates could be HOT; each one re-inserted into every index. All of it had to finish inside the 10 sstatement_timeoutdetached_at, disables both syncs, and queues aknowledge.connector.detachoutbox event. The request writes no documentremoveDrainedConnector, which is shared with the deletion workerconnectorIsLive()now also requiresdetached_at IS NULL. A detached connector can't be synced, listed, updated, or removed again, while document visibility still checks onlyarchived_at/deleted_at, so kept documents stay readable and searchable throughoutFOR UPDATEtoFOR SHARE.FOR UPDATEconflicted with theFOR KEY SHAREthat every in-flight document and chunk write holds, so even small sources could fail the 5 slock_timeoutactivedetached_atcolumn: additive, no default, metadata-onlyType of Change
Testing
search-source-progressandstorage-accountingpass. Two failures remain locally (confluence-enrollment, the filename-search paging test); both also fail on unmodified staging against the same databasebun run type-check,bun run lint,check:audits(47),check:migrations origin/staging,docs-manifest:checkChecklist