Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Redis]: Updating redis instance with parameters (memory and notify_keyspace_events) in a single request fails #26026

Open
1 task done
gurubanigulati17 opened this issue May 20, 2024 · 4 comments

Comments

@gurubanigulati17
Copy link

gurubanigulati17 commented May 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

0.15.5

AzureRM Provider Version

3.96.0

Affected Resource(s)/Data Source(s)

azurerm_redis_cache

Terraform Configuration Files

# redis.tf.json

{ 
   "resource": {
        "azurerm_redis_cache": {
            "redis_cache": {
                "name": "redis-42894ed2-15d8-44d2-8e74-a5602ad17a11",
                "location": "westeurope",
                "resource_group_name": "azure-staging-backing_services_infra",
                "redis_version": "6",
                "capacity": 3,
                "family": "P",
                "sku_name": "Premium",
                "enable_non_ssl_port": false,
                "minimum_tls_version": "1.2",
                "redis_configuration": {
                    "maxmemory_policy": "allkeys-lru",
                    "notify_keyspace_events": "AKE"
                },
                "patch_schedule": {
                    "day_of_week": "Saturday",
                    "start_hour_utc": 22,
                    "maintenance_window": "PT5H"
                },
                "shard_count": 2,
                "subnet_id": "xxx",
                "zones": [
                    "1",
                    "2",
                    "3"
                ],
                "timeouts": {
                    "create": "8h",
                    "update": "8h",
                    "delete": "8h"
                },
                "lifecycle": {
                    "prevent_destroy": true
                }
            }
        }
}

# terraform.tfstate

 {
      "mode": "managed",
      "type": "azurerm_redis_cache",
      "name": "redis_cache",
      "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]",
      "instances": [
        {
          "schema_version": 1,
          "attributes": {
            "capacity": 3,
            "enable_non_ssl_port": false,
            "family": "P",
            "redis_configuration": [
              {
                "active_directory_authentication_enabled": false,
                "aof_backup_enabled": false,
                "aof_storage_connection_string_0": "",
                "aof_storage_connection_string_1": "",
                "data_persistence_authentication_method": "SAS",
                "enable_authentication": true,
                "maxclients": 15000,
                "maxfragmentationmemory_reserved": 1330,
                "maxmemory_delta": 1330,
                "maxmemory_policy": "allkeys-lru",
                "maxmemory_reserved": 1330,
                "notify_keyspace_events": "AKE",
                "rdb_backup_enabled": false,
                "rdb_backup_frequency": 0,
                "rdb_backup_max_snapshot_count": 0,
                "rdb_storage_connection_string": "",
                "storage_account_subscription_id": ""
              }
            ],
            "redis_version": "6.0" }]
}

Debug Output/Panic Output

[ERROR] provider.terraform-provider-azurerm_v3.96.0_x5: Response contains error diagnostic: diagnostic_severity=ERROR diagnostic_summary="updating Redi (Subscription: "xxx"
Resource Group Name: "azure-staging-backing_services_infra"
Redis Name: "redis-42894ed2-15d8-44d2-8e74-a5602ad17a11"): unexpected status 400 with error: BadRequest: The following updates can't be processed in one single request, please send separate request to update them: 'properties.sku.capacity,properties.aadEnableDisable'.
RequestID=f2a51a49-38b1-40e3-bda0-8cc8dccd25b9" @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_detail= tf_proto_version=5.4 tf_provider_addr=provider tf_req_id=ceb6c5b7-c0f2-811b-c8a9-c65db4f4a983 tf_resource_type=azurerm_redis_cache tf_rpc=ApplyResourceChange timestamp=2024-05-19T18:46:09.807ZError: updating Redi (Subscription: "xxx"
Resource Group Name: "azure-staging-backing_services_infra"
Redis Name: "redis-42894ed2-15d8-44d2-8e74-a5602ad17a11"): unexpected status 400 with error: BadRequest: The following updates can't be processed in one single request, please send separate request to update them: 'properties.sku.capacity,properties.aadEnableDisable'.
RequestID=f2a51a49-38b1-40e3-bda0-8cc8dccd25b9  with azurerm_redis_cache.redis_cache,
  on redis.tf.json line 67, in resource.azurerm_redis_cache.redis_cache:

Expected Behaviour

The operation ought to proceed without the error message indicating, "The following updates can't be processed in one single request, please send separate request to update them: 'properties.sku.capacity,properties.aadEnableDisable". In versions 3.82.0 and below, this operation is supported. However, issues arise with versions beyond 3.82.0, wherein the operation fails. In addition, I have conducted tests on all the versions including 3.83.0, 3.84.0, 3.96.0, 3.97.0, 3.98.0, and 3.102.0.

Actual Behaviour

We attempted to trigger an update operation which increases the memory from 16 to 32 GB and changes notify_keyspace_events from AK to AKE in one call. However, it resulted in the failure of this update instance operation.

The error message received was 'The following updates can't be processed in one single request, please send separate request to update them: 'properties.sku.capacity,properties.aadEnableDisable'.
This suggests that these changes should be requested separately.

Steps to Reproduce

  1. Setup a new Azure Redis Server with
{
  "cluster_mode": true,
  "engine_version": "6.0",
  "eviction_policy": "allkeys-lru",
  "memory": 16,
  "multi_az": true,
  "notify_keyspace_events": "AK",
  "shard_count": 2
}
  1. Change the memory to 32 and notify_keyspace_events to AKE.

Important Factoids

No response

References

No response

@gurubanigulati17 gurubanigulati17 changed the title [Redis]: Updating redis instance with multiple parameters in a single request fails [Redis]: Updating redis instance with parameters (memory and notify_keyspace_events) in a single request fails May 20, 2024
@gurubanigulati17

This comment was marked as off-topic.

1 similar comment
@gurubanigulati17

This comment was marked as off-topic.

@thoHeinze
Copy link

thoHeinze commented May 29, 2024

@favoretti Sorry for pinging you directly, but I see you worked on two PRs related to enable AAD (which is mentioned in the error message above) in Redis: #23976 and #25006 Can you make any sense of the error described by @gurubanigulati17 ? Is this the new expected behaviour?

@favoretti
Copy link
Collaborator

@thoHeinze I see what is happening, but I don't know why. I'd need to run a couple of tests to try and reproduce it, but I'm unfortunately swamped hard at work right now, it will take me at least 2-3 weeks before I catch a breath to be able to do anything about this, sorry..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants