Skip to content

Scope cached Redis server mode to the connection endpoint #134

Description

@derekste

Problem

Follow-up from the review of #132 at 95792a3.

RedisConnection::connect(const Options&) is public and can be called with a different TCP host/port or Unix-socket path. The new server-mode result is cached once per RedisConnection object rather than per endpoint:

  • an accepted first endpoint causes later endpoints to skip Cluster detection;
  • a rejected Cluster endpoint causes later standalone endpoints to inherit the rejection.

RedisAdapter reconnects with the same stored options and is not affected, but direct RedisConnection callers can change endpoints today. The offline-mode regression also demonstrates reconnecting with different options.

Desired decision

Define and enforce one of these contracts:

  1. Cache mode classification by normalized endpoint and classify each new endpoint once; or
  2. Make endpoint changes unsupported for an existing RedisConnection and document or reject them explicitly.

Acceptance criteria

  • The supported connect() endpoint-reuse contract is explicit in the public header and API documentation.
  • Switching endpoints cannot silently reuse an unrelated accepted or rejected classification.
  • Reconnecting to the same standalone endpoint does not repeat CLUSTER INFO.
  • Tests cover standalone-to-Cluster and Cluster-to-standalone endpoint changes, or explicit rejection of both changes.

Related: #65 and #132.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions