This is a patch release with bug fixes. It also adds one option to redisotel-native (WithClosedPoolSeriesRetention), which has a default and needs no change. Upgrading from 9.24.0 is a drop-in replacement. Note the behavior change of ScanIterator.Vals below (due to a bugfix).
🚀 Highlights
Large reply announcements no longer allocate up front
The RESP reader allocated a bulk reply with the length announced in its header. A server or proxy that announced a large length could make the client allocate that much memory before any data arrived. Replies up to 32 MiB are read as before. A larger reply now grows with the data that actually arrives. Above 32 MiB this costs more memory and time than a single allocation (fixes #4324) (#4343) by @PerryLink.
Closed pools are dropped from the connection metrics
In redisotel-native, the db.client.connection.count and db.client.connection.pending_requests series of a closed client were observed at 0 until the next Shutdown. With clients created and closed over the process lifetime, the observer and each collection grew without limit. A closed pool's series is now observed at 0 for a retention window, so every reader that collects in that window gets the final decrement, and is then dropped. The default window is 5 minutes. Set it with Config.WithClosedPoolSeriesRetention, above your longest export or scrape interval (#4442) by @ndyakov.
ScanIterator.Vals resumes from the iterator position
Vals started at the first value of the current page each time, so after Next/Val or after a break out of a range over Vals, a new Vals loop returned values again. Vals now shares its position with Next and Val and returns only the remaining values. Code that ranged over Vals a second time to read the same page again now gets nothing for the values already returned (fixes #4427) (#4428) by @xixi-box.
🐛 Bug Fixes
HotKeysStart: nil options returnErrHotKeysNoMetricsinstead of panicking (fixes #4434) (#4437) by @Dazhou-delJSONDebugMemory: implemented with anIntCmd; it panicked before. The key position is set, so a cluster client routes it by key. For JSONPath queries, which return an array, useDo(fixes #4433) (#4436) by @Dazhou-del- TimeSeries range filters: empty
FilterByTSandFilterByValueslices are omitted like nil inTS.RANGE,TS.REVRANGE,TS.MRANGEandTS.MREVRANGE, instead of sending an empty clause (fixes #4432) (#4435) by @Dazhou-del - TimeSeries selected labels: an empty
SelectedLabelsslice no longer sends a bareSELECTED_LABELSinTS.MGET,TS.MRANGEandTS.MREVRANGE(#4425) by @pcbeingused333 - Connection state machine: a transition to the closed state wakes every waiter with
ErrStateMachineClosed, instead of leaving it blocked until its context expires (#4430) by @xgbtxy - Push notifications:
VoidProcessorreturns aReadReplyerror in the middle of a frame, likeProcessor, so the connection is discarded instead of reading the rest of the frame as a reply (#4431) by @xgbtxy - Sentinel: the failover client subscribes to
+slave-reconf-doneagain. An earlier rename to+replica-reconf-donemeant it never received the event, because Sentinel still publishes the old name (#4387) by @ruziba3vich - Cluster replica reads: the replica picker is called once per read and then every replica is tried, so a repeated index can no longer hide a healthy replica (#4394) by @ruziba3vich
- Cluster with a
ClusterSlotsfunction: loopback node addresses are kept as given and no longer rewritten to:port(#4411) by @ruziba3vich RoundRobinPicker: the index stays in range on 32-bit platforms (#4409) by @ruziba3vich- Cluster and Ring
PoolStats: include the per-node Pub/Sub stats,UnusableandPendingRequests, likeClient.PoolStats(#4413) by @ruziba3vich - Maintenance notifications: the delay for a
MOVINGnotification without an endpoint keeps the half second for an oddtimeS(#4393) by @ruziba3vich redisoteltracing: each cluster node gets its own copy of the tracing options, so its spans no longer carry the server attributes of other nodes, and a data race inOnNewNodeis removed (#4412) by @ruziba3vichredisotel-nativeerror types: only a Redis server error is classified by its prefix. Errors such asio.EOFare reported as internal, and a server error wrapped by a hook keeps its prefix (#4395) by @ruziba3vichrediscmd:CmdStringredacts thesentinel-passvalue ofSENTINEL CONFIG SET(#4382) by @ruziba3vich
⚡ Performance
- Command metadata without CSC: a standalone client with
CommandMetadataPreferLiveand no client-side caching no longer starts a metadata worker or sendsCOMMANDin the background. The metadata store is built only when CSC attaches (#4424) by @wozhenbang2004
👥 Contributors
We'd like to thank all the contributors who worked on this release!
@Dazhou-del, @ndyakov, @pcbeingused333, @PerryLink, @ruziba3vich, @wozhenbang2004, @xgbtxy, @xixi-box
Full Changelog: v9.24.0...v9.24.1