fix(bigquery): Add retry predicates for dataset create and update#26430
Draft
ElliotSwart wants to merge 1 commit intohashicorp:mainfrom
Draft
fix(bigquery): Add retry predicates for dataset create and update#26430ElliotSwart wants to merge 1 commit intohashicorp:mainfrom
ElliotSwart wants to merge 1 commit intohashicorp:mainfrom
Conversation
BigQuery dataset create (POST) and update (PUT) operations currently do not pass any ErrorRetryPredicates to SendRequest. When a dataset has inline access blocks referencing service accounts or groups created in the same apply, the API can return Error 400 "Service account does not exist" or "Group does not exist" due to IAM propagation delays. This adds IamServiceAccountNotFound and IsBigqueryIAMQuotaError retry predicates to both Create and Update operations, matching the pattern used in the companion fix for BigQuery dataset IAM policy operations. Addresses 230 observed failures from IAM setPolicy errors during dataset creation/update with inline access blocks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
This repository is generated by https://github.com/GoogleCloudPlatform/magic-modules. Any changes made directly to this repository will likely be overwritten. If you have further questions, please feel free to ping your reviewer or, internal employees, reach out to one of the engineers. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IamServiceAccountNotFoundandIsBigqueryIAMQuotaErrorretry predicates to BigQuery dataset Create (POST) and Update (PUT) operationsaccessblocks referencing service accounts or groups that haven't fully propagatedProblem
When a
google_bigquery_datasetwith inlineaccessblocks and agoogle_service_accountare created in the sameterraform apply, the BigQuery API can fail with:or during updates:
This happens because GCP IAM is eventually consistent — the service account or group exists but isn't yet visible to the BigQuery API (typically 30-120 seconds).
Currently,
resourceBigQueryDatasetCreateandresourceBigQueryDatasetUpdatecallSendRequestwithout anyErrorRetryPredicates, so these transient errors fail immediately.Fix
Add two existing retry predicates to both Create and Update
SendRequestcalls:IamServiceAccountNotFound: retries on 400 errors with "Service account does not exist"IsBigqueryIAMQuotaError: retries on 403 errors from BigQuery IAM quota limitsTest plan
google_bigquery_datasetReferences
IamServiceAccountNotFound:google/transport/error_retry_predicates.goIsBigqueryIAMQuotaError:google/transport/error_retry_predicates.gommv1/third_party/terraform/services/bigquery/resource_bigquery_dataset.go.tmpl🤖 Generated with Claude Code