Repository navigation
Changes
Requirements
- Go 1.26: every module now declares
go 1.26.0, so Go 1.26 or newer is required (redis/rueidis#1062)
Features
- valkeygcp: 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 (#215) StartandStopforZRANGEandZRANGESTORE: the command builders now offer.Start().Stop(), the argument names in the currentZRANGEdocs, alongside.Min().Max()(redis/rueidis#1035)- valkeycompat: added
XNack(#199), andWaitandWaitAOF(#202)
Performance
CacheMarshalandCacheSizeno longer allocate once per array element.CacheMarshalon a 100-element array is about 75% faster (redis/rueidis#1055)- RESP lengths are written with
strconv.AppendIntinstead of float math, 15–27% faster in micro-benchmarks (redis/rueidis#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 (#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 (redis/rueidis#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 (#205) Closeno longer hangs when another call is waiting on the same connection (redis/rueidis#1050)- After
Close, the cluster client'sDo,DoMulti,DoCacheandDoMultiCachereturnErrClosinginstead of a rawMOVEDorASKerror (redis/rueidis#1037) ValkeyResultStream.WriteTonow closes the connection when the destination writer fails during a chunked response, instead of returning it to the pool with unread chunks (redis/rueidis#1040)- Closed connections stop their lifetime timers, so retired connections and their buffers are freed right away instead of at the original lifetime deadline (#206)
ParseURLreads a trailing slash with no database number, likevalkey://localhost:6379/, as DB 0 (redis/rueidis#1042). Anaddr=value without a port now means that host on port 6379, instead of being silently replaced with the primary host (redis/rueidis#1057)- valkeycompat:
MigrateandClientPausesend their timeouts in milliseconds. Before, a 30sMigratetimeout was sent as 30ms (#214)TSMRevRangesendsTS.MREVRANGEand returns the newest samples first. It sentTS.MRANGEbefore (redis/rueidis#1053)TopKInfoandClusterShardsnow read RESP2 replies, for example withAlwaysRESP2: true(redis/rueidis#1056)HRandFieldWithValuesreturns the fields and values over RESP2, instead of an empty result (redis/rueidis#1045)ZPopMinandZPopMaxwithout a count return an empty result instead of an error when the key doesn't exist (redis/rueidis#1047)XPendingreturns an empty summary instead of avalkey nil messageerror when the group has no pending entries (redis/rueidis#1043)IsCacheHit()now reports cache hits for commands that returnIntCmd, likeSCardandStrLen, orDurationCmd, likeTTL(redis/rueidis#1033)
Tests & CI
- CI compares end-to-end benchmarks between each PR and its base, and charts
mainon gh-pages (#190) - The pub/sub test no longer closes its channel while
Receivecallbacks are still running (redis/rueidis#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