WikiWatershed / model-my-watershed

The web application front end for Model My Watershed.
https://modelmywatershed.org
Apache License 2.0
57 stars 31 forks source link

Upgrade Redis, ElasticCache #3576

Closed rajadain closed 1 year ago

rajadain commented 2 years ago

We're using an older version of Redis for development, staging, and production, which is going out of date in January 2023: https://endoflife.date/redis. Upgrade to latest version before then.

You are receiving this message because you have one or more Amazon ElastiCache for Redis clusters running version 2 in the US-EAST-1 Region.

ElastiCache for Redis version 2, originally released in September 2013, will reach its End Of Life (EOL) on January 13, 2023. We are providing you with a fourth reminder to give you sufficient time to upgrade your Redis cluster(s). We recommend that you upgrade your cache cluster(s) to the latest available ElastiCache for Redis version before January 13, 2023. At this time, the latest version is 6.2, and it contains features including: Redis Streams, performance improvements (including Enhanced IO), and data tiering as well as various security, reliability, and performance improvements.

You can initiate the upgrade of your cluster(s) immediately using the AWS Console, CLI or API. The upgrade process is fully managed and will upgrade each Redis node in the cluster to the new version. Depending on the cluster configuration, the upgrade process may lead to brief interruptions to application availability. Prior to upgrading, we recommend taking a snapshot of your cluster [1] during a scheduled maintenance window. See the upgrade guide for more information [2]. While most applications will not require any modification because of this upgrade, we recommend you check the version behavior compatibility page [2] and test your application with the new version before upgrading. To learn more about upgrading ElastiCache for Redis major cluster versions, review the Upgrading Redis Versions page [3].

We want to make you aware of the following milestones associated with ElastiCache for Redis Versions 2 that are reaching EOL:

  • From January 1, 2022 until January 13, 2023 - You can initiate upgrades of ElastiCache for Redis Version 2 instances to Redis 6.2 or higher at any time [3].
  • From October 13, 2022 - you cannot create new ElastiCache for Redis 2 instances from the AWS Console.
  • From January 13, 2023 - Redis Version 2 will not be available in the ElastiCache Console, CLI, API or CloudFormation. We will schedule automatic upgrade of all ElastiCache for Redis 2 clusters to Redis 6.2 within the earliest scheduled maintenance window that follows January 13, 2023.

If you have any questions or concerns, please contact AWS Support [4].

[1] https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-manual.html [2] https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/VersionManagementConsiderations.html [3] https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/VersionManagement.html [4] https://aws.amazon.com/support

rajadain commented 1 year ago

We're using Redis v5 in development:

https://github.com/WikiWatershed/model-my-watershed/blob/eb69618fb3b590c875f36ae1d95dae1b4bd5f5ac/deployment/ansible/group_vars/all#L59

But v2 in staging / production:

https://github.com/WikiWatershed/model-my-watershed/blob/eb69618fb3b590c875f36ae1d95dae1b4bd5f5ac/deployment/cfn/data_plane.py#L434

So using v5 should definitely be safe. Going to v6 may be a good idea since it is the latest, but would require more testing to ensure it works correctly.

We're not using any advanced capabilities though, so shouldn't have much impact on API changes.

rajadain commented 1 year ago

The current setup uses a custom parameter group datap-ecpgc-kkegl1bqv074:

image

which used the custom value allkeys-lru instead of the default volatile-lru for maxmemory-policy.

I created a new custom parameter group mmw-redis5 that has the same override, just based off of Redis v5:

image

I modified the Redis cluster, setting the Engine to 5 and the Parameter Group to mmw-redis5:

image

The staging instance is still working, and is able to read from the Redis cache for saved analyses:

image

Given the above, I'm going to make the changes in data_plane.py and in production, manually.