Conversation
…be detected later in the code Signed-off-by: Uroš Marolt <uros@marolt.me>
…be detected later in the code Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
There was a problem hiding this comment.
Pull request overview
Adjusts PCC sync behavior in pcc_sync_worker to avoid Postgres unique-name violations when multiple CDP segments share the same PCC sourceId, by narrowing which insightsProjects rows get updated and by proactively detecting name collisions.
Changes:
- Reworks the
insightsProjectsname-conflict pre-check to align with the global partial unique index on(name) WHERE deletedAt IS NULL. - Scopes the
insightsProjectsUPDATE to the matched subprojectsegmentIdinstead of bulk-updating all segments sharingsourceId.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Signed-off-by: Uroš Marolt <uros@marolt.me>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Uroš Marolt <uros@marolt.me>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Uroš Marolt <uros@marolt.me>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
…rs (#4046) Signed-off-by: Uroš Marolt <uros@marolt.me> Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Note
Medium Risk
Changes matching and write-path behavior in the PCC sync worker and alters how job failures are persisted, which could affect what gets skipped vs upserted and how failures are diagnosed.
Overview
Prevents PCC sync crashes/incorrect writes when multiple CDP subproject
segmentsshare the samesourceId:findSegmentBySourceIdnow detects ambiguity (returns up to 2 candidates), the consumer logs/records anAMBIGUOUS_SEGMENT_MATCHsync error, and the row is skipped; schema-mismatch diagnostics also capture ambiguity details.Hardens
insightsProjectsupserts against global unique-name collisions by splitting UPDATE vs INSERT checks, adding broader conflict guards (including NULLsegmentIdrows), and treating Postgres duplicate-key errors as a non-fatal “name conflict” outcome.Improves Snowflake job failure reporting by passing the original thrown value into
MetadataStore.markFailed, serializing rich error details (message/name/stack/cause/extra fields), and (for PCC) persisting transformed/skipped metrics on failure.Reviewed by Cursor Bugbot for commit 229486c. Bugbot is set up for automated code reviews on this repo. Configure here.