CI: append random suffix to GCP Cloud SQL database instance name#2741
Conversation
Prevent 'Error waiting for Create Instance' failures in the Concourse 'upgrade-mysql' job when builds are triggered within a short window. Google Cloud SQL enforces a 7-to-10-day moratorium on reusing the name of a recently-deleted database instance. When integration builds are triggered frequently (such as builds 344 and 345), Terraform's apply step fails because the previously-destroyed name 'upgrade-mysql-mysql-db' is still locked by GCP's resource-reclamation pipeline. Appending a 4-byte `random_id` suffix bypasses the name reservation lock while keeping resource names fully compatible with our leftover environment cleanup filter (`upgrade-mysql`). References: - Official GCP Error Documentation: https://cloud.google.com/sql/docs/error-messages - Concourse Build Failure: https://bosh.ci.cloudfoundry.org/teams/main/pipelines/bosh-director/jobs/upgrade-mysql/builds/345 - Historical Occurrence Pattern (identified via fly-search): Builds 319, 325, 344, 345 ai-assisted=yes [TNZ-88995]
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR adds a conditional 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Prevent 'Error waiting for Create Instance' failures in the Concourse 'upgrade-mysql' job when builds are triggered within a short window.
Google Cloud SQL enforces a 7-to-10-day moratorium on reusing the name of a recently-deleted database instance. When integration builds are triggered frequently (such as builds 344 and 345), Terraform's apply step fails because the previously-destroyed name 'upgrade-mysql-mysql-db' is still locked by GCP's resource-reclamation pipeline.
Appending a 4-byte
random_idsuffix bypasses the name reservation lock while keeping resource names fully compatible with our leftover environment cleanup filter (upgrade-mysql).References: