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

BigQuery Add Column: Account for update limit #1662

Merged
merged 2 commits into from
May 2, 2024

Conversation

Amogh-Bharadwaj
Copy link
Contributor

@Amogh-Bharadwaj Amogh-Bharadwaj commented May 2, 2024

BigQuery has a quota of 5 metadata update operations per table per 10 seconds. So currently if many columns are added in a PG to BQ CDC mirror, sync records fails with this error from BigQuery - even though we do ADD COLUMN IF NOT EXISTS (it still counts as an update operation)

This PR accounts for this by manually checking the table metadata for the column before adding it. This will atleast ensure that on sync flow retry, the remaining columns get added

Functionally tested

@Amogh-Bharadwaj Amogh-Bharadwaj merged commit c1852cf into main May 2, 2024
6 checks passed
@Amogh-Bharadwaj Amogh-Bharadwaj deleted the bq/add-col-better branch May 2, 2024 21:26
if field.Name == addedColumn.Name {
c.logger.Info(fmt.Sprintf("[schema delta replay] column %s already exists in table %s",
addedColumn.Name, schemaDelta.DstTableName))
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

need to continue enclosing loop using loop label

serprex added a commit that referenced this pull request May 2, 2024
continue wasn't doing anything
serprex added a commit that referenced this pull request May 2, 2024
continue wasn't doing anything
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