[MySQL] az mysql flexible-server geo-restore: do not force source storage redundancy on target#33814
az mysql flexible-server geo-restore: do not force source storage redundancy on target#33814Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
az mysql flexible-server geo-restore: do not force source storage redundancy on target
Live test results —
|
There was a problem hiding this comment.
✅ Live Test & CI Pass
All checks have passed and the live tests completed successfully. Marking this PR ready for review.
Posted by agent-assist (autonomous bug-fix pipeline).
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
Updates MySQL flexible server GeoRestore to avoid forcing the source server’s storage redundancy setting onto the restored server, and adds a unit test to validate this behavior.
Changes:
- Removed
storage_redundancypropagation when constructingmodels.Storageinflexible_server_georestore. - Added a unit test ensuring GeoRestore does not pass
storage_redundancyinto the Storage model.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/mysql/custom.py | Stops passing storage_redundancy from source server storage into GeoRestore parameters. |
| src/azure-cli/azure/cli/command_modules/mysql/tests/latest/test_mysql_flexible_server_georestore.py | Adds a unit test asserting storage_redundancy is not provided during GeoRestore. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @patch('azure.cli.command_modules.mysql.custom.sdk_no_wait') | ||
| @patch('azure.cli.command_modules.mysql.custom.resolve_poller') | ||
| @patch('azure.cli.command_modules.mysql.custom.flexible_server_provision_network_resource') | ||
| @patch('azure.cli.command_modules.mysql.custom._determine_iops') | ||
| @patch('azure.cli.command_modules.mysql.custom.get_identity_and_data_encryption') | ||
| @patch('azure.cli.command_modules.mysql.custom.validate_server_name') | ||
| @patch('azure.cli.command_modules.mysql.custom.get_mysql_list_skus_info') | ||
| @patch('azure.cli.command_modules.mysql.custom.get_mysql_flexible_management_client_by_sub') | ||
| @patch('azure.cli.command_modules.mysql.custom.parse_resource_id') | ||
| @patch('azure.cli.command_modules.mysql.custom.is_valid_resource_id') | ||
| @patch('azure.cli.command_modules.mysql.custom.models.ServerForUpdate') | ||
| @patch('azure.cli.command_modules.mysql.custom.models.Server') | ||
| @patch('azure.cli.command_modules.mysql.custom.models.MySQLServerSku') | ||
| @patch('azure.cli.command_modules.mysql.custom.models.Backup') | ||
| @patch('azure.cli.command_modules.mysql.custom.models.Storage') | ||
| def test_georestore_does_not_force_source_storage_redundancy( | ||
| self, storage_cls, backup_cls, sku_cls, server_cls, server_update_cls, is_valid_resource_id, | ||
| parse_resource_id, get_mgmt_client_by_sub, get_list_skus_info, validate_server_name, | ||
| get_identity_and_data_encryption, determine_iops, provision_network_resource, resolve_poller, sdk_no_wait): |
| if __name__ == '__main__': | ||
| unittest.main() |
Related command
az mysql flexible-server geo-restoreDescription
Geo-restore from Zone-Redundant HA sources can fail in paired regions that do not support ZRS (e.g., UK West) because CLI was sending source
storage_redundancyinto target create payload.This change stops pinning target storage redundancy to source value, so geo-restore can proceed with region-supported redundancy.
Root cause
flexible_server_georestorecopiedsource_server_object.storage.storage_redundancyintomodels.Storage(...).Code change
storage_redundancyfrom geo-restore storage payload construction in:/src/azure-cli/azure/cli/command_modules/mysql/custom.pyRegression coverage
/src/azure-cli/azure/cli/command_modules/mysql/tests/latest/test_mysql_flexible_server_georestore.pystorage_redundancyfrom source.Testing Guide
Example command (paired-region DR path):
Optional explicit sizing/SKU overrides (still supported):
History Notes
[MySQL]
az mysql flexible-server geo-restore: stop forcing source storage redundancy in target create payload to avoid non-ZRS region restore failuresThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.