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:
- Cache mode classification by normalized endpoint and classify each new endpoint once; or
- 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.
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 perRedisConnectionobject rather than per endpoint:RedisAdapterreconnects with the same stored options and is not affected, but directRedisConnectioncallers can change endpoints today. The offline-mode regression also demonstrates reconnecting with different options.Desired decision
Define and enforce one of these contracts:
RedisConnectionand document or reject them explicitly.Acceptance criteria
connect()endpoint-reuse contract is explicit in the public header and API documentation.CLUSTER INFO.Related: #65 and #132.