-
Notifications
You must be signed in to change notification settings - Fork 14
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#4253 - Upgrade Redis Part 2 #4309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few Points:
- Is old Redis PVC needs to be deleted manually or it will automatically deleted?
- Where is the new command to deploy or upgrade Redis?
Add documentation for:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing the info on AOF vs RDB. I will wait for the final version with the expected decision about release/rollback intention to take a final look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @guru-aot
Looks good
Quality Gate passedIssues Measures |
The old redis needs to be manually deleted and it will be done, once the new redis-cluster is in place and running for a sprint, similar to the switchover we did for Patroni to Crunchy. |
Updated in the description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, hence approving it 👍
Once release/rollback instructions are updated in the release instructions I would like to take a closer look. Please share once that is available 😉
As part of the existing redis files removal, these files should be removed by creating the new Pull request once the new redis-cluster is deployed succesfully.
AOF vs RDB
As part of the analysis, finding the right persistence mechanism for our project was crucial, so on checking the official documentations of the https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/, here are some of the answer.
Common functionalities of AOF and RDB and how it is used during disaster recovery
AOF
Is kind of a write operation to the disk in a file appending everytime, usually it will have serious of files which does base file, incremental update file and manifest file. This can be found by running the below command and answers as below in the redis-cli in any of the redis-cluster pods.
There files are present in /bitnami/redis/data folder and the file appendonly.aof.1.base.rdb is the base file and appendonly.aof.1.incr.aof, appendonly.aof.2.incr.aof are the incremental files and the appendonly.aof.manifest is the manifest file, where it has the metadata/configuration of the aof files.
The reason we have 2 incremental files appendonly.aof.2.incr.aof, is when the base file corrupts and the new base file needs to be replaced, with the child creating a new base AOF file while the parent logs updates in an incremental AOF; once rewriting completes, Redis atomically updates the manifest and cleans up old files to ensure a consistent dataset. This is a feature we have in Redis 7+, as we are using 7.4.2-debian-12-r0, it available.
PROS and CONS:
The only downside of AOF is, as the filesize is very large due to the incremental updates, it will be take more time to recover but the loss of data in case of disaster is maximum one sec, this is done using the configuration below.
RDB
Is a file which takes a SNAPSHOT of the current dataset more like a backup strategy that run in certain intervals as configured. It is a single file and can be found running the below command in the redis-cli of the redis-cluster pods.
The file is present in /bitnami/redis/data and the file dump.rdb contains the snapshot of the dataset, The configuration for them is done in the save configuration as below.
PROS and CONS:
RDB can recover the Data quickly as it does not have to run through multiple files or the filesize is relatively smaller than the AOF. But the only downside is the interval in which the changes are saved as per the current configuration for minimal changes as 10 is around 5 minutes and if there is only one change it is 15 min. So if there is any 9 data changes, as per the RDB configuration the change to save in the disk will take 15 min, and during this time if there is a disaster, it will lose those 9 data changes.
Conclusion
To have the best of both worlds of RDB and AOF, enabling both of them at the same time, solves the recovery strategy. Also after the implementation of the helm installation for Redis, the upgrade and full disaster recovery can be done via the github actions.
Installation and upgrade of redis
Installing/Upgrade of redis-cluster is handled by the GHA
Redis Cluster - Install/Upgrade
.Issues in the Redis Cluster
Troubleshooting guides as per the BC GOV is given clearly in the given links
https://github.com/bcgov/common-service-showcase/wiki/Redis-Troubleshooting
Also if the cluster fails completely, we can uninstall the redis using the
helm delete redis-cluster . -n {NAMESPACE}
commands run from the/devops/helm/redis-cluster
folder. This ensures the PVC's are not deleted and cluster is removed. So when installing the redis-cluster using the GHA in the previous steps, it can be recovered, without minimum or no data loss.Migration from Old Redis
Redis Cluster - Install/Upgrade
.Rollback Procedures
Note:
Once the deployment is complete and the redis-cluster is in place, the wiki will be updated.