Skip to content

azurerm_postgresql_flexible_server_configuration: should lock the replica server#29071

Merged
stephybun merged 2 commits intohashicorp:mainfrom
wuxu92:pg/pe-to-lock-replica
Mar 27, 2025
Merged

azurerm_postgresql_flexible_server_configuration: should lock the replica server#29071
stephybun merged 2 commits intohashicorp:mainfrom
wuxu92:pg/pe-to-lock-replica

Conversation

@wuxu92
Copy link
Collaborator

@wuxu92 wuxu92 commented Mar 14, 2025

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

A locker to the replica server is also required when add a virutal endpoint. there is a internal ticket about updating configuration and creating virtual endpoint in parallel which caused an issue:

Then, it was followed by a configuration update (UpdateConfigurationManagementOperation).
And then it got the restart server request (RestartServerManagementOperation), which succeeded normally, however, it is right there when the create virtual endpoint requests were triggered, right in the middle of the server restart.

In mean time, the locker to the configuraiton name is not required while we already had a locker on the server itself.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_postgresql_flexible_server_configuration - add locker to the replication server id

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #0000

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

Comment on lines -84 to -86
locks.ByName(id.ConfigurationName, postgresqlFlexibleServerConfigurationResourceName)
defer locks.UnlockByName(id.ConfigurationName, postgresqlFlexibleServerConfigurationResourceName)

Copy link
Member

Choose a reason for hiding this comment

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

These were added recently in #27355 and seem to have fixed an issue so I don't think we should be removing them

Copy link
Collaborator Author

@wuxu92 wuxu92 Mar 26, 2025

Choose a reason for hiding this comment

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

This lock is meaningless here and does not actually resolve the issue it was intended to. The issue still exists and needs further investigation. and there is already a lock to the flexible server above: locks.ByName(id.FlexibleServerName, postgresqlFlexibleServerResourceName).

Copy link
Member

Choose a reason for hiding this comment

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

Could you resolve the merge conflicts so this can be merged?

stephybun
stephybun previously approved these changes Mar 26, 2025
Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @wuxu92 LGTM 👍

@stephybun stephybun merged commit 98be595 into hashicorp:main Mar 27, 2025
30 checks passed
@github-actions github-actions bot added this to the v4.25.0 milestone Mar 27, 2025
stephybun added a commit that referenced this pull request Mar 27, 2025
jackofallops added a commit that referenced this pull request Mar 28, 2025
* CHANGELOG.md for v4.25.0

* Update CHANGELOG.md #29126

* Update CHANGELOG.md #28647

* Update CHANGELOG.md #29153

* Update CHANGELOG.md #29131

* Update CHANGELOG.md #29090

* Update CHANGELOG.md #29137

* Update for #28781

* Update for #29158

* Update for #29073

* Update for #28149

* Update for #28730

* Update for #29157

* Update for #29135

* Update for #29184

* Update for #29093

* Update for #29071

* Update for #28371

* Update for #28560

* Update CHANGELOG.md #29199

* Update CHANGELOG.md for #29206

* prep for release

* Update CHANGELOG.md

---------

Co-authored-by: sreallymatt <106555974+sreallymatt@users.noreply.github.com>
Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: jackofallops <11830746+jackofallops@users.noreply.github.com>
Co-authored-by: jackofallops <ste@hashicorp.com>
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants