Repository navigation
Upgrade notes
-
Source break on C# 12 and earlier:
HashSlot("key")can become ambiguous (CS0121).IConnectionMultiplexer/ConnectionMultiplexergainedHashSlot(RedisChannel)alongsideHashSlot(RedisKey);stringandbyte[]convert implicitly to both. On C# 13+,[OverloadResolutionPriority]keeps those calls binding toHashSlot(RedisKey); older language versions ignore the attribute. That includes net8.0's default (C# 12) and .NET Framework / netstandard projects (C# 7.3). Fix: pass a key explicitly (HashSlot((RedisKey)"key")), or set<LangVersion>13</LangVersion>or later. Binary compatibility is unaffected; see #3366 -
New interface members. Code that implements these interfaces itself (decorators, hand-written fakes) needs the new members:
IConnectionMultiplexer.HashSlot(RedisChannel)(#3366);- the experimental Redis 8.12 methods on
IDatabase,IDatabaseAsyncandIServer(#3343).
ReauthenticateAsyncis deliberately an extension method onIConnectionMultiplexer, so it adds nothing to implement. -
New enum value:
ConnectionFailureType.Reauthentication; exhaustiveswitches overConnectionFailureTypemay need a case (#3373) -
Experimental (
SER011): the Redis 8.12 APIs (bit positions, set-member expiration,BLESS,ZMOVE,CommandTrace.CpuTime) are behind theSER011diagnostic, and their shape may change; see #3343 -
Behaviour changes worth knowing:
- Sentinel: a sentinel-managed connection now follows the replicas sentinel lists: it adds new ones and retires those sentinel drops or holds down. A replica is only retired once it's disconnected across 3 consecutive checks. Discovery and recovery no longer block thread-pool threads. See #3385, #3301
- Primary/replica without Sentinel: a
READONLYreply from a server we treat as primary now triggers an immediate role re-read, instead of waiting up toConfigCheckSeconds; see #3384 - Transactions containing primary-only work now run on the primary when the caller asked for
PreferReplica. Read-only transactions still follow the caller's flags. See #3381 - Replicas answering
LOADINGare taken out of selection until they're ready, and the command is reissued elsewhere; see #3382 - Pub/sub: a subscribe that fails on a connection that stays up is retried from the heartbeat, instead of waiting for a reconnect; see #3387
Features
- Redis 8.12: bit enumeration, set-member expiration, BLESS, ZMOVE (SER011) by @mgravell in #3343
- ReauthenticateAsync: refresh AUTH on all live connections, including dedicated subscription connections by @mgravell in #3373
- Expose
HashSlot(RedisChannel)onIConnectionMultiplexerby @aradalvand in #3366
Fixes
Pub/sub
- Pub/sub: overlapping subscription restores cannot register on two servers by @mgravell in #3353
- Pub/sub: a multi-node subscription forgets its disconnected nodes, not its connected ones by @mgravell in #3374
- Pub/Sub: don't orphan a subscribe that races the last unsubscribe of the same channel by @aradalvand in #3363
- Pub/sub: a publish that demands a primary does not follow a subscription onto a replica (#3357) by @mgravell in #3380
- Pub/Sub: track retiring subscriptions and drive cleanup via ack, restore, and heartbeat by @aradalvand in #3368
- Pub/sub: retry a failed subscribe from the heartbeat while its connection stays up by @mgravell in #3387
Sentinel
- Sentinel: discover and recover without blocking thread-pool workers by @rebaseandpanic in #3301
- Sentinel: follow the replicas sentinel lists, not only on a switch to a new primary by @mgravell in #3385
- Sentinel: don't re-read topology after repeated connect failures by @mgravell in #3392
Routing, roles and topology
- INCREX and ARGREP are routed by key on a cluster by @mgravell in #3352
- Prefer announce hostname when dialing cluster node on reconnect by @meerasridharan-28 in #3333
- Re-read server roles promptly when a primary answers READONLY (without Sentinel) by @mgravell in #3384
- Send a transaction to the primary when it has primary-only work and the caller prefers a replica by @ShmueLior in #3381
- Enhance handling of loading replicas when replying LOADING by @lamoboos223 in #3382
Connection lifecycle
- Dispose socketless tunnel streams on connection shutdown by @mgravell in #3361
- Close three dispose/connect/topology windows behind intermittent CI failures by @mgravell in #3386
Docs
CI and engineering
- Fix build: MultiNodeSubscriptionTrackingTests uses the renamed TryAdoptEndpoint by @mgravell in #3376
- Stabilize two racy tests: keyspace notification counting, and the drain-cap MOVING test by @mgravell in #3393
- Wait for the ConnectionFailed event, not a 3s deadline, in WriteFailure_TearsDownPhysicalConnection by @mgravell in #3394
- GetConnectionId: read the bridge, don't create it by @mgravell in #3395
- Bump to 3.5 and ship the 3.5.0 API surface by @mgravell in #3389
New Contributors
- @meerasridharan-28 made their first contribution in #3333
- @aradalvand made their first contribution in #3363
- @ShmueLior made their first contribution in #3381
- @lamoboos223 made their first contribution in #3382
Full Changelog: 3.4.35...3.5.0