This is a beta release. It follows 9.24.0-beta.1 with bug fixes, the ACLGetUser command and one change to retry behavior. Read the behavior changes before you upgrade.
⚠️ Behavior changes
- Command retries no longer replay a failed dial sequence: for clients without a custom
Dialer(single commands, pipelines,Watch,ConnandTx, the Sentinel client, Ring shards and cluster nodes),MaxRetriesno longer starts a newDialerRetriessequence on an endpoint where one has already failed. With default options a refused connection is now reported after about 0.4s, where it took about 1.7s before. Attempts on other cluster nodes or Ring shards are kept, and a customDialerkeeps its previous retry behavior.DialTimeoutstill applies to each attempt, so a dial that hangs is still bounded byDialTimeouttimesDialerRetries. A command that reaches an exhausted node or shard skips that address and keeps its bounded retries for the others, and a cluster client asks for a topology reload, so a replacement can be reached in the same call. An unpinnedSCANthat exhausts a node also falls back to the replicas thatReadOnlyrouting allows (#4304, #4331) by @xixi-box, issue #4329. - Negative
pool_size:ParseURL,ParseClusterURLandParseFailoverURLreject a negativepool_size, where they used to panic, and a negativePoolSizein the options structs selects the default (#4325) by @ump45nose. LimitOffsetwithoutLimitreturns a page of 10: a search that setsLimitOffsetand leavesLimitat 0 now returns up to 10 documents from that offset. On Redis 7 it returned an empty page before, so code that relied on the empty page now gets documents. On Redis 8 it was an error (#4285) by @kevin9327.Cmd.Uint64of a negative integer: it now returns an error, as it does for other out-of-range values, where it returned the wrapped value (for exampleDECRgiving 18446744073709551615). Callers that read a signed 64-bit reply as unsigned, for exampleBITFIELD GET i64throughUint64Slice, now get an error (#4369) by @ruziba3vichFT.HYBRIDCOMBINE LINEARsendsWINDOW:FTHybridWithArgssendsWINDOWforLINEARas well as forRRF. Before, aWindowset together withLINEARwas silently ignored. It now takes effect (#4379) by @ruziba3vich
✨ New Features
ACLGetUser: returns anACLUserwith the flags, passwords, command, key and channel rules and the selectors of a user, for Redis 7.0 and later. A missing user returnsredis.Nil.CmdablegainsACLGetUser, so a custom implementation such as a mock must add it (#4357) by @ruziba3vich- Idle connection reaper:
ConnMaxLifetimeReapInterval(onOptions,ClusterOptions,FailoverOptions,RingOptionsandUniversalOptions, andconn_max_lifetime_reap_intervalin URLs) starts a background goroutine that closes idle connections pastConnMaxLifetimeorConnMaxIdleTimeand refills the pool towardMinIdleConns, so expired connections are closed off the request path. It is off by default. When it is on, it also closes connections that were idle longer thanConnMaxIdleTime, 30 minutes by default. Connections in use, and connections that a re-auth or handoff worker owns, are skipped, and a refill towardMinIdleConnsadds dials at low concurrency (#4334, #4340) by @ndyakov ClusterSlotStatsandClusterSlotStatsOrderBy:CLUSTER SLOT-STATSwith a slot range orORDERBY, for Redis 8.2 and later. On aClusterClient,MultiDBClientandAutoPipelinerthe call asks every master and merges the replies, so the result covers the whole cluster and the top slots are global, as withDBSize. A pipeline still sends the command to one node. The slot metrics beyond the key count needcluster-slot-stats-enabled yeson the servers.ClusterCmdablegains the two methods, so a custom implementation such as a mock must add them (#4358) by @ruziba3vich
🐛 Bug Fixes
- Credential rotation with
MaxActiveConns: at theMaxActiveConnscap,Getnow waits withinPoolTimeoutfor an idle connection that is re-authenticating, and does not fail withErrPoolExhausted. Without a cap, or with room under it, the behavior is unchanged (#4313) by @xixi-box, issue #4311. A race at the cap, where the only connection finished re-authentication just before the capacity check, is closed by the same release (#4333) by @Tidehyc, issue #4332 ContextDeadlineError: a read timeout that arrives together with data no longer reaches the next command, and a socket timeout that fires slightly before the context deadline is still reported ascontext.DeadlineExceeded. This follows #4263 from 9.24.0-beta.1 (#4306) by @PerryLink, issue #4305- Search:
LimitOffsetwithoutLimitinFT.SEARCHandFT.HYBRIDoptions now uses the default page of 10. On Redis 8 the command was rejected withSEARCH_LIMIT_OVER(#4285) by @kevin9327, issue #4284 GEOSEARCHwithoutWITHflags:GeoSearchLocationno longer fails with a parse error when the query sets none ofWithCoord,WithDistandWithHash. The locations come back with onlyNameset (#4335) by @ruziba3vichBF.INFOof a non-scaling filter:BFInfoandBFInfoExpansionno longer fail withredis: nilfor a filter created withNONSCALING.ExpansionRateis 0 (#4336) by @ruziba3vich- JSON replies to a legacy path:
JSONObjLen,JSONStrLen,JSONStrAppendandJSONToggleno longer fail when the path does not start with$, and neither doesJSONTypewith RESP2. Before,JSON.STRAPPENDandJSON.TOGGLEhad already changed the document when the error was reported (#4337) by @ruziba3vich JSONNumIncrBywith RESP3: a path that matches values that are not numbers no longer fails withredis: nil.Val()returns the same string as with RESP2, for example[null,7], so code that usedredis.Nilto mean "no numeric match" now gets[null](#4338) by @ruziba3vich- Cluster redirects to an IPv6 address with a dotted quad: a
MOVEDorASKreply that points to an IPv6 address ending in a dotted quad, such as::ffff:10.0.0.1, is now dialable. The address is bracketed like any other IPv6 address (#4350) by @ruziba3vich HELLOpassword in traces and logs:rediscmd.CmdStringnow redacts theHELLOpassword whenAUTHcomes afterSETNAME. Before, aHELLOsent throughDoin that order showed the password in clear text in tracing and logging hooks built onrediscmd(#4348) by @ruziba3vichFT.HYBRIDwithShardKRatio:SHARD_K_RATIOis now counted in theKNNargument block, so the server accepts the command and no longer answersUnknown argument(#4353) by @ruziba3vichFT.HYBRIDCOMBINE LINEARweights: setting onlyAlphaor onlyBetano longer fails withMissing value for BETA. Both are sent when either is set, the unset one as 0 (#4354) by @ruziba3vich- Empty
Paramsmap in search:FTSearchWithArgs,FTAggregateWithArgs,FTSearchQueryandFTAggregateQueryno longer sendPARAMS 0for an empty, non-nil map, which the server rejected (#4355) by @ruziba3vich - Ring shards that share an address:
SetAddrsno longer leaks a client on each call when two shard names point to the same address. Every shard is now reused or closed (#4356) by @ruziba3vich MAXTEXTFIELDSinFT.CREATE:FTCreatewithMaxTextFieldsset now sendsMAXTEXTFIELDSas a bare flag, so the server accepts it and no longer answersUnknown argument(#4344) by @ruziba3vich- Disabled cluster options: a
-1retry backoff set onClusterOptionsnow reaches the node clients (#4345), and reusing one*ClusterOptionsfor a second client no longer turns disabled options (MaxRedirects, timeouts, retry backoff) back into their defaults (#4360) by @ruziba3vich FT.INFOon RESP2:FTInforeadsindex_definitionby key, soDefaultScoreand the other definition fields are correct and a short array no longer panics (#4347) by @ruziba3vich- JSON array commands on a legacy path:
JSONArrLen,JSONArrAppend,JSONArrIndex,JSONArrInsert,JSONArrTrimandJSONArrPopno longer fail to parse when the path does not start with$, and one such reply no longer shifts the replies of the commands after it in a pipeline (#4359) by @ruziba3vich JSONArrTrimarguments: the command is now sent with bothstartandstop, defaults 0 and -1, which keep the whole array. Before, the server rejected every call with a wrong number of arguments (#4361) by @ruziba3vichnet.IPfields in struct scan:HGetAll(...).ScanandHMGet(...).Scanread anet.IPthatHSetstored as raw bytes, where they failed withinvalid IP address. Text is tried first, so values that scanned before scan the same, and a 4 or 16 byte value that is not IP text now scans as a raw IP (#4362) by @ruziba3vich- Pointer arguments in command strings:
Cmd.String()andrediscmd.CmdStringprint the value of a pointer argument to a predeclared type ortime.Time, where they printed an address. The redaction of secrets such asCONFIG SET requirepassnow also covers a keyword or password passed behind a pointer or as a named string (#4363) by @ruziba3vich MaxRetriesorMaxRedirectsbelow -1: any negative value now means one attempt with no retries, the same as -1. Before, a value such as -2 skipped the retry loop, so aClientpipeline or transaction, aRingcommand, and aClusterClientcommand, pipeline or transaction were never sent and the call returned a nil error (#4349) by @ruziba3vichCF.SCANDUMPlast chunk:CFScanDumpno longer fails withredis: nilon its last call, where the server returns iterator 0 and a null chunk (#4366) by @ruziba3vichBF.INFOwith an option: a single-optionBF.INFO(capacity, size, items, filters, expansion) no longer fails withunexpected key, whatever case the server uses for the field name (#4368) by @ruziba3vichFT.SEARCHnull field on RESP2: a returned field that is a stored JSON null no longer fails the whole search withinvalid field value format. RESP2 now behaves like RESP3 (#4370) by @ruziba3vichFT.INFOTAG separator on RESP2: a TAG field with the separatormorMno longer swallows the next flag, soSortableandCaseSensitiveare kept (#4371) by @ruziba3vich- Cluster
max number of clientserror:shouldRetryandIsMaxClientsErroralso match the cluster wordingmax number of clients + cluster connections reached(#4367) by @ruziba3vich FCallwith slice arguments:FCallandFCallROexpand a[]stringor[]interface{}argument into separate function arguments, where they failed with a marshal error. A lonenilis still sent as one empty argument (#4365) by @ruziba3vichCloneof finished commands:XInfoStreamFullCmd.Clonekeeps all fields, including the idempotency fields, and no longer shares the pending storage of its groups and consumers (#4372). The vector set slice commands copy their result slice instead of sharing it with the original (#4373). Empty results stay empty.FunctionStatsCmd.Clonealso copies the command of the running script instead of sharing it (#4378). Clones ofXMessageSliceCmd,XStreamSliceCmd,XInfoStreamCmd,ClientInfoCmd,ACLLogCmdandFTSearchCmdkeep every field of the value, such as theXREADGROUPclaim fields, the idempotency fields, theClientInfonetwork and command totals andDocument.Error, where they dropped them before (#4346). By @ruziba3vich- Slice arguments in Bloom, Cuckoo and Count-Min commands:
BFInsert,BFMAdd,BFMExists,CFInsert,CFInsertNX,CFMExistsandCMSQueryexpand a single[]stringor[]interface{}of elements, where they failed with a marshal error. Other arguments, including[]byteandnil, are sent as before (#4377) by @ruziba3vich
🧪 Testing & Infrastructure
- Documentation: doc link definitions in the set and search command comments now render as links on pkg.go.dev (#4328) by @farisbasha
- End-to-end failure scenarios: the e2e suites cover connection failures (dropped, refused, timed out) for regular, pub/sub, blocking and mixed workloads,
MultiDBClientfailover on member outage and on slow responses, and standalone topology changes. The fault-injector client gainsproxy_failure, BDB-scopednetwork_latencyand the/topology-change-standaloneroutes (#4352)
👥 Contributors
We'd like to thank all the contributors who worked on this release!
@farisbasha, @kevin9327, @PerryLink, @ruziba3vich, @Tidehyc, @ump45nose, @xixi-box
Full Changelog: v9.24.0-beta.1...v9.24.0-beta.2