redis: add moved/ask redirection support (#6294)

- Redis requests are now redirected to a new upstream connection
upon receipt of an MOVED or ASK error response. If the request
cannot be redirected, then the error is passed downstream unmodified.
The redirection IP (IPv4 or IPv6) address and TCP port specified
in the Redis server error does not need to reference a known host of
the cluster associated with the redis_proxy filter.

- added an enable_redirection boolean to the redis proxy connection
pool settings to control whether or not server redirection errors are
honored or passed downstream unchanged.

- RespValue copy constructor, copy assignment, and equality testing
methods for easier manipulation of RespValues.

- added cluster statistics, upstream_internal_redirect_succeeded_total
and upstream_internal_redirect_failed_total in ClientImpl::onRespValue()
callback

- extended unit tests for Redis connection pool, client, command
splitter, and RespValue copying and equallity testing.

- new basic integration test for redis_proxy: simple request
and response, and invalid request testing (enable_redirection
enabled).

Signed-off-by: Mitch Sukalski <mitch.sukalski@workday.com>

Mirrored from https://github.com/envoyproxy/envoy @ 378d59b43e71e07c36c9ef60b0ee7318ca7f510f
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent b230b09594
commit e166d7089f
  1. 7
      envoy/config/filter/network/redis_proxy/v2/redis_proxy.proto

@ -46,6 +46,13 @@ message RedisProxy {
// * '{user1000}.following' and '{user1000}.followers' **will** be sent to the same upstream
// * '{user1000}.following' and '{user1001}.following' **might** be sent to the same upstream
bool enable_hashtagging = 2;
// Accept `moved and ask redirection
// <https://redis.io/topics/cluster-spec#redirection-and-resharding>`_ errors from upstream
// redis servers, and retry commands to the specified target server. The target server does not
// need to be known to the cluster manager. If the command cannot be redirected, then the
// original error is passed downstream unchanged. By default, this support is not enabled.
bool enable_redirection = 3;
}
// Network settings for the connection pool to the upstream cluster.

Loading…
Cancel
Save