Skip to content

chore: filtering overflow events for snowpipe streaming above 16MB - #6921

Merged
achettyiitr merged 2 commits into
masterfrom
chore.snowpipe-streaming-inserts-chunking
Apr 30, 2026
Merged

achettyiitr merged 2 commits into
masterfrom
chore.snowpipe-streaming-inserts-chunking

Conversation

@achettyiitr

@achettyiitr achettyiitr commented Apr 28, 2026 •

Copy link
Copy Markdown
Member

🔒 Scanned for secrets using gitleaks 8.29.1

Description

Snowpipe Streaming insert requests have a maximum 'insertRows' size. Previously, large batches could exceed this limit and fail. This change ensures we stay within the limit and fail only the overflow events deterministically.

  • Compute per-event payload size from raw message.data JSON and store it as MessageDataByteSize.
  • While uploading, group events by table and filter out events that would cause a table insert request to exceed the 16MB limit (maxInsertRequestSizeBytes).
  • Mark any overflow events as failed with reason: some events were not uploaded because they exceeded the max insert request size: 16777216.

Linear Ticket

  • Resolves INT-5890

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 Apr 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.74%. Comparing base (c7aa7c4) to head (23e54a1).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...tionmanager/snowpipestreaming/snowpipestreaming.go 97.05% 0 Missing and 1 partial ⚠️
...asyncdestinationmanager/snowpipestreaming/types.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6921      +/-   ##
==========================================
- Coverage   80.08%   79.74%   -0.34%     
==========================================
  Files         565      565              
  Lines       63372    63405      +33     
==========================================
- Hits        50750    50565     -185     
- Misses       9633     9854     +221     
+ Partials     2989     2986       -3     

☔ 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.

@achettyiitr achettyiitr changed the title chore: inserts chunking above 16MB chore: filtering overflow events for snowpipe streaming above 16MB Apr 28, 2026
@achettyiitr
achettyiitr force-pushed the chore.snowpipe-streaming-inserts-chunking branch 3 times, most recently from 3c77294 to 0ee865e Compare April 28, 2026 10:19
})
uploadInfos := lo.MapToSlice(groupedEvents, func(tableName string, tableEvents []*event) *uploadInfo {

filteredGroupedEvents, overflowedEvents := m.filterOutEventsThatExceedMaxInsertRequestSize(groupedEvents)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the SDK log, why can't we chunk the event into multiple batches in snowpipe service instead of handling it in rudder-server?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we can't chunk in the Snowpipe service. Event /insert is associated with an offset. If we are going to chunk on the snowpipe service. What offsets are you going to provide for multiple calls?

It's possible that for insert 1 + offset 1 data got flushed successfully, but for insert 2 and offset 1 it failed. If that happens, we would be marking all events corresponding to insert 2 as succeeded.

@achettyiitr
achettyiitr force-pushed the chore.snowpipe-streaming-inserts-chunking branch from 0ee865e to ad69e54 Compare April 28, 2026 10:37
🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr force-pushed the chore.snowpipe-streaming-inserts-chunking branch from ad69e54 to b0e77b9 Compare April 28, 2026 10:38
@achettyiitr
achettyiitr requested a review from krishna2020 April 29, 2026 06:07
if discardImportInfo != nil {
importInfos = append(importInfos, discardImportInfo)
}
if len(overflowedEvents) > 0 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add a comment saying something like these events are expected to succeed in the next retry and not abort since there is jobid based ordering

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if such a comment is helpful, as it is a general behaviour for failure scenarios. Marking any events as failed and having them picked up in the next processing based on jobid-based ordering is server-specific. It happens for all other failure scenarios.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happens for all other failure scenarios. -> I felt that it was not obvious why it would succeed in the next attempt and not fail again

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr merged commit 2e5192b into master Apr 30, 2026
73 checks passed
@achettyiitr
achettyiitr deleted the chore.snowpipe-streaming-inserts-chunking branch April 30, 2026 15:19
itsmihir pushed a commit that referenced this pull request May 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.75.0-rc.1](v1.74.0...v1.75.0-rc.1)
(2026-05-12)


### Features

* snowpipe batch status
([#6926](#6926))
([f00dd89](f00dd89))
* support clickhouse day week month partitions
([#6931](#6931))
([00ff494](00ff494))
* support concurrency during partition migration flushing
([#6929](#6929))
([dd2f658](dd2f658))


### Bug Fixes

* **router:** delays in finding worker slots when event ordering is
disabled
([#6930](#6930))
([a7389f8](a7389f8))
* rsources failed keys batch fails to be inserted with postgres error
21000 ([#6940](#6940))
([3c7a1ec](3c7a1ec))
* salesforce bulk upload null and numeric CSV formatting
([#6923](#6923))
([5e67a45](5e67a45))


### Miscellaneous

* debug snowpipe streaming importing job size
([#6941](#6941))
([73d3bbe](73d3bbe))
* filtering overflow events for snowpipe streaming above 16MB
([#6921](#6921))
([2e5192b](2e5192b))
* pyt managed session
([#6910](#6910))
([c7aa7c4](c7aa7c4))
* remove deprecated fetch-tables endpoint
([#6944](#6944))
([fdb2649](fdb2649))
* sync release v1.74.0 to main branch
([#6920](#6920))
([e844f82](e844f82))
* workflow cleanup
([#6924](#6924))
([da7161d](da7161d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
itsmihir pushed a commit that referenced this pull request May 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.75.0](v1.74.0...v1.75.0)
(2026-05-12)


### Features

* snowpipe batch status
([#6926](#6926))
([f00dd89](f00dd89))
* support clickhouse day week month partitions
([#6931](#6931))
([00ff494](00ff494))
* support concurrency during partition migration flushing
([#6929](#6929))
([dd2f658](dd2f658))


### Bug Fixes

* **router:** delays in finding worker slots when event ordering is
disabled
([#6930](#6930))
([a7389f8](a7389f8))
* rsources failed keys batch fails to be inserted with postgres error
21000 ([#6940](#6940))
([3c7a1ec](3c7a1ec))
* salesforce bulk upload null and numeric CSV formatting
([#6923](#6923))
([5e67a45](5e67a45))


### Miscellaneous

* debug snowpipe streaming importing job size
([#6941](#6941))
([73d3bbe](73d3bbe))
* filtering overflow events for snowpipe streaming above 16MB
([#6921](#6921))
([2e5192b](2e5192b))
* pyt managed session
([#6910](#6910))
([c7aa7c4](c7aa7c4))
* remove deprecated fetch-tables endpoint
([#6944](#6944))
([fdb2649](fdb2649))
* sync release v1.74.0 to main branch
([#6920](#6920))
([e844f82](e844f82))
* workflow cleanup
([#6924](#6924))
([da7161d](da7161d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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