Skip to content

fix: use copy to load table in case append mode - #5743

Merged
vyeshwanth merged 4 commits into
masterfrom
fix.use-copy-for-redshift-avoid-stuck-syncs
Apr 23, 2025
Merged

vyeshwanth merged 4 commits into
masterfrom
fix.use-copy-for-redshift-avoid-stuck-syncs

Conversation

@vyeshwanth

@vyeshwanth vyeshwanth commented Apr 16, 2025 •

Copy link
Copy Markdown
Contributor

Description

  • tx.Commit for redshift getting stuck in some cases when loading data into table. In case of append mode, we can directly load file instead of doing it in transaction
  • Since we are now skipping creating staging table if append mode is preferred. In case of loadUserTables, it relies on indentifies staging table because users table will be deduped/merged even when append mode is preferred. So, creating a staging table for identifies is now handled by loadUserTables

Linear Ticket

Part of WAR-517, WAR-515

Security

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

@vyeshwanth
vyeshwanth marked this pull request as draft April 16, 2025 16:27
@vyeshwanth
vyeshwanth force-pushed the fix.use-copy-for-redshift-avoid-stuck-syncs branch from 28ef88e to 214e973 Compare April 17, 2025 10:17
@vyeshwanth
vyeshwanth requested a review from Copilot April 17, 2025 13:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

warehouse/integrations/redshift/redshift.go:565

  • [nitpick] The interface name 'sqlExecer' could be more descriptive. Consider renaming it to 'SQLExecutor' to better convey its purpose.
type sqlExecer interface {

@vyeshwanth
vyeshwanth force-pushed the fix.use-copy-for-redshift-avoid-stuck-syncs branch from fa7dbb9 to 8e3bc07 Compare April 21, 2025 08:59
@vyeshwanth
vyeshwanth marked this pull request as ready for review April 21, 2025 09:04
@achettyiitr

Copy link
Copy Markdown
Member

@vyeshwanth TestIntegration/Events_flow/Append_Users test is failing. Can u please check?

@vyeshwanth

Copy link
Copy Markdown
Contributor Author

@vyeshwanth TestIntegration/Events_flow/Append_Users test is failing. Can u please check?

Yes, checking this now

@codecov

codecov Bot commented Apr 22, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 72.34043% with 13 lines in your changes missing coverage. Please review.

Project coverage is 76.90%. Comparing base (c711b25) to head (f48fcc9).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
warehouse/integrations/redshift/redshift.go 72.34% 10 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5743      +/-   ##
==========================================
- Coverage   77.00%   76.90%   -0.10%     
==========================================
  Files         488      488              
  Lines       66482    66512      +30     
==========================================
- Hits        51196    51153      -43     
- Misses      12503    12569      +66     
- Partials     2783     2790       +7     

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

@vyeshwanth
vyeshwanth merged commit 877da25 into master Apr 23, 2025
@vyeshwanth
vyeshwanth deleted the fix.use-copy-for-redshift-avoid-stuck-syncs branch April 23, 2025 10:09
Sidddddarth pushed a commit that referenced this pull request Apr 29, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.48.0-rc.2](v1.47.0...v1.48.0-rc.2)
(2025-04-28)


### Features

