SwissDataScienceCenter / renku

Renku provides a platform and tools for reproducible and collaborative data analysis.
https://renkulab.io
Apache License 2.0
223 stars 34 forks source link

Fix Redis Sentinel configuration #2800

Open seanrmurphy opened 1 year ago

seanrmurphy commented 1 year ago

Describe the bug

Currently, renku services do not use Redis Sentinel correctly. It is necessary to modify the renku helm chart to enable the sentinels to be specified, to propagate this to the appropriate services and for them to pick up and apply this configuration. This leads to issues where services which are dependent on Redis lose connection to Redis in case of Redis restart and can be inoperational.

Link to project N/A.

To Reproduce Terminate the Redis master pod and see some services having issues.

Expected behavior Services dependent on Redis should use the Sentinel mechanisms to become aware of a change in Redis master.

Screenshots and/or execution output N/A.

Run environment (please complete the following information): N/A.

Additional context Have discussed this with @Panaetius and thought it best to include an issue here. There are related issues for the different renku components:

Proposal:

sentinelList: "redis-sentinel://renku-redis-node-0.renku-redis-headless:26379,redis-sentinel://renku-redis-node-1.renku-redis-headless:26379,redis-sentinel://renku-redis-node-2.renku-redis-headless:26379"

Logic can be added to the individual services as follows:

olevski commented 1 year ago

@seanrmurphy I think you mentioned this already but I think it is worth mentioning here again... Will the python redis clients be able to directly accept the proposed redis sentinel list string or do we need to do some parsing. I think I vaguely remember you mentioning using other libraries to parse this?

Currently the users of redis are:

seanrmurphy commented 1 year ago

I found this python lib which more or less does the parsing:

https://github.com/exponea/redis-sentinel-url

I did not look for any specific JS/TS lib.

My view is that naming the service redis+sentinel seems a bit unnatural; redis-sentinel feels more comfortable to me (but I understand that's quite a weak reason).

Regarding which of our components use Redis, I provided links to issues above which have been created for each of these components.