Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-2196 Redis Enterprise Support
  3. THREESCALE-2161

Prevent system from directly switching redis logical dbs

    XMLWordPrintable

Details

    • 3
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • 3scale 2019-03-25, 3scale 2019-04-08

    Description

      System code should not switch from one Redis logical database to another other than through configuration connection URL.

      This is a requirement to eventually support Redis Cluster/Redis Enterprise deployments, where Redis's 16 logical databases is usually disabled by default.

      As an example, message bus configuration in System currently uses the default redis connection settings from redis.yml, changing on the fly the db to '8': https://github.com/3scale/porta/blob/8bce6a225a6628aa3a18367cdd0b90c001c4abae/config/initializers/message_bus.rb#L8

      That causes System to raise the following error on startup with Redis Enterprise:

      ERROR -- : ERR DB index is out of range (Redis::CommandError)
      /opt/system/vendor/bundle/ruby/2.3.0/gems/redis-3.3.5/lib/redis/client.rb:121:in `call'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/redis-3.3.5/lib/redis/client.rb:103:in `block in connect'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/redis-3.3.5/lib/redis/client.rb:293:in `with_reconnect'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/redis-3.3.5/lib/redis/client.rb:100:in `connect'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/redis-3.3.5/lib/redis/client.rb:246:in `reconnect'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.2/lib/message_bus/backends/redis.rb:47:in `after_fork'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.2/lib/message_bus.rb:326:in `after_fork'
      config/unicorn.rb:68:in `call'
      config/unicorn.rb:68:in `map'
      config/unicorn.rb:68:in `block in reload'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:611:in `init_worker_process'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:639:in `worker_loop'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:519:in `maintain_worker_count'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:283:in `join'
      /opt/system/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
      /opt/system/vendor/bundle/ruby/2.3.0/bin/unicorn:22:in `load'
      /opt/system/vendor/bundle/ruby/2.3.0/bin/unicorn:22:in `<top (required)>'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in `start'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
      /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
      /opt/rh/rh-ruby23/root/usr/local/bin/bundle:22:in `load'
      /opt/rh/rh-ruby23/root/usr/local/bin/bundle:22:in `<main>'
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mcassola Guilherme Cassolato
            Guilherme Cassolato Guilherme Cassolato
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: