ledgetech / lua-resty-redis-connector

Connection utilities for lua-resty-redis
234 stars 71 forks source link

Don't send SELECT + ROLE commands to Sentinels #44

Closed piotrp closed 2 years ago

piotrp commented 3 years ago

In #34 I added error handling in connect to properly handle errors after issuing SELECT, with a workaround for Sentinels (link). This PR provides a better solution for Sentinels, so that problematic SELECT call and subsequent ROLE aren't issued.

I did this in a way that allows API to be fully compatible, i.e. old workaround is still there, but internally we avoid issuing invalid command to Sentinel unless user tries to use connect("redis://sentinel-address"). To remove this we would need to alter public APIs in some way:

piotrp commented 2 years ago

Hello @pintsized, just checking whether you remember about this ;)

esatterwhite commented 2 years ago

@pintsized Any word on this. would like see this get landed

esatterwhite commented 2 years ago

@pintsized Could we get this one published to luarocks?

esatterwhite commented 2 years ago

@pintsized nudge on this one? possible to publish this to luarocks?