Support using Redis without `id` (Google MemoryStore)
Summary
Some Redis servers disable the CLIENT
command. This impacts Sidekiq, because it will attempt to pass generated CLIENT
if id
is unset. In order to workaround this, we can set id:
. This results in a nil
value, and disables the functionality.
Further details
Google Memorystore blocks CLIENT
commands: https://cloud.google.com/memorystore/docs/reference/redis-configs#blocked. The Redis ruby gem uses CLIENT
commands: https://github.com/redis/redis-rb/blob/v3.3.5/lib/redis/client.rb. We see the following error when integrating with Google Memorystore for Redis.
/opt/gitlab/embedded/lib/ruby/gems/2.5.0/gems/redis-3.3.5/lib/redis/client.rb:121:in `call': ERR unknown command 'client' (Redis::CommandError)
Proposal
Allow setting gitlab_rails['redis_enable_client'] = false
(default true
), resulting in resque.yml
having an additional line:
production:
url: redis://gcp-memory-store
id:
With this capability in place, users would be able to use Google MemoryStore or other Redis with the CLIENT
command disabled.
References
Customer ticket: https://gitlab.zendesk.com/agent/tickets/114673