Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(warehouse): added support for bigquery custom partition for workspaceIDs #2679

Merged
merged 9 commits into from
Nov 11, 2022

Conversation

achettyiitr
Copy link
Member

@achettyiitr achettyiitr commented Nov 9, 2022

Description

  • With support for Multi-tenancy, we won't be able to support such a config customPartitionsEnabled which is at a workspace level.
  • Added support for customPartitionsEnabledWorkspaceIDs which will take a list of workspace IDs that needs to have Custom Partition enabled.
  • Added support for string slice checkAndHotReloadConfig.

Partitioned tracks table looks like this

Screenshot 2022-11-10 at 3 10 39 PM

Error experienced without changes

2022-11-10T09:29:37.347Z	INFO	warehouse.bigquery	bigquery/bigquery.go:311	BQ: customPartitionsEnabled: bool, customPartitionsEnabledWorkspaceIDs BpLnfgDsc2WD8F2qNfHK5a84jjJ
2022-11-10T09:29:39.702Z	ERROR	warehouse	warehouse/table_upload.go:169	[WH]: Failed uploading table-tracks for upload-1: {Location: "gs://**/**/tracks/24p1HhPk09FW25Kuzxv7GshCLKR/9a7bab75-6b00-400c-941e-441b1a48ba58-tracks/1668072354.24p1HhPk09FW25Kuzxv7GshCLKR.ba545364-17af-4eb4-818c-4a1dc9763ea4.tracks.0a9c6a0a-6523-4b7b-809a-7492bec1b038.json.gz"; Message: "Error while reading data, error message: JSON table encountered too many errors, giving up. Rows: 1; errors: 1. Please look into the errors[] collection for more details. File: gs://**/**/tracks/24p1HhPk09FW25Kuzxv7GshCLKR/9a7bab75-6b00-400c-941e-441b1a48ba58-tracks/1668072354.24p1HhPk09FW25Kuzxv7GshCLKR.ba545364-17af-4eb4-818c-4a1dc9763ea4.tracks.0a9c6a0a-6523-4b7b-809a-7492bec1b038.json.gz"; Reason: "invalid"}

Notion Ticket

https://www.notion.so/rudderstacks/BQ-custom-partition-fix-for-Multi-tenant-9c3262e69c8c4d4f8ecf6f91207e3352

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
Copy link

codecov bot commented Nov 9, 2022

Codecov Report

Base: 45.45% // Head: 45.44% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (c347290) compared to base (f7d4099).
Patch coverage: 46.80% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2679      +/-   ##
==========================================
- Coverage   45.45%   45.44%   -0.02%     
==========================================
  Files         289      289              
  Lines       47949    47997      +48     
==========================================
+ Hits        21794    21811      +17     
- Misses      24768    24796      +28     
- Partials     1387     1390       +3     
Impacted Files Coverage Δ
enterprise/replay/setup.go 0.00% <0.00%> (ø)
main.go 0.00% <0.00%> (ø)
services/archiver/archiver.go 7.93% <ø> (-3.91%) ⬇️
warehouse/identities.go 1.04% <0.00%> (ø)
warehouse/bigquery/bigquery.go 1.12% <5.26%> (+0.09%) ⬆️
router/router.go 73.78% <25.00%> (-0.08%) ⬇️
config/load.go 72.43% <46.66%> (-2.75%) ⬇️
jobsdb/jobsdb.go 73.32% <55.55%> (-0.08%) ⬇️
services/filemanager/filemanager.go 78.63% <60.00%> (ø)
processor/stash/stash.go 44.56% <66.66%> (+3.00%) ⬆️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@achettyiitr achettyiitr force-pushed the chore.bq-custom-partition-workspaceids branch from 83e4b9a to 359bdc3 Compare November 9, 2022 13:53
@achettyiitr achettyiitr marked this pull request as ready for review November 9, 2022 13:54
config/load.go Outdated
if !isSet {
_value = configVal.defaultValue.([]string)
}
if !reflect.DeepEqual(_value, *value) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we do a normal []string comparison instead of reflect?

Copy link
Member Author

Choose a reason for hiding this comment

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

Using slices.Compare(_value, *value) != 0 now.

@achettyiitr achettyiitr changed the title chore(warehouse): added support for bigquery custom partition for workspaceIDs fix(warehouse): added support for bigquery custom partition for workspaceIDs Nov 10, 2022
@achettyiitr achettyiitr changed the title fix(warehouse): added support for bigquery custom partition for workspaceIDs feat(warehouse): added support for bigquery custom partition for workspaceIDs Nov 11, 2022
@achettyiitr achettyiitr merged commit af2b5a7 into master Nov 11, 2022
@achettyiitr achettyiitr deleted the chore.bq-custom-partition-workspaceids branch November 11, 2022 06:54
This was referenced Dec 1, 2022
atzoum added a commit that referenced this pull request Dec 1, 2022
feat(warehouse): added support for bigquery custom partition for workspaceIDs (#2679)
chore: by default enable max concurrent gw request limit. (#2648)
doc: create SECURITY.md (#2656)
chore: use bugsnag in router and processor goroutines (#2686)
test: using arm64 compatible images if necessary (#2670)
chore: regulation worker avoid panic in case of timeout (#2657)
feat(warehouse): degraded workspace id (#2627)
Release-As: 1.4.0
atzoum added a commit that referenced this pull request Dec 1, 2022
feat(warehouse): added support for bigquery custom partition for workspaceIDs (#2679)
chore: by default enable max concurrent gw request limit. (#2648)
doc: create SECURITY.md (#2656)
chore: use bugsnag in router and processor goroutines (#2686)
test: using arm64 compatible images if necessary (#2670)
chore: regulation worker avoid panic in case of timeout (#2657)
feat(warehouse): degraded workspace id (#2627)
Release-As: 1.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants