Closed samof76 closed 1 year ago
@ese i am implementing starting implement, customPrestop
for both redis and sentinel specs, unless you have some other opinion.
Also cc: @Wouter0100 your thoughts on this?
Personally I'd say we should ship the correct graceful shutdown depending on the Redis version and that the operator should automatically select the correct one.
The operator is designed to remove the management of Redis, and if we still need to make changes to the spec depending on the version - it feels weird.
Partially agree that the operator would need to be opinionated about certain things. But there might be sometimes, like in this case... where in the use might want to do multiple things like, ensure the replica sync is done, rdb snapshot it take, possibly notify another service, etc. that way it's better to allow the user define a script.
I def also agree with the option to add custom things, yeah :)
Oops! We already have a reference to config map containing shutdown script. Closing this.
Graceful shutdown of redis is different for different version of redis...
6.2.x expects you call the
FAILOVER
in the master redis, and it does the right thing, as documented here. Except that you would not call BGSAVE yourself. 7.x the SIGTERM is handled gracefully by redis and it does the right things for you as documented hereThe current method of calling failover on sentinel might not be very graceful, as you can see from my notes on the redis code.
One of the key issue with this model is that it does not wait for the replicas to sync the data, before failover and might lead to dataloss. Here is something i found on the bitnami charts repo.
I was thinking maybe the prestop script could be an option to both redis and sentinel, in the CRD. Any thoughts?