Changes
Requirements
- Go 1.26: every module now declares
go 1.26.0, so Go 1.26 or newer is required (#1062)
Features
- rueidisgcp: new module for IAM authentication with Memorystore for Valkey. Its
NewClientgets access tokens from Application Default Credentials or a custom token source, refreshes them before they expire, and fills in the Memorystore defaults (valkey-io/valkey-go#215) StartandStopforZRANGEandZRANGESTORE: the command builders now offer.Start().Stop(), the argument names in the currentZRANGEdocs, alongside.Min().Max()(#1035)- rueidiscompat: added
XNack(valkey-io/valkey-go#199), andWaitandWaitAOF(valkey-io/valkey-go#202)
Performance
CacheMarshalandCacheSizeno longer allocate once per array element.CacheMarshalon a 100-element array is about 75% faster (#1055)- RESP lengths are written with
strconv.AppendIntinstead of float math, 15–27% faster in micro-benchmarks (#1054)
Bug Fixes
- Client-side caching: two different commands could share one cache entry and be served each other's reply, for example
HGET k ALLandHGETALL k, orGETRANGE k 1 23andGETRANGE k 12 3. Each part of a cache key is now length-prefixed (valkey-io/valkey-go#210) - Connections held by
Dedicate()orDedicated()now refresh the credentials fromAuthCredentialsFn, so a long-lived pub/sub connection is no longer dropped when its credentials expire, for example with ElastiCache IAM auth (#1048) - With
SendToReplicas, the cluster client now dials every connection withREADONLY. Before, a primary demoted by a failover kept a connection without it, and reads routed to it gotMOVEDforever (valkey-io/valkey-go#205) Closeno longer hangs when another call is waiting on the same connection (#1050)- After
Close, the cluster client'sDo,DoMulti,DoCacheandDoMultiCachereturnErrClosinginstead of a rawMOVEDorASKerror (#1037) RedisResultStream.WriteTonow closes the connection when the destination writer fails during a chunked response, instead of returning it to the pool with unread chunks (#1040)- Closed connections stop their lifetime timers, so retired connections and their buffers are freed right away instead of at the original lifetime deadline (valkey-io/valkey-go#206)
ParseURLreads a trailing slash with no database number, likeredis://localhost:6379/, as DB 0 (#1042). Anaddr=value without a port now means that host on port 6379, instead of being silently replaced with the primary host (#1057)- rueidiscompat:
MigrateandClientPausesend their timeouts in milliseconds. Before, a 30sMigratetimeout was sent as 30ms (valkey-io/valkey-go#214)TSMRevRangesendsTS.MREVRANGEand returns the newest samples first. It sentTS.MRANGEbefore (#1053)TopKInfoandClusterShardsnow read RESP2 replies, for example withAlwaysRESP2: true(#1056)HRandFieldWithValuesreturns the fields and values over RESP2, instead of an empty result (#1045)ZPopMinandZPopMaxwithout a count return an empty result instead of an error when the key doesn't exist (#1047)XPendingreturns an empty summary instead of aredis nil messageerror when the group has no pending entries (#1043)IsCacheHit()now reports cache hits for commands that returnIntCmd, likeSCardandStrLen, orDurationCmd, likeTTL(#1033)
Tests & CI
- CI compares end-to-end benchmarks between each PR and its base, and charts
mainon gh-pages (valkey-io/valkey-go#190) - The pub/sub test no longer closes its channel while
Receivecallbacks are still running (#1049)
Contributors
We'd like to thank all the contributors who worked on this release!
@AdamMagued, @FZambia, @LindseyZ1205, @NotAFlightRisk, @PerryLink, @VardhamanViroje, @faustbrian, @freeformz, @g4lb, @gunreddyg-debug, @kumariam-ai, @ninadsutrave, @omanges, @pcbeingused333, @rueian, @yamamoto7, @youdie006 and @zhechen-cs