Skip to content

feat(compute): Atomic updates for Hyperdisk performance (IOPS/Through…#16857

Merged
c2thorn merged 4 commits intoGoogleCloudPlatform:mainfrom
yihanl-google:compute-disk-update
Apr 7, 2026
Merged

feat(compute): Atomic updates for Hyperdisk performance (IOPS/Through…#16857
c2thorn merged 4 commits intoGoogleCloudPlatform:mainfrom
yihanl-google:compute-disk-update

Conversation

@yihanl-google
Copy link
Copy Markdown
Contributor

@yihanl-google yihanl-google commented Mar 28, 2026

…put)

This PR fixes an atomicity bug where decreasing Hyperdisk performance limits (IOPS and throughput) simultaneously would fail due to sequential PATCH requests triggering API ratio validation errors.

Changes:

  • Updated Disk.yaml and RegionDisk.yaml to group performance fields.
  • Added custom_update templates for zonal and regional disks to perform atomic PATCH requests.
  • Added comprehensive acceptance tests for atomic performance updates.

Fixes b/487264955
Fixes hashicorp/terraform-provider-google#26315

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: updated `google_compute_disk` and `google_compute_region_disk` to allow simultaneous updates for Hyperdisk IOPS and throughput.

@github-actions
Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@malhotrasagar2212, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 187 insertions(+), 386 deletions(-))
google-beta provider: Diff ( 4 files changed, 187 insertions(+), 386 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 1400
Passed tests: 1304
Skipped tests: 90
Affected tests: 6

Click here to see the affected service packages
  • compute

Action taken

Found 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeDisk_attributionLabelOnCreation
  • TestAccComputeDisk_hyperdiskPerformanceAtomicUpdate
  • TestAccComputeDisk_update
  • TestAccComputeRegionDisk_basicUpdate
  • TestAccComputeRegionDisk_hyperdisk
  • TestAccComputeRegionDisk_hyperdiskPerformanceAtomicUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeDisk_hyperdiskPerformanceAtomicUpdate [Debug log]
TestAccComputeRegionDisk_hyperdiskPerformanceAtomicUpdate [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeDisk_attributionLabelOnCreation [Error message] [Debug log]
TestAccComputeDisk_update [Error message] [Debug log]
TestAccComputeRegionDisk_basicUpdate [Error message] [Debug log]
TestAccComputeRegionDisk_hyperdisk [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 194 insertions(+), 345 deletions(-))
google-beta provider: Diff ( 4 files changed, 194 insertions(+), 345 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 1400
Passed tests: 1306
Skipped tests: 90
Affected tests: 4

Click here to see the affected service packages
  • compute

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeDisk_attributionLabelOnCreation
  • TestAccComputeDisk_update
  • TestAccComputeRegionDisk_basicUpdate
  • TestAccComputeRegionDisk_hyperdisk

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeRegionDisk_hyperdisk [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeDisk_attributionLabelOnCreation [Error message] [Debug log]
TestAccComputeDisk_update [Error message] [Debug log]
TestAccComputeRegionDisk_basicUpdate [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 203 insertions(+), 342 deletions(-))
google-beta provider: Diff ( 4 files changed, 203 insertions(+), 342 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 1400
Passed tests: 1310
Skipped tests: 90
Affected tests: 0

Click here to see the affected service packages
  • compute

🟢 All tests passed!

View the build log

…put)

Groups provisioned_iops, provisioned_throughput, and access_mode into a
single PATCH request to ensure atomic updates and avoid API ratio
validation errors during performance decreases.

Fixes b/487264955
Fixes hashicorp/terraform-provider-google#26315
…put)

Groups provisioned_iops, provisioned_throughput, and access_mode into a
single PATCH request to ensure atomic updates and avoid API ratio
validation errors during performance decreases.

Fixes b/487264955
Fixes hashicorp/terraform-provider-google#26315
…ughput

Groups provisioned_iops and provisioned_throughput into a single PATCH request
to avoid API ratio validation errors. Handles access_mode in a separate request
to satisfy API grouping rules.

Fixes b/487264955
Fixes hashicorp/terraform-provider-google#26315
…ettings

Groups provisioned_iops and provisioned_throughput into a single PATCH request
to ensure atomic updates and avoid API ratio validation errors. Handles
access_mode in a separate request to satisfy API field-grouping rules.

Fixes b/487264955
Fixes hashicorp/terraform-provider-google#26315
@modular-magician
Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 203 insertions(+), 342 deletions(-))
google-beta provider: Diff ( 4 files changed, 203 insertions(+), 342 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 6 insertions(+))

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 1400
Passed tests: 1310
Skipped tests: 90
Affected tests: 0

Click here to see the affected service packages
  • compute

🟢 All tests passed!

View the build log

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

@malhotrasagar2212 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

@GoogleCloudPlatform/terraform-team @malhotrasagar2212 This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

@yihanl-google
Copy link
Copy Markdown
Contributor Author

Hi @malhotrasagar2212, I'm following up on this PR as it's been waiting for review for over a week. All 23 CI checks have passed, and this change is important for fixing the atomicity bug in Hyperdisk performance updates (b/487264955) to avoid API ratio validation errors. Could you please take a look when you have a moment? Thanks!

@rileykarson rileykarson requested review from c2thorn and removed request for malhotrasagar2212 April 7, 2026 16:56
Copy link
Copy Markdown
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

Noting that I really wanted to look for a way to avoid fully rewriting the generated update with a custom update, but could not find a better way. Each CRUD method we make fully custom brings the resource one step closer to just being better to handwrite fully than go through the generated resource.

But comparing with the old generated update, this is a faithful adaptation and addresses the problem by batching the updates together. Good work!

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.

google_compute_disk fails to decrease both iops and throughput atomically for hyperdisk

3 participants