Releases: redis/go-redis
9.19.0
🚀 Highlights
FIPS-Compatible Script Helper
Script now supports a FIPS-safe execution mode that avoids client-side SHA-1 computation, which is blocked in strict FIPS environments. A new NewScriptServerSHA constructor uses SCRIPT LOAD to obtain and cache the digest from the server, then runs commands via EVALSHA/EVALSHA_RO. Falls back to EVAL/EVALRO if loading fails, and transparently retries once on NOSCRIPT. The default behavior is unchanged for existing users.
(#3700) by @chaitanyabodlapati
FT.AGGREGATE Step-Based Pipeline Builder
Added a new step-based FT.AGGREGATE pipeline API via FTAggregateOptions.Steps, allowing LOAD, APPLY, GROUPBY, and SORTBY (with per-step MAX) to be repeated and interleaved in arbitrary order — matching Redis's native multi-stage aggregation semantics. The legacy Load/Apply/GroupBy/SortBy/SortByMax fields are now deprecated.
Raw RESP Protocol Access
Added DoRaw and DoRawWriteTo methods for executing arbitrary commands and reading the raw RESP response. Useful for proxying, custom protocol inspection, and working with commands not yet wrapped by go-redis.
(#3713) by @ofekshenawa
Configurable Dial Retry Backoff
Added DialerRetryBackoff option (plumbed through Options, ClusterOptions, RingOptions, FailoverOptions) to let callers customize the delay between failed dial attempts. Helpers DialRetryBackoffConstant and DialRetryBackoffExponential (with jitter and cap) are provided out of the box. Dial timeout is now also applied per attempt rather than across all retries.
✨ New Features
- FT.AGGREGATE Steps: Step-based pipeline builder for
FT.AGGREGATEwith support for repeated/interleavedLOAD,APPLY,GROUPBY, andSORTBYstages (#3782) by @ndyakov - VectorSet commands: Added
VISMEMBERandWITHATTRIBSsupport (#3753) by @romanpovol - FIPS-safe Script:
NewScriptServerSHAusesSCRIPT LOADto obtain the digest from the server, avoiding client-side SHA-1 (#3700) by @chaitanyabodlapati - Raw RESP access:
DoRawandDoRawWriteTofor raw RESP protocol access (#3713) by @ofekshenawa - Dial retry backoff:
DialerRetryBackofffunction option with constant and exponential helpers (#3706) by @mwhooker - Typed NOSCRIPT error: Redis
NOSCRIPTreplies are now surfaced as a typed error for easier handling (#3738) by @LINKIWI - PubSub ClientSetName: Added
ClientSetNamemethod toPubSub(#3727) by @Flack74 - ReplicaOf: New
ReplicaOfmethod replaces the deprecatedSlaveOf(#3720) by @Copilot - HSCAN BinaryUnmarshaler:
HScannow supports types implementingencoding.BinaryUnmarshaler(#3768) by @Aaditya-dubey1
🐛 Bug Fixes
- Auto hostname type detection: Improved endpoint type detection for maintenance notifications using DNS-based classification; handles empty hosts and expanded private-IP ranges (#3789) by @ndyakov
- HELLO fallback: Don't send
CLIENT MAINT_NOTIFICATIONShandshake whenHELLOfails and connection falls back to RESP2; fail fast when explicitly enabled with RESP3 (#3788) by @ndyakov - Dial TCP retry:
ShouldRetrynow treatsnet.OpErrorwithOp == "dial"timeout errors as safe to retry since no command was sent (#3787) by @vladisa88 - wrappedOnClose leak: Fixed resource leak caused by repeatedly wrapping
baseClientclose logic; replaced with a bounded, concurrency-safe named-hook registry (#3785) by @ndyakov - Pool Close() on stale connections: Suppress close errors (e.g., TLS
closeNotifytimeouts) for connections already dropped by the server due to idle timeout (#3778) by @ofekshenawa - FIFO waiter ordering: Fixed race in
ConnStateMachine.notifyWaitersthat could wake multiple waiters under a single mutex hold and violate FIFO ordering (#3777) by @0x48core - Lua READONLY detection: Detect
READONLYerrors embedded in Lua script error messages on read-only replicas so commands are correctly retried (#3769) by @zhengjilei - VectorScoreSliceCmd RESP2: Fixed
VSimWithScores,VSimWithArgsWithScores, andVLinksWithScoreswhich were broken on RESP2 connections returning flat arrays instead of maps (#3767) by @Copilot - Closed connection handling: Two fixes for closed connection handling in the pool (#3764) by @cxljs
- ZRangeArgs Rev: Fixed
ZRangeArgswithRev+ByScore/ByLexincorrectly swappingStart/Stop, breakingZRANGESTORE(#3751) by @Copilot - OTel metric instrument types: Fixed metric instrument types in
redisotel-native(#3743) by @ofekshenawa - Options.clone() data race: Fixed data race when cloning
Options(#3739) by @rubensayshi - Connection closure metrics: Fixed connection closure metrics and enabled all metric groups by default in
redisotel-native(#3735) by @ofekshenawa - OTel semconv v1.38.0: Use metric definition from
otel/semconv/v1.38.0inredisotel-native(#3731) by @wzy9607 - SETNX semantics: Use
SET ... NXinstead of the deprecatedSETNXcommand (#3723) by @ndyakov - TIME keyless routing: Mark
TIMEas a keyless command for correct cluster routing (#3722) by @fatal10110 - Dial timeout per retry: Dial timeout now applies per attempt instead of across all retry attempts combined (#3705) by @mwhooker
- Cluster metrics attributes: Fixed
pool.namebeing appended per node, which corrupted and dropped user-provided custom attributes (#3699) by @Jesse-Bonfire - initConn nil dereference: Fixed nil pointer dereference and potential deadlock in
*baseClient.initConn(); added explicit nil option guards to client constructors (#3676) by @olde-ducke
⚡ Performance
- RESP reader: Optimized RESP reader by eliminating intermediate string allocations (#3774) by @Aaditya-dubey1
- Inline rendezvous hashing: Replaced
github.com/dgryski/go-rendezvousdependency with an in-repo implementation ininternal/hashtag, reducing the dependency graph while preserving algorithm parity (#3762) by @bigsk05
🧪 Testing & Infrastructure
- Release automation: Added
repository,ref, andclient-libs-test-image-taginputs to therun-testscomposite action;redis-versionis now optional so unstable builds useREDIS_VERSIONfrom the Makefile (#3749) by @dariaguy - Go 1.24: Updated minimum Go version to 1.24 and use
-compat=1.24in release scripts (#3714, #3754) by @ndyakov, @cxljs
🧰 Maintenance
9.18.0
Redis 8.6 Support
Added support for Redis 8.6, including new commands and features for streams idempotent production and HOTKEYS.
Smart Client Handoff (Maintenance Notifications) for Cluster
This release introduces comprehensive support for Redis Enterprise Cluster maintenance notifications via SMIGRATING/SMIGRATED push notifications. The client now automatically handles slot migrations by:
- Relaxing timeouts during migration (SMIGRATING) to prevent false failures
- Triggering lazy cluster state reloads upon completion (SMIGRATED)
- Enabling seamless operations during Redis Enterprise maintenance windows
OpenTelemetry Native Metrics Support
Added comprehensive OpenTelemetry metrics support following the OpenTelemetry Database Client Semantic Conventions. The implementation uses a Bridge Pattern to keep the core library dependency-free while providing optional metrics instrumentation through the new extra/redisotel-native package.
Metric groups include:
- Command metrics: Operation duration with retry tracking
- Connection basic: Connection count and creation time
- Resiliency: Errors, handoffs, timeout relaxation
- Connection advanced: Wait time and use time
- Pubsub metrics: Published and received messages
- Stream metrics: Processing duration and maintenance notifications
(#3637) by @ofekshenawa
✨ New Features
- HOTKEYS Commands: Added support for Redis HOTKEYS feature for identifying hot keys based on CPU consumption and network utilization (#3695) by @ofekshenawa
- Streams Idempotent Production: Added support for Redis 8.6+ Streams Idempotent Production with
ProducerID,IdempotentID,IdempotentAutoinXAddArgsand newXCFGSETcommand (#3693) by @ofekshenawa - NaN Values for TimeSeries: Added support for NaN (Not a Number) values in Redis time series commands (#3687) by @ofekshenawa
- DialerRetries Options: Added
DialerRetriesandDialerRetryTimeouttoClusterOptions,RingOptions, andFailoverOptions(#3686) by @naveenchander30 - ConnMaxLifetimeJitter: Added jitter configuration to distribute connection expiration times and prevent thundering herd (#3666) by @cyningsun
- Digest Helper Functions: Added
DigestStringandDigestByteshelper functions for client-side xxh3 hashing compatible with Redis DIGEST command (#3679) by @ofekshenawa - SMIGRATED New Format: Updated SMIGRATED parser to support new format and remember original host:port (#3697) by @ndyakov
- Cluster State Reload Interval: Added cluster state reload interval option for maintenance notifications (#3663) by @ndyakov
🐛 Bug Fixes
- PubSub nil pointer dereference: Fixed nil pointer dereference in PubSub after
WithTimeout()-pubSubPoolis now properly cloned (#3710) by @Copilot - MaintNotificationsConfig nil check: Guard against nil
MaintNotificationsConfigininitConn(#3707) by @veeceey - wantConnQueue zombie elements: Fixed zombie
wantConnelements accumulation inwantConnQueue(#3680) by @cyningsun - XADD/XTRIM approx flag: Fixed XADD and XTRIM to use
=when approx is false (#3684) by @ndyakov - Sentinel timeout retry: When connection to a sentinel times out, attempt to connect to other sentinels (#3654) by @cxljs
⚡ Performance
- Fuzz test optimization: Eliminated repeated string conversions, used functional approach for cleaner operation selection (#3692) by @feiguoL
- Pre-allocate capacity: Pre-allocate slice capacity to prevent multiple capacity expansions (#3689) by @feelshu
🧪 Testing
- Comprehensive TLS tests: Added comprehensive TLS tests and example for standalone, cluster, and certificate authentication (#3681) by @ndyakov
- Redis 8.6: Updated CI to use Redis 8.6-pre (#3685) by @ndyakov
🧰 Maintenance
- Deprecation warnings: Added deprecation warnings for commands based on Redis documentation (#3673) by @ndyakov
- Use errors.Join(): Replaced custom error join function with standard library
errors.Join()(#3653) by @cxljs - Use Go 1.21 min/max: Use Go 1.21's built-in min/max functions (#3656) by @cxljs
- Proper formatting: Code formatting improvements (#3670) by @12ya
- Set commands documentation: Added comprehensive documentation to all set command methods (#3642) by @iamamirsalehi
- MaxActiveConns docs: Added default value documentation for
MaxActiveConns(#3674) by @codykaup - README example update: Updated README example (#3657) by @cxljs
- Cluster maintnotif example: Added example application for cluster maintenance notifications (#3651) by @ndyakov
👥 Contributors
We'd like to thank all the contributors who worked on this release!
@12ya, @Copilot, @codykaup, @cxljs, @cyningsun, @feelshu, @feiguoL, @iamamirsalehi, @naveenchander30, @ndyakov, @ofekshenawa, @veeceey
9.17.3
🐛 Bug Fixes
- Connection Pool: Fixed zombie
wantConnelements accumulation inwantConnQueuethat could cause resource leaks in high concurrency scenarios with dial failures (#3680) by @cyningsun - Stream Commands: Fixed
XADDandXTRIMcommands to use exact threshold (=) whenApproxis false, ensuring precise stream trimming behavior (#3684) by @ndyakov - Connection Pool: Added
ConnMaxLifetimeJitterconfiguration to distribute connection expiration times and prevent the thundering herd problem when many connections expire simultaneously (#3666) by @cyningsun - Client Options: Added
DialerRetriesandDialerRetryTimeoutfields toClusterOptions,RingOptions, andFailoverOptionsto allow configuring connection retry behavior for cluster, ring, and sentinel clients (#3686) by @naveenchander30
Contributors
We'd like to thank all the contributors who worked on this release!
@cyningsun, @naveenchander30, and @ndyakov
Full Changelog: v9.17.2...v9.17.3
9.18.0-beta.2
🚀 Highlights
Go Version Update
This release updates the minimum required Go version to 1.21. This is part of a gradual migration strategy where the minimum supported Go version will be three versions behind the latest release. With each new Go version release, we will bump the minimum version by one, ensuring compatibility while staying current with the Go ecosystem.
Stability Improvements
This release includes several important stability fixes:
- Fixed a critical panic in the handoff worker manager that could occur when handling nil errors
- Improved test reliability for Smart Client Handoff functionality
- Fixed logging format issues that could cause runtime errors
✨ New Features
🐛 Bug Fixes
- Fixed panic on nil error in handoffWorkerManager closeConnFromRequest (#3633) by @ccoVeille
- Fixed bad sprintf syntax in logging (#3632) by @ccoVeille
🧰 Maintenance
- Updated minimum Go version to 1.21 (#3640) by @ndyakov
- Use Go 1.20 idiomatic string<->byte conversion (#3435) by @justinhwang
- Reduce flakiness of Smart Client Handoff test (#3641) by @kiryazovi-redis
- Revert PR #3634 (Observability metrics phase1) (#3635) by @ofekshenawa
👥 Contributors
We'd like to thank all the contributors who worked on this release!
@justinhwang, @ndyakov, @kiryazovi-redis, @fengve, @ccoVeille, @ofekshenawa
9.18.0-beta.1
pre-release v9.18.0-beta.1
🚀 Highlights
Request and Response Policy Based Routing in Cluster Mode
This beta release introduces comprehensive support for Redis COMMAND-based request and response policy routing for cluster clients. This feature enables intelligent command routing and response aggregation based on Redis command metadata.
Key Features:
- Command Policy Loader: Automatically parses and caches COMMAND metadata with routing/aggregation hints
- Enhanced Routing Engine: Supports all request policies including:
default(keyless)- Commands without keysdefault(hashslot)- Commands with hash slot routingall_shards- Commands that need to run on all shardsall_nodes- Commands that need to run on all nodesmulti_shard- Commands that span multiple shardsspecial- Commands with custom routing logic
- Response Aggregator: Intelligently combines multi-shard replies based on response policies:
all_succeeded- All shards must succeedone_succeeded- At least one shard must succeedagg_sum- Aggregate numeric responsesspecial- Custom aggregation logic (e.g., FT.CURSOR)
- Raw Command Support: Policies are enforced on
Client.Do(ctx, args...)
This feature is particularly useful for Redis Stack commands like RediSearch that need to operate across multiple shards in a cluster.
Connection Pool Improvements
Fixed a critical defect in the connection pool's turn management mechanism that could lead to connection leaks under certain conditions. The fix ensures proper 1:1 correspondence between turns and connections.
✨ New Features
- Request and Response Policy Based Routing in Cluster Mode (#3422) by @ofekshenawa
🐛 Bug Fixes
- Fixed connection pool turn management to prevent connection leaks (#3626) by @cyningsun
🧰 Maintenance
- chore(deps): bump rojopolis/spellcheck-github-actions from 0.54.0 to 0.55.0 (#3627)
👥 Contributors
We'd like to thank all the contributors who worked on this release!
9.17.2
🐛 Bug Fixes
- Connection Pool: Fixed critical race condition in turn management that could cause connection leaks when dial goroutines complete after request timeout (#3626) by @cyningsun
- Context Timeout: Improved context timeout calculation to use minimum of remaining time and DialTimeout, preventing goroutines from waiting longer than necessary (#3626) by @cyningsun
🧰 Maintenance
- chore(deps): bump rojopolis/spellcheck-github-actions from 0.54.0 to 0.55.0 (#3627)
Contributors
We'd like to thank all the contributors who worked on this release!
@cyningsun and @ndyakov
9.17.1
🐛 Bug Fixes
- add wait to keyless commands list (#3615) by @marcoferrer
- fix(time): remove cached time optimization (#3611) by @ndyakov
🧰 Maintenance
- chore(deps): bump golangci/golangci-lint-action from 9.0.0 to 9.1.0 (#3609)
- chore(deps): bump actions/checkout from 5 to 6 (#3610)
- chore(script): fix help call in tag.sh (#3606) by @ndyakov
Contributors
We'd like to thank all the contributors who worked on this release!
@marcoferrer and @ndyakov
9.17.0
🚀 Highlights
Redis 8.4 Support
Added support for Redis 8.4, including new commands and features (#3572)
Typed Errors
Introduced typed errors for better error handling using errors.As instead of string checks. Errors can now be wrapped and set to commands in hooks without breaking library functionality (#3602)
New Commands
- CAS/CAD Commands: Added support for Compare-And-Set/Compare-And-Delete operations with conditional matching (
IFEQ,IFNE,IFDEQ,IFDNE) (#3583, #3595) - MSETEX: Atomically set multiple key-value pairs with expiration options and conditional modes (#3580)
- XReadGroup CLAIM: Consume both incoming and idle pending entries from streams in a single call (#3578)
- ACL Commands: Added
ACLGenPass,ACLUsers, andACLWhoAmI(#3576) - SLOWLOG Commands: Added
SLOWLOG LENandSLOWLOG RESET(#3585) - LATENCY Commands: Added
LATENCY LATESTandLATENCY RESET(#3584)
Search & Vector Improvements
- Hybrid Search: Added EXPERIMENTAL support for the new
FT.HYBRIDcommand (#3573) - Vector Range: Added
VRANGEcommand for vector sets (#3543) - FT.INFO Enhancements: Added vector-specific attributes in FT.INFO response (#3596)
Connection Pool Improvements
- Improved Connection Success Rate: Implemented FIFO queue-based fairness and context pattern for connection creation to prevent premature cancellation under high concurrency (#3518)
- Connection State Machine: Resolved race conditions and improved pool performance with proper state tracking (#3559)
- Pool Performance: Significant performance improvements with faster semaphores, lockless hook manager, and reduced allocations (47-67% faster Get/Put operations) (#3565)
Metrics & Observability
- Canceled Metric Attribute: Added 'canceled' metrics attribute to distinguish context cancellation errors from other errors (#3566)
✨ New Features
- Typed errors with wrapping support (#3602) by @ndyakov
- CAS/CAD commands (marked as experimental) (#3583, #3595) by @ndyakov, @htemelski-redis
- MSETEX command support (#3580) by @ofekshenawa
- XReadGroup CLAIM argument (#3578) by @ofekshenawa
- ACL commands: GenPass, Users, WhoAmI (#3576) by @destinyoooo
- SLOWLOG commands: LEN, RESET (#3585) by @destinyoooo
- LATENCY commands: LATEST, RESET (#3584) by @destinyoooo
- Hybrid search command (FT.HYBRID) (#3573) by @htemelski-redis
- Vector range command (VRANGE) (#3543) by @cxljs
- Vector-specific attributes in FT.INFO (#3596) by @ndyakov
- Improved connection pool success rate with FIFO queue (#3518) by @cyningsun
- Canceled metrics attribute for context errors (#3566) by @pvragov
🐛 Bug Fixes
- Fixed Failover Client MaintNotificationsConfig (#3600) by @ajax16384
- Fixed ACLGenPass function to use the bit parameter (#3597) by @destinyoooo
- Return error instead of panic from commands (#3568) by @dragneelfps
- Safety harness in
joinErrorsto prevent panic (#3577) by @manisharma
⚡ Performance
- Connection state machine with race condition fixes (#3559) by @ndyakov
- Pool performance improvements: 47-67% faster Get/Put, 33% less memory, 50% fewer allocations (#3565) by @ndyakov
🧪 Testing & Infrastructure
- Updated to Redis 8.4.0 image (#3603) by @ndyakov
- Added Redis 8.4-RC1-pre to CI (#3572) by @ndyakov
- Refactored tests for idiomatic Go (#3561, #3562, #3563) by @12ya
👥 Contributors
We'd like to thank all the contributors who worked on this release!
@12ya, @ajax16384, @cxljs, @cyningsun, @destinyoooo, @dragneelfps, @htemelski-redis, @manisharma, @ndyakov, @ofekshenawa, @pvragov
Full Changelog: v9.16.0...v9.17.0
9.16.0
🚀 Highlights
Maintenance Notifications Support
This release introduces comprehensive support for Redis maintenance notifications, enabling applications to handle server maintenance events gracefully. The new maintnotifications package provides:
- RESP3 Push Notifications: Full support for Redis RESP3 protocol push notifications
- Connection Handoff: Automatic connection migration during server maintenance with configurable retry policies and circuit breakers
- Graceful Degradation: Configurable timeout relaxation during maintenance windows to prevent false failures
- Event-Driven Architecture: Background workers with on-demand scaling for efficient handoff processing
For detailed usage examples and configuration options, see the maintenance notifications documentation.
✨ New Features
- Trace Filtering: Add support for filtering traces for specific commands, including pipeline operations and dial operations (#3519, #3550)
- New
TraceCmdFilteroption to selectively trace commands - Reduces overhead by excluding high-frequency or low-value commands from traces
- New
🐛 Bug Fixes
- Pipeline Error Handling: Fix issue where pipeline repeatedly sets the same error (#3525)
- Connection Pool: Ensure re-authentication does not interfere with connection handoff operations (#3547)
🔧 Improvements
- Hash Commands: Update hash command implementations (#3523)
- OpenTelemetry: Use
metric.WithAttributeSetto avoid unnecessary attribute copying in redisotel (#3552)
📚 Documentation
- Cluster Client: Add explanation for why
MaxRetriesis disabled forClusterClient(#3551)
🧪 Testing & Infrastructure
- E2E Testing: Upgrade E2E testing framework with improved reliability and coverage (#3541)
- Release Process: Improved resiliency of the release process (#3530)
📦 Dependencies
- Bump
rojopolis/spellcheck-github-actionsfrom 0.51.0 to 0.52.0 (#3520) - Bump
github/codeql-actionfrom 3 to 4 (#3544)
👥 Contributors
We'd like to thank all the contributors who worked on this release!
@ndyakov, @htemelski-redis, @Sovietaced, @Udhayarajan, @boekkooi-impossiblecloud, @Pika-Gopher, @cxljs, @huiyifyj, @omid-h70
Full Changelog: v9.14.0...v9.16.0