Skip to content

fix: duplicates in snowpipe streaming due to stale channel cache - #5957

Merged
shekhar-rudder merged 4 commits into
release/1.51.xfrom
war-744-snowpipe-duplicates
Jun 11, 2025
Merged

shekhar-rudder merged 4 commits into
release/1.51.xfrom
war-744-snowpipe-duplicates

Conversation

@shekhar-rudder

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

Copy link
Copy Markdown
Member

Description

https://www.notion.so/rudderstacks/Snowpipe-Streaming-Deduplication-Strategy-209f2b415dd0805db3eaccb2cfdaf367

  • Added a new argument createChannelReq in Insert method of the api. Updated all the callers to pass this new argument
  • Added logger field in API struct
  • Extracted out channel creation in buildCreateChannelRequest method to avoid code duplication

https://linear.app/rudderstack/issue/WAR-744/snowpipe-streaming-reliability-improvements

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 9, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 85.26316% with 14 lines in your changes missing coverage. Please review.

Project coverage is 76.85%. Comparing base (483508c) to head (21b8bea).
Report is 1 commits behind head on release/1.51.x.

Files with missing lines Patch % Lines
...ationmanager/snowpipestreaming/internal/api/api.go 80.00% 8 Missing and 3 partials ⚠️
...ncdestinationmanager/snowpipestreaming/discards.go 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.51.x    #5957      +/-   ##
==================================================
- Coverage           76.99%   76.85%   -0.15%     
==================================================
  Files                 495      495              
  Lines               68490    68521      +31     
==================================================
- Hits                52734    52661      -73     
- Misses              12900    12988      +88     
- Partials             2856     2872      +16     

☔ 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 changed the base branch from release/1.50.x to release/1.51.x June 10, 2025 06:29
@shekhar-rudder
shekhar-rudder changed the base branch from release/1.51.x to release/1.50.x June 10, 2025 06:29
@vyeshwanth
vyeshwanth force-pushed the war-744-snowpipe-duplicates branch from e8b8e9e to 0615dd1 Compare June 10, 2025 09:50
@shekhar-rudder
shekhar-rudder force-pushed the war-744-snowpipe-duplicates branch from 0615dd1 to e8b8e9e Compare June 10, 2025 09:57
@shekhar-rudder
shekhar-rudder force-pushed the war-744-snowpipe-duplicates branch from e8b8e9e to 0cc3059 Compare June 10, 2025 10:00
@shekhar-rudder
shekhar-rudder changed the base branch from release/1.50.x to release/1.51.x June 10, 2025 10:00
@shekhar-rudder
shekhar-rudder merged commit af37cde into release/1.51.x Jun 11, 2025
@shekhar-rudder
shekhar-rudder deleted the war-744-snowpipe-duplicates branch June 11, 2025 07:05
shekhar-rudder pushed a commit that referenced this pull request Jun 11, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.51.2](v1.51.1...v1.51.2)
(2025-06-11)


### Bug Fixes

* duplicates in snowpipe streaming due to stale channel cache
([#5957](#5957))
([af37cde](af37cde))

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

Syncing patch release v1.51.2 to main branch

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

BEGIN_COMMIT_OVERRIDE
fix: duplicates in snowpipe streaming due to stale channel cache (#5957)
END_COMMIT_OVERRIDE

---------

Co-authored-by: yeshwanth vuppu <[email protected]>
Co-authored-by: Akash Chetty <[email protected]>
Co-authored-by: shekhar-rudder <[email protected]>
Co-authored-by: Shashank Shekhar <[email protected]>
itsmihir pushed a commit that referenced this pull request Jun 16, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.52.0-rc.1](v1.51.0...v1.52.0-rc.1)
(2025-06-16)


### Features

* capture bot metrics post deduplication
([#5956](#5956))
([94f40c8](94f40c8))
* detect and handle memory-fenced responses in rudder-server
([#5935](#5935))
([af45808](af45808))
* migrate cloud destinations to v2 sdk
([#5916](#5916))
([93d64f5](93d64f5))
* shutdown server on non-reloadable config change
([#5941](#5941))
([985d3f9](985d3f9))


### Bug Fixes

* duplicates in snowpipe streaming due to stale channel cache
([#5957](#5957))
([4badd49](4badd49))
* gcs file deletion timing out
([#5951](#5951))
([e4abe53](e4abe53))
* update and extend async event delivery time metrics tests for
JobParameters logic
([#5975](#5975))
([01483d5](01483d5))
* warehouse transformations deep copying arguments
([#5979](#5979))
([28d15ac](28d15ac))


### Miscellaneous

* add conversionTime iso 8601 validation for bingads oc
([#5858](#5858))
([3e0dc6f](3e0dc6f))
* create new backoff on every reporting request
([#5993](#5993))
([7e3715a](7e3715a))
* **deps:** bump the go-deps group across 1 directory with 21 updates
([#5983](#5983))
([aa3ee66](aa3ee66))
* remove golang.org/x/crypto v0.32.0
([#5986](#5986))
([6fbb5a3](6fbb5a3))
* sync release v1.51.0 to main branch
([#5971](#5971))
([b9b1a21](b9b1a21))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
itsmihir pushed a commit that referenced this pull request Jun 17, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.52.0](v1.51.0...v1.52.0)
(2025-06-16)


### Features

* capture bot metrics post deduplication
([#5956](#5956))
([94f40c8](94f40c8))
* detect and handle memory-fenced responses in rudder-server
([#5935](#5935))
([af45808](af45808))
* migrate cloud destinations to v2 sdk
([#5916](#5916))
([93d64f5](93d64f5))
* shutdown server on non-reloadable config change
([#5941](#5941))
([985d3f9](985d3f9))


### Bug Fixes

* duplicates in snowpipe streaming due to stale channel cache
([#5957](#5957))
([4badd49](4badd49))
* gcs file deletion timing out
([#5951](#5951))
([e4abe53](e4abe53))
* update and extend async event delivery time metrics tests for
JobParameters logic
([#5975](#5975))
([01483d5](01483d5))
* warehouse transformations deep copying arguments
([#5979](#5979))
([28d15ac](28d15ac))


### Miscellaneous

* add conversionTime iso 8601 validation for bingads oc
([#5858](#5858))
([3e0dc6f](3e0dc6f))
* create new backoff on every reporting request
([#5993](#5993))
([7e3715a](7e3715a))
* **deps:** bump the go-deps group across 1 directory with 21 updates
([#5983](#5983))
([aa3ee66](aa3ee66))
* remove golang.org/x/crypto v0.32.0
([#5986](#5986))
([6fbb5a3](6fbb5a3))
* sync release v1.51.0 to main branch
([#5971](#5971))
([b9b1a21](b9b1a21))

---
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 18, 2025
… the channel (#6012)

# 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
This was referenced Jun 23, 2025
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