acoustic-carpenter-78188
06/29/2026, 9:28 AM9.21.0
This is a minor release adding new features and bug fixes. There are no breaking changes; upgrading from 9.20.x is a drop-in replacement.
🚀 Highlights
Zero-copy/GetToBufferSetFromBuffer
Two newmethods let callers read and write Redis string values directly into and from pre-allocated byte buffers, eliminating the per-call payload allocation that `Get`/`Set` incur:StringCmdable
GetToBuffer(ctx, key, buf) *ZeroCopyStringCmd // reads into buf; ZeroCopyStringCmd { Val() int; Bytes() []byte; Result() (int, error) }
SetFromBuffer(ctx, key, buf) *StatusCmd
decodes the bulk reply straight into the caller-ownedGetToBuffer(no intermediate allocation); a buffer that is too small returns an error after draining the payload, so the connection stays aligned for the next reply.bufis provided for API symmetry — it dispatches to the sameSetFromBufferwriter path as[]byteand produces byte-identical output on the wire. Available onSet(ctx, key, buf, 0),*Client,*ClusterClient,*Ringand*Conn.Pipeliner
(#3834) by@ndyakov
Explicitfor stream trimmingLIMIT 0
Redis treats `XTRIM`/`XADD` approximate-trim ()~as "disable the trimming effort cap entirely", which differs from omittingLIMIT 0(the implicitLIMITdefault). The command builders previously only emitted100 * stream-node-max-entrieswhenLIMIT, so callers could never send an explicitlimit > 0. Following theLIMIT 0precedent, the newKeepTTL = -1sentinel now emits an explicit `LIMIT 0`;XTrimLimitDisabled = -1keeps the historical no-limit == 0behavior, so existing callers produce byte-identical commands.LIMIT
(#3848) by@TheRealMal
✨ New Features
• Zero-copy buffer string commands: new/GetToBufferonSetFromBufferand theStringCmdableresult type, reading/writing string values into caller-owned buffers without per-call payload allocation (#3834) byZeroCopyStringCmd@ndyakov
•sentinel: `XTRIM`/`XADD` approximate trimming can now send an explicitXTrimLimitDisabledto disable the trim effort cap, via the newLIMIT 0sentinel (#3848) byXTrimLimitDisabled = -1@TheRealMal
• PubSub health-check timeouts:now bounds thechannel.initHealthCheckit issues with a fresh per-check timeout context (the exportedPing/pingTimeout) instead ofreconnectTimeout, so a stuck health-check Ping can no longer block indefinitely (#3819) bycontext.TODO()@abdellani
• Skip redundantinUNWATCH: a transaction now tracks whether aTx.Closeis still active (WATCH) and only issueswatchArmedonUNWATCHwhen it is, removing an extra round trip on the common `WATCH`/.../`EXEC` and no-keyClosepaths while never returning a connection to the pool with an active watch (#3854) byWatch@fcostaoliveira
🐛 Bug Fixes
•maintnotificationsfail-open:ModeAutonow stays fail-open when the server does not support maintenance notifications — connections are retired and tracking is guarded during downgrade so the client keeps working instead of erroring (#3853) byModeAuto@terrorobe
👥 Contributors
We'd like to thank all the contributors who worked on this release!
Changelog Sourced from github.com/redis/go-redis/v9's changelog.,@abdellani,@fcostaoliveira,@ndyakov,@terrorobe@TheRealMal
9.21.0 (2026-06-18)
This is a minor release adding new features and bug fixes. There are no breaking changes; upgrading from 9.20.x is a drop-in replacement.
🚀 Highlights
Zero-copy/GetToBufferSetFromBuffer
Two newmethods let callers read and write Redis string values directly into and from pre-allocated byte buffers, eliminating the per-call payload allocation that `Get`/`Set` incur:StringCmdable
GetToBuffer(ctx, key, buf) *ZeroCopyStringCmd // reads into buf; ZeroCopyStringCmd { Val() int; Bytes() []byte; Result() (int, error) }
SetFromBuffer(ctx, key, buf) *StatusCmd
decodes the bulk reply straight into the caller-ownedGetToBuffer(no intermediate allocation); a buffer that is too small returns an error after draining the payload, so the connection stays aligned for the next reply.bufis provided for API symmetry — it dispatches to the sameSetFromBufferwriter path as[]byteand produces byte-identical output on the wire. Available onSet(ctx, key, buf, 0),*Client,*ClusterClient,*Ringand*Conn.Pipeliner
(#3834) by@ndyakov
Explicitfor stream trimmingLIMIT 0
Redis treats `XTRIM`/`XADD` approximate-trim ()~as "disable the trimming effort cap entirely", which differs from omittingLIMIT 0(the implicitLIMITdefault). The command builders previously only emitted100 * stream-node-max-entrieswhenLIMIT, so callers could never send an explicitlimit > 0. Following theLIMIT 0precedent, the newKeepTTL = -1sentinel now emits an explicit `LIMIT 0`;XTrimLimitDisabled = -1keeps the historical no-limit == 0behavior, so existing callers produce byte-identical commands.LIMIT
(#3848) by@TheRealMal
✨ New Features
• Zero-copy buffer string commands: new/GetToBufferonSetFromBufferand theStringCmdableresult type, reading/writing string values into caller-owned buffers without per-call payload allocation (#3834) byZeroCopyStringCmd@ndyakov
•sentinel: `XTRIM`/`XADD` approximate trimming can now send an explicitXTrimLimitDisabledto disable the trim effort cap, via the newLIMIT 0sentinel (#3848) byXTrimLimitDisabled = -1@TheRealMal
• PubSub health-check timeouts:now bounds thechannel.initHealthCheckit issues with a fresh per-check timeout context (the exportedPing/pingTimeout) instead ofreconnectTimeout, so a stuck health-check Ping can no longer block indefinitely (#3819) bycontext.TODO()@abdellani
• Skip redundantflyteorg/flyteinUNWATCH: a transaction now tracks whether aTx.Closeis still active (WATCH) and only issueswatchArmedonUNWATCHwhen it is, removing an extra round trip on the common `WATCH`/.../`EXEC` and no-keyClosepaths while never returning a connection to the pool with an act…Watch
acoustic-carpenter-78188
06/29/2026, 3:06 PM