* introduce common http client for reporting
([#5669](#5669))
([594bdce](594bdce))
* populate bytesPerTable for warehouse process API
([#5737](#5737))
([fd46379](fd46379))
* query load files using upload_id instead of staging_file_id
([#5700](#5700))
([3749ba9](3749ba9))
* support for creating upload v2 notifier jobs
([#5729](#5729))
([dbc830f](dbc830f))
* use header augmenter for router transformer client
([#5640](#5640))
([3749ba9](3749ba9))


### Bug Fixes

* httplb client doesn't respect connection limits
([#5773](#5773))
([ef0a15e](ef0a15e))
* jobsdb payload limit used compressed column sizes instead of actual
payload length
([#5723](#5723))
([c711b25](c711b25))
* race condition in table schema updates causing incorrect schema to be
saved ([#5756](#5756))
([f5ab51a](f5ab51a))
* use copy to load table in append mode for
redshift([#5743](#5743))
([877da25](877da25))
* use warehouse transformer event instead of using processor event
([#5764](#5764))
([f51e260](f51e260))
* version downgrade for databricks-sql-go to 1.6.1
([#5741](#5741))
([c711b25](c711b25))
* warehouse extracting messageId and receivedAt from event payload
([#5757](#5757))
([f5ab51a](f5ab51a))


### Miscellaneous

* add destination type in metrics
([#5727](#5727))
([fa38f34](fa38f34))
* **batchrouter:** limiter cleanup adjust stats and use harmonized
config
([#5783](#5783))
([96aba9d](96aba9d))
* change jobsdb payload column type default to text
([#5746](#5746))
([0f436e7](0f436e7))
* configure pubsub publish settings
([#5755](#5755))
([e481992](e481992))
* **deps:** bump google.golang.org/api from 0.228.0 to 0.229.0 in the
frequent group
([#5734](#5734))
([32854cc](32854cc))
* **deps:** bump the frequent group with 3 updates
([#5769](#5769))
([12b7d96](12b7d96))
* disable transformer compaction by default
([#5766](#5766))
([c504aa0](c504aa0))
* granular configuration for adaptive rate limiting
([#5739](#5739))
([c711b25](c711b25))
* improve BRT performance
([#5730](#5730))
([61642c8](61642c8))
* **jobsdb:** remove jobMinRowsMigrateThres configuration option
([#5763](#5763))
([5d2fae9](5d2fae9))
* processor UT mirroring
([#5710](#5710))
([f4f056c](f4f056c))
* remove payload logging
([#5447](#5447))
([8e08c11](8e08c11))
* trim down tracking plan validation payload
([#5749](#5749))
([e711579](e711579))
* use reloadable limiters
([#5744](#5744))
([d344d40](d344d40))
* use transformer compaction by default
([#5740](#5740))
([53792f2](53792f2))

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


##
[1.48.0](v1.47.0...v1.48.0)
(2025-04-28)


### Features

* introduce common http client for reporting
([#5669](#5669))
([594bdce](594bdce))
* populate bytesPerTable for warehouse process API
([#5737](#5737))
([fd46379](fd46379))
* query load files using upload_id instead of staging_file_id
([#5700](#5700))
([3749ba9](3749ba9))
* support for creating upload v2 notifier jobs
([#5729](#5729))
([dbc830f](dbc830f))
* use header augmenter for router transformer client
([#5640](#5640))
([3749ba9](3749ba9))


### Bug Fixes

* httplb client doesn't respect connection limits
([#5773](#5773))
([ef0a15e](ef0a15e))
* jobsdb payload limit used compressed column sizes instead of actual
payload length
([#5723](#5723))
([c711b25](c711b25))
* race condition in table schema updates causing incorrect schema to be
saved ([#5756](#5756))
([f5ab51a](f5ab51a))
* use copy to load table in append mode for
redshift([#5743](#5743))
([877da25](877da25))
* use warehouse transformer event instead of using processor event
([#5764](#5764))
([f51e260](f51e260))
* version downgrade for databricks-sql-go to 1.6.1
([#5741](#5741))
([c711b25](c711b25))
* warehouse extracting messageId and receivedAt from event payload
([#5757](#5757))
([f5ab51a](f5ab51a))


### Miscellaneous

* add destination type in metrics
([#5727](#5727))
([fa38f34](fa38f34))
* **batchrouter:** limiter cleanup adjust stats and use harmonized
config
([#5783](#5783))
([96aba9d](96aba9d))
* change jobsdb payload column type default to text
([#5746](#5746))
([0f436e7](0f436e7))
* configure pubsub publish settings
([#5755](#5755))
([e481992](e481992))
* **deps:** bump google.golang.org/api from 0.228.0 to 0.229.0 in the
frequent group
([#5734](#5734))
([32854cc](32854cc))
* **deps:** bump the frequent group with 3 updates
([#5769](#5769))
([12b7d96](12b7d96))
* disable transformer compaction by default
([#5766](#5766))
([c504aa0](c504aa0))
* granular configuration for adaptive rate limiting
([#5739](#5739))
([c711b25](c711b25))
* improve BRT performance
([#5730](#5730))
([61642c8](61642c8))
* **jobsdb:** remove jobMinRowsMigrateThres configuration option
([#5763](#5763))
([5d2fae9](5d2fae9))
* processor UT mirroring
([#5710](#5710))
([f4f056c](f4f056c))
* remove payload logging
([#5447](#5447))
([8e08c11](8e08c11))
* trim down tracking plan validation payload
([#5749](#5749))
([e711579](e711579))
* use reloadable limiters
([#5744](#5744))
([d344d40](d344d40))
* use transformer compaction by default
([#5740](#5740))
([53792f2](53792f2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

4 participants