canonical / redis-k8s-operator

Operator Charm for Redis
Apache License 2.0
5 stars 10 forks source link

Update relation ip on primary change #55

Closed zmraul closed 2 years ago

zmraul commented 2 years ago

Issue

This PR addresses Jira ticket DPE-620, and Issue #50

Scaling events and pod reschedules now will check if they need to update the leader information on related apps.

Solution

Redis charm can be related to an application. If a failover happens, or the pod gets rescheduled (IP change) the related application should get updated information. To do so, extra logic has been added to handle scaling and pod deletion situations.

If a pod goes down, Juju will issue a upgrade_charm sequence of events. There are two situations:

When a pod goes down, and upgrade_charm executes, pebble_ready for sentinel has not happened yet. For this reason it is necessary to connect to a different sentinel instance to check for failover status.

Release Notes

Testing

zmraul commented 2 years ago

Integration tests seem to be failing because timing issues.

zmraul commented 2 years ago

Looks good, also would be nice to change the language from master to primary (feel free to do this in a different PR).

Yeah, this will be changed, thanks for the remainder. Redis will update terminology in the future to change this as well. But at the moment some sentinel/redis commands still refer to the master replica.