Repository navigation
DOC-7168 Add a connect page for redis-rb (Ruby) - #4230
Merged
Merged
Conversation
New ruby/connect.md covering basic connection (ACL user, URL with URL-encoded credentials, Unix socket), cluster via redis-clustering, Sentinel, TLS and mutual TLS, connection pools, timeouts and reconnection, and the RESP3 default. Linked from ruby/_index.md. Unsupported features (client-side caching, smart client handoffs, Entra ID) are left out rather than marked unsupported. All 21 code blocks ran against local servers (standalone with an ACL user and Unix socket, TLS with optional and required client certs, a 3+3 cluster, and Sentinel), with test copies differing only in ports, hosts, passwords, cert paths and key names. Versions: redis 6.0.0, redis-client 0.30.1 (the exact version redis 6.0.0 pins), connection_pool 3.0.2, redis-clustering 6.0.0 + redis-cluster-client 0.16.7 loaded from GitHub tags because RubyGems was blocked; Ruby 4.0.6, Redis 7.2.7. Two caveats rest on measurement. The failover note: a forced SENTINEL FAILOVER lost 22 and 20 acknowledged writes, because redis-rb only notices the switch when the demoted primary returns READONLY. The retry note: with the default reconnect_attempts of 1, a reply dropped by a proxy made INCR run twice, and even with no retry the server had applied it before the client raised. Learned: redis-rb defaults to one retry (redis-client to zero), so writes can run twice out of the box Constraint: every code block here is run-verified; re-run any edit against a real server Rejected: copying the redis-rb url docstring | it says url overrides options, but explicit options win (config.rb:233-244, tested) Directive: keep role: :replica, not :slave, in examples; both work but the docs say replica Gaps: gem install lines not run (RubyGems blocked); hiredis driver cert-path rule is source-only; RESP2 fallback not run Recheck: Sentinel failover caveat if redis-rb starts subscribing to +switch-master Ticket: DOC-7168 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 678cc01 |
Contributor
kaitlynmichael
approved these changes
Oct 9, 2026
andy-stark-redis
added a commit
that referenced
this pull request
Oct 12, 2026
Adds a "Connect to Redis Sentinel" section after the cluster section on the nine connect.md pages (H3 on Jedis to match its neighbors). hiredis gets a short "not supported" section: v1.4.1 has no Sentinel code. Ruby and Rust had no connect pages; their Sentinel sections shipped with the new pages in DOC-7168 (#4230, #4231). Every snippet ran against a local topology (primary, replica, three Sentinels, mymaster, quorum 2) in two variants: no auth, and separate data-node and Sentinel passwords. Test copies differed from the page snippets only in ports, passwords, and key names. Versions run: redis-py 8.1.0 (GitHub tag source), go-redis v9.23.0, node-redis 6.3.0, ioredis 6.0.0, Jedis 8.0.2, Lettuce 7.8.0, StackExchange.Redis 3.0.0 (NuGet was blocked; latest is 3.3.1), Predis 3.6.1. The failover caveats are measured, not inferred. Under a forced SENTINEL FAILOVER, redis-py, ioredis (default options), a Lettuce RedisClient connection, Predis, and SE.Redis 3.0.0 kept writing to the demoted primary for about 10 s, until Sentinel reconfigured it, and the old primary discarded those acknowledged writes on resync (22 of about 60 in the measured runs). go-redis, node-redis, and Jedis subscribe to +switch-master and moved within 1-2 s; ioredis with failoverDetector cut loss to the inherent sub-second window. The .NET page deliberately has no caveat: 3.3.1 adds an IsStalePrimaryView path that may close the window, and 3.3.1 couldn't be run here (needs the .NET 10 SDK). Surprises worth knowing before editing these sections: Jedis RedisSentinelClient has no replica reads at all; Predis replica routing is sticky until the first write and the parameters username leaks to the Sentinels (hence username in each Sentinel URI); go-redis ReplicaOnly sends writes to the replica too; redis-py sentinel_kwargs stops socket_* inheritance. Learned: five of the eight clients on these pages silently lose ~10 s of writes after a graceful Sentinel failover Constraint: every snippet here is run-verified (some trimmed to fragments of the tested program); re-run any edit against a real Sentinel topology Rejected: SE.Redis SentinelUser/SentinelPassword options | 3.1.13+, source-read only, never run; page uses SentinelConnect + GetSentinelMasterConnection, which ran on 3.0.0 Rejected: Jedis .serverDefaultProtocol() to silence the 8.x RESP3 WARN | method doesn't exist in 7.x Directive: add the SE.Redis failover caveat only after testing 3.3.1 or later under a forced failover Directive: link the go-redis and Lettuce Sentinel URL forms to connection-urls.md once DOC-7165 (#4228) merges Gaps: no TLS to Sentinels tested on any client; no crash failover, only graceful SENTINEL FAILOVER; SE.Redis 3.3.1 never run Recheck: SE.Redis credentials example when the .NET 10 SDK is available to run 3.3.1 Ticket: DOC-7167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a connect page for redis-rb, the only Ruby client without one, and links it from
ruby/_index.md. Part of DOC-7168 (epic DOC-7164). The Rust page is in a separate PR.What's on the page
redis-clusteringgem, including reads from replicasconnection_poolgemClient-side caching, smart client handoffs and Entra ID authentication aren't supported by redis-rb, so the page leaves them out.
How the examples were tested
All 21 code blocks ran against local servers:
The test copies differed from the page only in ports, hosts, passwords, certificate paths and key names.
redis-client 0.30.1 and redis-cluster-client 0.16.7 are the exact versions that redis 6.0.0 and redis-clustering 6.0.0 pin.
The
gem installlines weren't run, because RubyGems wasn't reachable from the test environment.Please review these two caveats
Both are based on what we measured, not on the client's own documentation:
INCR, and the default retry ran the command a second time. The page suggestsreconnect_attempts: 0orwithout_reconnectfor commands that aren't safe to repeat.🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes with no application or infrastructure code.
Overview
Adds a dedicated Connect to the server page for
redis-rb, bringing Ruby in line with the other client guides.The new
connect.mddocuments how to connect with ACL users,redis:///unix://URLs (including URL-encoded credentials), Redis Cluster viaredis-clustering, Sentinel (separate sentinel vs data credentials, replica reads, and failover write-loss behavior), TLS / mutual TLS,connection_pool, timeouts and reconnect retries (including non-idempotent command caveats), and default RESP3 in redis-rb 6.0.The Ruby landing page (
_index.md) now points readers to that page for cluster, Sentinel, and TLS setup.Reviewed by Cursor Bugbot for commit 678cc01. Bugbot is set up for automated code reviews on this repo. Configure here.