Skip to content

fix(warehouse): stop logging full schemas on table-level schema mismatch - #7339

Merged
achettyiitr merged 2 commits into
masterfrom
fix/warehouse-schema-mismatch-log-size
Sep 3, 2026
Merged

achettyiitr merged 2 commits into
masterfrom
fix/warehouse-schema-mismatch-log-size

Conversation

@psrikanth88

@psrikanth88 psrikanth88 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

WHSchema.GetForNamespace logs Parent schema does not match with both the parent schema and the table-level schemas serialized in full. For a wide warehouse (cloudwalk's BQ rudderstack_dw has thousands of context_traits_* / all_cookies_* columns) that is a ~19.9MB log line per occurrence. Loki rejects anything over max_line_size (10MB), so the warning never reached logs — and on the node it produced 142MB of container log for 7 lines in 30 minutes. The full cmp.Diff output was also embedded in the returned error.

Surfaced by the LokiMaxLineSizeExceeded alert on infra1-us; alloy-side mitigation in rudderlabs/rudder-devops#8149.

Changes in warehouse/internal/repo/schema.go:

  • Log parentTables / tableLevelTables counts and the cmp.Diff, capped at 4KB, instead of the two schemas.
  • Return a constant parent schema does not match error rather than one carrying the diff.
  • Drop the now-unused stringify import.
  • Same treatment for the two Insert failure logs (Failed to update related schemas, Failed to update table-level related schemas), which logged the full marshalled schema on any DB error and run per upload. They now log table/column counts.

Adds a Table-level schema drift case to TestWHSchemasRepo_GetForNamespace: the mismatch branch had no test before.

Not changed here: the mismatch is still a hard failure, so the affected destination's uploads keep aborting until the parent and table-level rows are reconciled. That is a separate decision for the warehouse team.

Linear Ticket

None — originated from the LokiMaxLineSizeExceeded infra alert.

Security

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

Validation

  • make fmt — passed, no diff
  • go build ./warehouse/... — passed
  • go test -count 1 -run TestWHSchemasRepo_GetForNamespace ./warehouse/internal/repo/ — passed (ok 8.711s)
  • golangci-lint v2.9.0 run ./warehouse/internal/repo/... — 0 issues
  • git diff --check — passed

GetForNamespace logged both the parent schema and the table-level
schemas in full when they diverged. For wide warehouses that is a
~20MB log line, which Loki rejects (max_line_size 10MB), so the
warning was lost entirely. The full cmp diff was also embedded in the
returned error.

Log table counts and a diff capped at 4KB instead, and return a
constant error message.

🔒 Scanned for secrets using gitleaks 8.28.0
Same shape as the GetForNamespace warning: both Insert failure paths
logged the full marshalled schema. Log table/column counts instead;
the error already carries the actionable part.

🔒 Scanned for secrets using gitleaks 8.28.0
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.33%. Comparing base (887f6d2) to head (d3e71ed).

Files with missing lines Patch % Lines
warehouse/internal/repo/schema.go 44.44% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7339      +/-   ##
==========================================
+ Coverage   79.88%   80.33%   +0.45%     
==========================================
  Files         612      612              
  Lines       68673    68676       +3     
==========================================
+ Hits        54856    55173     +317     
+ Misses      10599    10263     -336     
- Partials     3218     3240      +22     

☔ View full report in Codecov by Harness.
📢 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 merged commit f244c14 into master Sep 3, 2026
115 of 118 checks passed
@achettyiitr
achettyiitr deleted the fix/warehouse-schema-mismatch-log-size branch September 3, 2026 04:39
This was referenced Sep 7, 2026
mihir20 pushed a commit that referenced this pull request Sep 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.86.0-rc.1](v1.85.0...v1.86.0-rc.1)
(2026-09-07)


### Features

* backend config v2-to-v1 mapper
([#7315](#7315))
([887f6d2](887f6d2))
* **core:** capture the final recorded error for failed rETL records
([#7295](#7295))
([f4dc4d9](f4dc4d9))
* per-destination visibility at the destination-filter boundary
([#7283](#7283))
([3d83f02](3d83f02))
* user_suppression counter via suppressed dummy jobs
([#7325](#7325))
([77d3d37](77d3d37))
* **warehouse:** support jsonPaths for gcs datalake
([#7333](#7333))
([e714140](e714140))


### Bug Fixes

* rsources failed-records pagination drops records across failed-key
boundaries
([#7329](#7329))
([0a50439](0a50439))
* **warehouse:** stop logging full schemas on table-level schema
mismatch
([#7339](#7339))
([f244c14](f244c14))
* **warehouse:** upgrade clickhouse v2 driver
([#7332](#7332))
([e2c5cb9](e2c5cb9))


### Miscellaneous

* **ci:** remove unused Snyk policy file (SEC-409)
([#7317](#7317))
([d60b3c6](d60b3c6))
* make reporting 413 handling unconditional
([#7313](#7313))
([d2474e9](d2474e9))
* moving pyt contract tests
([#7327](#7327))
([8316af2](8316af2))
* **processor:** pipeline attribution in processor stats
([#7326](#7326))
([3e97f7c](3e97f7c))
* skip consent and connection-mode filtering for replays of non-existent
connections
([#7323](#7323))
([d2474e9](d2474e9))

---
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>
mihir20 pushed a commit that referenced this pull request Sep 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.86.0](v1.85.0...v1.86.0)
(2026-09-07)


### Features

* backend config v2-to-v1 mapper
([#7315](#7315))
([887f6d2](887f6d2))
* **core:** capture the final recorded error for failed rETL records
([#7295](#7295))
([f4dc4d9](f4dc4d9))
* per-destination visibility at the destination-filter boundary
([#7283](#7283))
([3d83f02](3d83f02))
* user_suppression counter via suppressed dummy jobs
([#7325](#7325))
([77d3d37](77d3d37))
* **warehouse:** support jsonPaths for gcs datalake
([#7333](#7333))
([e714140](e714140))


### Bug Fixes

* rsources failed-records pagination drops records across failed-key
boundaries
([#7329](#7329))
([0a50439](0a50439))
* **warehouse:** stop logging full schemas on table-level schema
mismatch
([#7339](#7339))
([f244c14](f244c14))
* **warehouse:** upgrade clickhouse v2 driver
([#7332](#7332))
([e2c5cb9](e2c5cb9))


### Miscellaneous

* **ci:** remove unused Snyk policy file (SEC-409)
([#7317](#7317))
([d60b3c6](d60b3c6))
* make reporting 413 handling unconditional
([#7313](#7313))
([d2474e9](d2474e9))
* moving pyt contract tests
([#7327](#7327))
([8316af2](8316af2))
* **processor:** pipeline attribution in processor stats
([#7326](#7326))
([3e97f7c](3e97f7c))
* skip consent and connection-mode filtering for replays of non-existent
connections
([#7323](#7323))
([d2474e9](d2474e9))

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

2 participants