Skip to content

fix: incorrect snowpipe channel id being returned if insert recreates the channel - #6012

Merged
shekhar-rudder merged 3 commits into
release/1.52.xfrom
war-776-cru-duplicates
Jun 18, 2025
Merged

shekhar-rudder merged 3 commits into
release/1.52.xfrom
war-776-cru-duplicates

Conversation

@shekhar-rudder

@shekhar-rudder shekhar-rudder commented Jun 18, 2025 •

Copy link
Copy Markdown
Member

Description

BUG
A fix was made for preventing duplicates in Snowpipe in PR #5957 . But it missed returning the id of the newly created channel in the Upload method. As a result, Poll method was still receiving the stale channel id. So the GetStatus API call was failing with 404, causing the event to be marked as failed. This failed event would be retried causing duplicates

FIX

  • The actual fix was simple to propagate the new channel id from the Insert API method back to the caller. But there was another miss, that post channel recreation the cache was not being updated. So instead this PR, moves the recreation logic from the API layer to the manager layer. This meant reverting the changes done in api.go and apiadapter.go and the corresponding test files
  • In case of 404 status code, the api insert method is now returning an error ErrChannelNotFound
  • Created a insert method in manager which has the channel recreation logic based on the error type. This method is also being called from discards
  • Added a regression unit test

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov

codecov Bot commented Jun 18, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 83.87097% with 15 lines in your changes missing coverage. Please review.

Project coverage is 76.54%. Comparing base (6e7764d) to head (1f9abca).
Report is 1 commits behind head on release/1.52.x.

Files with missing lines Patch % Lines
...tionmanager/snowpipestreaming/snowpipestreaming.go 73.91% 8 Missing and 4 partials ⚠️
...ationmanager/snowpipestreaming/internal/api/api.go 92.10% 3 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.52.x    #6012      +/-   ##
==================================================
- Coverage           76.64%   76.54%   -0.10%     
==================================================
  Files                 514      514              
  Lines               69123    69125       +2     
==================================================
- Hits                52980    52913      -67     
- Misses              13261    13315      +54     
- Partials             2882     2897      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shekhar-rudder
shekhar-rudder merged commit 71cbabe into release/1.52.x Jun 18, 2025
@shekhar-rudder
shekhar-rudder deleted the war-776-cru-duplicates branch June 18, 2025 13:07
shekhar-rudder pushed a commit that referenced this pull request Jun 18, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.52.2](v1.52.1...v1.52.2)
(2025-06-18)


### Bug Fixes

* incorrect snowpipe channel id being returned if insert recreates the
channel
([#6012](#6012))
([71cbabe](71cbabe))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
shekhar-rudder added a commit that referenced this pull request Jun 19, 2025
# Description

Syncing patch release v1.52.2 to main branch

**↓↓ Please review and edit commit overrides before merging ↓↓**

BEGIN_COMMIT_OVERRIDE
fix: incorrect snowpipe channel id being returned if insert recreates
the channel (#6012)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Mihir Gandhi <[email protected]>
Co-authored-by: Aris Tzoumas <[email protected]>
Co-authored-by: shekhar-rudder <[email protected]>
Co-authored-by: Shashank Shekhar <[email protected]>
atzoum added a commit that referenced this pull request Jun 23, 2025
# Description

Syncing patch release v1.52.2 to main branch

**↓↓ Please review and edit commit overrides before merging ↓↓**

BEGIN_COMMIT_OVERRIDE
fix: incorrect snowpipe channel id being returned if insert recreates
the channel (#6012)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Mihir Gandhi <[email protected]>
Co-authored-by: Aris Tzoumas <[email protected]>
Co-authored-by: shekhar-rudder <[email protected]>
Co-authored-by: Shashank Shekhar <[email protected]>
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.

3 participants