RELEASE-NOTES.md
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
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.
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
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.
FT.AGGREGATE with support for repeated/interleaved LOAD, APPLY, GROUPBY, and SORTBY stages (#3782) by @ndyakovVISMEMBER and WITHATTRIBS support (#3753) by @romanpovolNewScriptServerSHA uses SCRIPT LOAD to obtain the digest from the server, avoiding client-side SHA-1 (#3700) by @chaitanyabodlapatiDoRaw and DoRawWriteTo for raw RESP protocol access (#3713) by @ofekshenawaDialerRetryBackoff function option with constant and exponential helpers (#3706) by @mwhookerNOSCRIPT replies are now surfaced as a typed error for easier handling (#3738) by @LINKIWIClientSetName method to PubSub (#3727) by @Flack74ReplicaOf method replaces the deprecated SlaveOf (#3720) by @CopilotHScan now supports types implementing encoding.BinaryUnmarshaler (#3768) by @Aaditya-dubey1CLIENT MAINT_NOTIFICATIONS handshake when HELLO fails and connection falls back to RESP2; fail fast when explicitly enabled with RESP3 (#3788) by @ndyakovShouldRetry now treats net.OpError with Op == "dial" timeout errors as safe to retry since no command was sent (#3787) by @vladisa88baseClient close logic; replaced with a bounded, concurrency-safe named-hook registry (#3785) by @ndyakovcloseNotify timeouts) for connections already dropped by the server due to idle timeout (#3778) by @ofekshenawaConnStateMachine.notifyWaiters that could wake multiple waiters under a single mutex hold and violate FIFO ordering (#3777) by @0x48coreREADONLY errors embedded in Lua script error messages on read-only replicas so commands are correctly retried (#3769) by @zhengjileiVSimWithScores, VSimWithArgsWithScores, and VLinksWithScores which were broken on RESP2 connections returning flat arrays instead of maps (#3767) by @CopilotZRangeArgs with Rev + ByScore/ByLex incorrectly swapping Start/Stop, breaking ZRANGESTORE (#3751) by @Copilotredisotel-native (#3743) by @ofekshenawaOptions (#3739) by @rubensayshiredisotel-native (#3735) by @ofekshenawaotel/semconv/v1.38.0 in redisotel-native (#3731) by @wzy9607SET ... NX instead of the deprecated SETNX command (#3723) by @ndyakovTIME as a keyless command for correct cluster routing (#3722) by @fatal10110pool.name being appended per node, which corrupted and dropped user-provided custom attributes (#3699) by @Jesse-Bonfire*baseClient.initConn(); added explicit nil option guards to client constructors (#3676) by @olde-duckegithub.com/dgryski/go-rendezvous dependency with an in-repo implementation in internal/hashtag, reducing the dependency graph while preserving algorithm parity (#3762) by @bigsk05repository, ref, and client-libs-test-image-tag inputs to the run-tests composite action; redis-version is now optional so unstable builds use REDIS_VERSION from the Makefile (#3749) by @dariaguy-compat=1.24 in release scripts (#3714, #3754) by @ndyakov, @cxljsConn.closed atomic field in favor of the state machine's StateClosed (#3783) by @cxljsredisotel/redisotel-native (#3770) by @ndyakovmaps.Keys, slices.Collect, slices.Contains, clear(), and slices.SortFunc instead of custom helpers (#3758, #3746) by @cxljsHGetAll describing behavior and complexity (#3776) by @0x48coreWe'd like to thank all the contributors who worked on this release!
@0x48core, @Aaditya-dubey1, @Copilot, @Flack74, @Jesse-Bonfire, @LINKIWI, @bigsk05, @chaitanyabodlapati, @cxljs, @dariaguy, @fatal10110, @mwhooker, @ndyakov, @ofekshenawa, @olde-ducke, @olzhas-sabiyev, @romanpovol, @rubensayshi, @vladisa88, @wzy9607, @zhengjilei
Full Changelog: https://github.com/redis/go-redis/compare/v9.18.0...v9.19.0
Added support for Redis 8.6, including new commands and features for streams idempotent production and HOTKEYS.
This release introduces comprehensive support for Redis Cluster maintenance notifications via SMIGRATING/SMIGRATED push notifications. The client now automatically handles slot migrations by:
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:
(#3637) by @ofekshenawa
ProducerID, IdempotentID, IdempotentAuto in XAddArgs and new XCFGSET command (#3693) by @ofekshenawaDialerRetries and DialerRetryTimeout to ClusterOptions, RingOptions, and FailoverOptions (#3686) by @naveenchander30DigestString and DigestBytes helper functions for client-side xxh3 hashing compatible with Redis DIGEST command (#3679) by @ofekshenawaWithTimeout() - pubSubPool is now properly cloned (#3710) by @CopilotMaintNotificationsConfig in initConn (#3707) by @veeceeywantConn elements accumulation in wantConnQueue (#3680) by @cyningsun= when approx is false (#3684) by @ndyakoverrors.Join() (#3653) by @cxljsMaxActiveConns (#3674) by @codykaupWe'd like to thank all the contributors who worked on this release!
@12ya, @Copilot, @codykaup, @cxljs, @cyningsun, @feelshu, @feiguoL, @iamamirsalehi, @naveenchander30, @ndyakov, @ofekshenawa, @veeceey
Full Changelog: https://github.com/redis/go-redis/compare/v9.17.0...v9.18.0
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.
This release includes several important stability fixes:
We'd like to thank all the contributors who worked on this release!
@justinhwang, @ndyakov, @kiryazovi-redis, @fengve, @ccoVeille, @ofekshenawa
Full Changelog: https://github.com/redis/go-redis/compare/v9.18.0-beta.1...v9.18.0-beta.2
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:
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 logicall_succeeded - All shards must succeedone_succeeded - At least one shard must succeedagg_sum - Aggregate numeric responsesspecial - Custom aggregation logic (e.g., FT.CURSOR)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.
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.
We'd like to thank all the contributors who worked on this release!
@cyningsun, @ofekshenawa, @ndyakov
Full Changelog: https://github.com/redis/go-redis/compare/v9.17.1...v9.18.0-beta.1
We'd like to thank all the contributors who worked on this release!
@marcoferrer and @ndyakov
Full Changelog: https://github.com/redis/go-redis/compare/v9.17.0...v9.17.1
Added support for Redis 8.4, including new commands and features (#3572)
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)
IFEQ, IFNE, IFDEQ, IFDNE) (#3583, #3595)ACLGenPass, ACLUsers, and ACLWhoAmI (#3576)SLOWLOG LEN and SLOWLOG RESET (#3585)LATENCY LATEST and LATENCY RESET (#3584)FT.HYBRID command (#3573)VRANGE command for vector sets (#3543)joinErrors to prevent panic (#3577) by @manisharmaWe'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: https://github.com/redis/go-redis/compare/v9.16.0...v9.17.0
This release introduces comprehensive support for Redis maintenance notifications, enabling applications to handle server maintenance events gracefully. The new maintnotifications package provides:
For detailed usage examples and configuration options, see the maintenance notifications documentation.
TraceCmdFilter option to selectively trace commandsmetric.WithAttributeSet to avoid unnecessary attribute copying in redisotel (#3552)MaxRetries is disabled for ClusterClient (#3551)rojopolis/spellcheck-github-actions from 0.51.0 to 0.52.0 (#3520)github/codeql-action from 3 to 4 (#3544)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: https://github.com/redis/go-redis/compare/v9.14.0...v9.16.0
This beta release includes a pre-production version of processing push notifications and hitless upgrades.
We'd like to thank all the contributors who worked on this release!
@cxljs, @ndyakov, @htemelski-redis, and @omid-h70
This beta release includes a pre-production version of processing push notifications and hitless upgrades.
Hitless upgrades is a major new feature that allows for zero-downtime upgrades in Redis clusters. You can find more information in the Hitless Upgrades documentation.
We'd like to thank all the contributors who worked on this release!
@ndyakov, @htemelski-redis, @ofekshenawa
We'd like to thank all the contributors who worked on this release!
@elena-kolevska, @htemelski-redis and @ndyakov
We'd like to thank all the contributors who worked on this release!
@LINKIWI, @cxljs, @cybersmeashish, @elena-kolevska, @htemelski-redis, @mwhooker, @ndyakov, @ofekshenawa, @suever
In the last version (9.12.0) the client introduced bigger write and read buffer sized. The default value we set was 512KiB.
However, users reported that this is too big for most use cases and can lead to high memory usage.
In this version the default value is changed to 256KiB. The README.md was updated to reflect the
correct default value and include a note that the default value can be changed.
We'd like to thank all the contributors who worked on this release!
@ndyakov and @vmihailenco
FTSearch, FTAggregate and other search commands.EPSILON option in FT.VSIM.errors.Join requires Go 1.20 or later (#3442)EPSILON option (#3454)We'd like to thank all the contributors who worked on this release!
@andy-stark-redis, @cxljs, @elena-kolevska, @htemelski-redis, @jouir, @monkey92t, @ndyakov, @ofekshenawa, @rokn, @smnvdev, @strobil and @wzy9607
Fixes TxPipeline to work correctly in cluster scenarios, allowing execution of commands only in the same slot.
scan commands, rather than random (#2623)Ring, Client and ClusterClient (#3401)We'd like to thank all the contributors who worked on this release!
@andy-stark-redis, @boekkooi-impossiblecloud, @cxljs, @dcherubini, @dependabot[bot], @iamamirsalehi, @ndyakov, @pete-woods, @twz915 and dependabot[bot]
go-redis now supports vector sets. This data type is marked
as "in preview" in Redis and its support in go-redis is marked as experimental. You can find examples in the documentation and
in the doctests folder.
We'd like to thank all the contributors who worked on this release!
@AndBobsYourUncle, @andy-stark-redis, @fukua95 and @ndyakov
StreamingCredentialsProvider for dynamic credential updates (experimental)
ParseFailoverURL for easier failover configurationStreamingCredentialsProvider for token-based authentication (#3320)
ParseFailoverURL for parsing failover URLs (#3362)GetShardClients() to retrieve all active shard clientsGetShardClientForKey(key string) to get the shard client for a specific key (#3388)ReplaceSpaces function (#3383)Options.Protocol in init() (#3387)We would like to thank all the contributors who made this release possible:
@ndyakov, @ofekshenawa, @LINKIWI, @iamamirsalehi, @fukua95, @lzakharov, @DengY11
For a complete list of changes, see the full changelog.
HGETDEL, HGETEX, HSETEX) and HSTRLEN commandCountOnly argument for FT.SearchHGETDEL, HGETEX, HSETEX (#3305)HSTRLEN command for hash operations (#2843)Do method for raw query by single connection from pool.Conn() (#3182)IsClusterMode config parameter (#3255)HELLO RESP handshake (#3294)CountOnly argument for FT.Search to use LIMIT 0 0 (#3338)DB option support in NewFailoverClusterClient (#3342)nil check for the options when creating a client (#3363)PubSub concurrency safety issues (#3360)nil (#3353)MASTERDOWN a retriable error (#3164)FT.Search Limit argument and added CountOnly argument for limit 0 0 (#3338)COUNTKEYSINSLOT command (#3327)CountOnly search example (#3345)LLEN, LPOP, LPUSH, LRANGE, RPOP, RPUSH (#3234)SADD and SMEMBERS command examples (#3242)README.md to use Redis Discord guild (#3331)HExpire command documentation (#3355)README.md with additional information (#310ce55)We would like to thank all the contributors who made this release possible:
@alexander-menshchikov, @EXPEbdodla, @afti, @dmaier-redislabs, @four_leaf_clover, @alohaglenn, @gh73962, @justinmir, @LINKIWI, @liushuangbill, @golang88, @gnpaone, @ndyakov, @nikolaydubina, @oleglacto, @andy-stark-redis, @rodneyosodo, @dependabot, @rfyiamcool, @frankxjkuang, @fukua95, @soleymani-milad, @ofekshenawa, @khasanovbi
go-redis won't skip span creation if the parent spans is not recording. (#2980)
Users can use the OpenTelemetry sampler to control the sampling behavior.
For instance, you can use the ParentBased(NeverSample()) sampler from go.opentelemetry.io/otel/sdk/trace to keep
a similar behavior (drop orphan spans) of go-redis as before.FUNCTION group of commands (#2475)ContextTimeoutEnabled option that controls whether the client respects context timeouts
and deadlines. See
Redis Timeouts for details.ParseClusterURL to parse URLs into ClusterOptions, for example,
redis://user:password@localhost:6789?dial_timeout=3&read_timeout=6s&addr=localhost:6790&addr=localhost:6791.redisotel.IstrumentMetrics. See
documentationredis.HasErrorPrefix to help working with errors.DialHook.redisotel.NewTracingHook with redisotel.InstrumentTracing. See
example and
documentation.*redis.Z with redis.Z since it is small enough to be passed as value without making
an allocation.MaxConnAge to ConnMaxLifetime.IdleTimeout to ConnMaxIdleTime.MaxIdleConns.WithContext since context.Context can be passed directly as an arg.Pipeline.Close since there is no real need to explicitly manage pipeline resources and
it can be safely reused via sync.Pool etc. Pipeline.Discard is still available if you want to
reset commands for some reason.