v5.3.0
This release contains new features, improvements and bug fixes.
- US-2005 Transparent color stops in creator gradients via
NewColorPointWithAlphaandAddColorStopWithAlphaonLinearShadingandRadialShading, withtransparent,#rgbaand#rrggbbaastops in templates andstop-opacityin SVG - US-1853 Long-term validation of signatures: a trusted later document timestamp serves as proof of existence, so signatures and timestamps it covers that no longer validate at the current time are validated at the time of that timestamp
- US-1962
Creator.DrawTaggedfor tagging creator content under caller-built structure elements, and the new publicmodel/tagcheckpackage for checking tagged-PDF structure - US-1828 Loading template fonts, images and subtemplates from an
fs.FSviaTemplateOptions.FSandTemplateOptions.SubtemplatePatterns, with placeholders drawn for missing resources - US-1829 Template tags
<document>(page size, orientation, margins, language and title),<toc>,<header>and<footer> - US-1830 Built-in template helpers for numbers, dates, strings and data, such as
formatNumber,formatCurrency,formatTime,truncateanddefault - US-1831 Template tags
<svg>,<grid>,<polygon>,<polyline>,<curve>and<bezier-curve>, and more component setters exposed as template attributes - US-1917 Template tags
<br/>for line breaks and<pre>for preformatted text - US-1832
TemplateOptions.HTMLEntitiesfor HTML named entities in templates, and a documented guarantee that aParsedTemplatecan be rendered concurrently into different creators
- US-1854 Signature validation checks revocation on every certificate chain instead of only the first, and the new
SignatureValidationOpts.StrictCARevocationtreats any CA certificate revocation other than a hold as revoking every chain through that CA key - US-1821 Rebuilt creator auto tagging so marked content and the structure tree come from one source: invoices are now tagged, and charts and SVGs without alternate text are marked as artifacts
- US-1982 Manually tagged content is linked to its pages, so tagged output no longer has missing
/Pg, missing/StructParentsor shared/StructParentskeys - US-1834 The renderer pools transparency group buffers and composites only the painted region
- US-1863 Template execution errors name the template file instead of reading
executing "" - US-1919 FDF loading resolves indirect references in field entries and values
- US-1838 US-2059 The metered license state file is written atomically and locked across processes, so concurrent processes no longer lose each other's usage counts, and it keeps its group when replaced
- US-2001 UniPDF builds no longer link
testing, testify or yaml: the JBIG2 test helpers moved out of the library andgithub.com/unidoc/pkcs7was upgraded to v0.4.2 - US-2069 Upgraded
github.com/unidoc/pkcs7to v0.5.0 - US-2093 Removed the
golang.org/x/netdependency to clear its advisories on Go 1.25; SVG charset decoding now usesgolang.org/x/text
- US-1965 US-1973 US-1984 US-1995 US-1996 US-1997 Fixed small pages being able to allocate without bound through repeated inline images, image XObjects, masks,
/Contents, shared ICC profiles, JBIG2 globals and font streams: these now decode once per page and count toward a new per-page limit of 1 GiB by default, configurable viaReaderOpts.MaxDecodedPageSize,ParserOpts.MaxDecodedPageSizeandcore.SetDefaultMaxDecodedPageSize - US-1985 Fixed a page that draws one image XObject many times taking minutes to render
- US-1977 US-2007 Fixed DocMDP validation being bypassable by rewriting the certification in a later revision: validation now uses the certified level from the signed revision and rejects any change that level does not allow
- US-1976 Fixed document timestamps silently truncating a timestamp token larger than the size probe; signing now writes the full token or fails
- US-1991 Fixed LTV enabling never returning for a signer certificate that is self-signed but not a CA
- US-2067 Fixed
PdfAppendersignatures on encrypted PDFs being invalid in Acrobat - US-1994 Fixed a fatal stack overflow on an ICCBased colorspace whose
/Alternaterefers back to itself, and on Type 3 functions that refer back to themselves - US-1792 Fixed
Names.ToPdfObjectdropping every name tree exceptEmbeddedFileson write - US-1961 Fixed gradient shading ignoring the positions of the first and last color stops
- US-2006 Fixed SVG gradients being mapped over the whole SVG instead of the filled shape
- US-1931 Fixed flattened combo boxes disappearing when their value has non-ASCII text such as umlauts
- US-1935 Fixed the metadata stream being encrypted when
EncryptMetadatais false - US-1936 Fixed
GetPreviousRevisionfailing on a reader decrypted manually withDecryptorDecryptWithCertificate - US-1956 Fixed encryption overriding a higher PDF version set with
SetVersion, and AESV2 encryption now reports PDF 1.6 - US-2064 Fixed text copied from UniPDF output being garbled in Acrobat and Preview with some fonts, caused by ToUnicode ranges outside the ISO 32000 limits
- US-2063 Fixed characters defined in
cidcharblocks of predefined CMaps such as UniJIS-UTF16-H extracting as U+FFFD - US-1920 Fixed the FDF parser rejecting any FDF file that contains a stream
- US-2016 Fixed the extractor font cache evicting in load order instead of least recently used, and
Tfignoring an invalid font size
9.24.0
This is a minor release. It contains everything from 9.24.0-beta.1 and 9.24.0-beta.2, so these notes cover the full 9.23.0 → 9.24.0 upgrade. The release adds:
- Redis 8.12 support: set member expiration,
ZMOVE,BITRANGEINTARRAY,CF.COMPACT, scalar-quantized HNSW,BLESSand more, tested against Redis 8.12.0. - The experimental MultiDB client for Active-Active (Redis Enterprise) failover.
- Metadata-driven cluster routing and client-side caching (CSC) eligibility that come from the
COMMANDmetadata. - CSC OPT-IN / OPT-OUT tracking modes, CSC on
ClusterClient, and CSC withEphemeralConn. - A per-client
OTelRecorder, MultiDB metrics inredisotel-native, and much less OpenTelemetry cost on the hot path. - New full-duplex options (
FullDuplexPipes,PipelineMinIdleConns) and a cluster recovery fix for full-duplex sessions. - An opt-in idle connection reaper,
ACLGetUser,ClusterSlotStatsand the Redis 8.10BACKUPcommands. - Many fixes for connections, cluster routing, authentication, reply parsing, and the search, JSON and probabilistic commands.
This release adds the new commands and options of Redis 8.12 and runs its tests against Redis 8.12.0 (#4404).
- Set member expiration:
SExpire,SPExpire,SExpireAt,SPExpireAt(each withWithArgs),STTL,SPTTL,SExpireTime,SPExpireTime,SPersist,SAddEXandSAddEXWithArgs(#4165) by @ndyakov. - Sorted sets and bitmaps:
ZMOVE,BZMOVEandZMOVEMEMBER(#4289), andBITRANGEINTARRAY(#4242) by @ndyakov. - Probabilistic and search:
CF.COMPACTasCFCompact(#4243) by @ndyakov.CELL_SIZEforCMS.INITBYDIMandCMS.INITBYPROB(CMSInitByDimCellSize,CMSInitByProbCellSize) (#4023), and scalar-quantized HNSW indexes inFT.CREATEwith the two newFT.INFOfields (#4077) by @vlady-kotsev.RERANKforFT.HYBRID, theBITRANGEINTARRAYoptions and the new command metadata (#4277) by @ndyakov. BLESS:BLESS GET,BLESS SET,BLESS CLEARandBLESS SCANfor theNO-EVICTflag (#4041) by @vlady-kotsev.BlessScanis node-local: scan each master of a cluster or ring.
NewMultiDBClient routes commands to one active database out of several standalone or cluster members (e.g. Redis Enterprise Active-Active) and fails over based on circuit breakers, health checks and a weight-based failover strategy, with auto-fallback to higher-weight members. The multidb package adds ping and lag-aware health checks and probe policies. See example/multidb (#3954) by @ndyakov. Defaults:
- MultiDB owns retries:
CommandRetries(0 = 2, -1 = none) retries on the database active at each attempt, and every attempt is counted by the breaker and failure detector. Standalone members get no retries of their own (MaxRetries0 becomes -1); an explicitMaxRetriesis kept. - Health checks: HEALTHY_ALL, 3 probes 500ms apart per check, honoring
multidb.WithProbes/WithDelay/WithTimeout;HealthCheckTimeout(3s) caps the pass. Probes that cannot fit it are rejected at construction and byAddDatabase. Under the default policy,SetActiveDatabaseandProbeTargetBeforeFailoveruse one probe per check. - Startup:
InitialDBStateMajorityAvailableneeds half the members, rounded up (1 of 2). A failed start matchesErrInsufficientHealthyDatabases; with no healthy member it also matchesErrPermanentlyNotAvailable. - Weights are in (0, 1] (0 = 1.0); -1 disables a member. The last enabled member cannot be disabled.
- The default failure detector (1000 failures and 10% within 2s) is set with
FailureDetectorConfig, whose fields are used as given; start fromDefaultMultiDBFailureDetectorConfig(). redisotel-nativereports MultiDB events (failover, active database change, circuit breaker state change, health check) in a newmultidbmetric group,MetricGroupFlagMultiDB, whichMetricGroupAllincludes (#4007) by @ndyakov.- A member
ProcessHookthat returnsnilwithout callingnextis no longer counted as a healthy database response (#4271), and a local result of a member hook in a cluster pipeline is kept when another node fails (#4279) by @harshitdeora. Full-duplex outcomes are recorded in the failure window after the active member is selected again (#4283) by @xixi-box.
Experimental: the MultiDB API can change in a minor release. User hooks and health checks must not call MultiDB control methods or Close.
Cluster routing and CSC use the same resolved COMMAND record for each command, so flags, key positions and policies cannot drift between two metadata sources (#3960, #4093) by @ofekshenawa.
- Existing default routing and the cluster-wide
DBSize,ScriptLoad,ScriptFlushandScriptExistshelpers are preserved. InstallNewCommandMetadataResolver()orclient.NewDynamicResolver()withSetCommandInfoResolverto enable metadata-based fan-out and aggregation.CommandMetadataconfiguration alone does not enable them. Cross-slot fan-out is not atomic. - With metadata routing enabled, cross-slot
MGETfollows redirects for each affected slot during resharding instead of returning a missing value for a key that moved. Successful slot groups are not replayed, and fan-out replies that containMOVEDorASKrefresh the topology for later commands. - Explicit pipelines and transactions keep node-local execution; ordered
AsyncAutoPipelinerejects fan-out before dispatch. Automatic fan-out is available through the blocking face or unordered half-duplex mode.SCAN,INFOand known diagnostics stay node-local. - Numeric sum/min/max fan-out keeps integer replies as exact
int64results, including rawDoresults; integer overflow returns an error. Aggregates with floating-point replies returnfloat64. - Resolved command key specifications take precedence over
SetFirstKeyPos. Commands missing from the snapshot keep the legacy key-position fallback; setCommandMetadataPreferLiveorCommandMetadataConfig.Overridesfor full metadata. The defaultCommandMetadataStaticmode does no network lookup unless resolution reaches an installedNewDynamicResolver. Identity probes have bounded deadlines, and after a failure or invalidation commands use conservative metadata while verification retries in the background. - Topology loading prefers
CLUSTER SHARDSand falls back toCLUSTER SLOTS, and concurrent reloads share one in-flight load. Keyless routing prefers healthy nodes without excluding every candidate on a temporary local marker.ErrClusterTopologyUnhealthysupportserrors.Is, and unknown response policies return an error. FT.CURSOR READis no longer retried after a lost reply, on standalone and cluster clients, because the server may already have advanced the cursor.- A
SCANiterator on aClusterClientnow visits every master. Before, it sent each page to a random node with the cursor of another node and could end early without an error (#4200) by @ndyakov. - With the dynamic resolver,
DEL,EXISTS,TOUCHandUNLINKon several keys of one slot returned the per-slot count multiplied by the number of keys in that slot. They now count each slot once (#4141) by @lazerg.
Experimental: the CSC options can change in a minor release.
- OPT-IN and OPT-OUT tracking modes:
Options.ClientSideCacheTrackingModeselectsTrackingModePlain(default),TrackingModeOptInorTrackingModeOptOut.Options.ClientSideCacheableis a predicate that selects the eligible unmarked calls, andWithCache(ctx)/WithoutCache(ctx)mark one call. The mode works with miss coalescing, refresh on invalidate, pipelines, autopipeline and cluster fan-out. With CSC on, the native full-duplex engine leases only the untracked pipeline pool and does not use the main pool (#4193) by @ofekshenawa. - CSC on
ClusterClient: each node client has its own cache, shared by its connection pool, with per-node capacity limits.ClusterOptions,UniversalOptionsandNewFailoverClusterClientaccept the CSC options, andCSCStats()andCSCRefreshStats()add up the registered nodes. The client does not store a reply that cannot prove that every key it depends on exists. A MOVED or ASK redirect bypasses the cache, and a topology change flushes only the caches of nodes that enter or leave routing. Replica reads, ordinary pipelines, transactions and full-duplex batches stay uncached (#4080) by @ofekshenawa. - Ephemeral connections with client-side caching: with CSC active,
EphemeralConnlazily dials a fresh, untracked connection. Session commands are allowed without disrupting the parent cache, and reads always go to Redis. The connection takes noPoolSizeturn, does not support maintenance handoff, and must be closed after use. Without CSC, idle-connection reuse is unchanged (#4174) by @aditya-rai-5.
AutoPipelineOptions.FullDuplexPipessets the number of full-duplex pipes (held connections) on a standaloneClient. 0 means 1.NumShards > 1underFullDuplexstill selects that number whenFullDuplexPipesis 0, butFullDuplexPipesis the preferred name.Config().FullDuplexPipesreports the effective count. On a cluster, a full-duplex autopipeliner keeps one pipe for each master (#4107) by @ndyakov.- Warm spare connection:
Options.PipelineMinIdleConns(default 0,pipeline_min_idle_connsin URLs) sets the minimum idle connections of the dedicated pipeline pool, and is available onClusterOptions,RingOptions,FailoverOptionsandUniversalOptions. A full-duplex engine keeps one idle spare, so a replacement for a failed held connection does not wait for a TCP or TLS dial. The spare is dialed but not initialized:HELLOandAUTHstill run on the first lease (#4101) by @ndyakov. - Cluster recovery: when the session of a node engine drops, the unacknowledged commands now go through the cluster router, so they reach the new owner of the slot. Before, they were replayed only on a new connection to the same node and failed if that node was closed or replaced (#4111) by @ndyakov.
Two groups of changes remove most of the cost of the redisotel-native metrics on the hot path.
- Full duplex: it lost about 90% of its throughput. In one test with 256 callers and 64 commands in flight on a local Redis,
GETthroughput went from about 190k/s on v9.23.0 to about 2.1M/s (about 2.0M/s with OTel off). The gain depends on RTT, the number of commands in flight and the CPU, so expect a smaller effect on a remote Redis. The full-duplex reader reads its goroutine id once for each session, andRecordOperationDurationuses a bounded attribute cache and a queue for the success path (#4269) by @ndyakov. - Pool metrics:
db.client.connection.countanddb.client.connection.pending_requestsare now observed at collection time from the pool statistics, and no longer updated on everyGetandPut. The measurement options of the pool and command metrics are cached, and the global recorder is read without a lock. In one in-memory test (500 connections, 128 workers, all metric groups on) a command ran at 165k ops/s before, 678k with the observed connection count, 895k with the cache, and about 1.05M with the observed pending requests (1.21M with OTel off).InitandShutdownwith 10k connections went from about 7.4 ms to 0.13 ms and 0.011 ms. Over a real Redis there is no measurable difference between OTel on and off (#4406, #4407, #4408) by @ndyakov.
Each client can have its own metrics recorder. Set OTelRecorder in Options, ClusterOptions, RingOptions, FailoverOptions, UniversalOptions or MultiDBOptions. The client sends its commands, pipelines, errors, cluster redirects, Pub/Sub messages, stream lag, and pool and connection events to it. Cluster nodes, ring shards, sentinel clients and MultiDB members use the recorder of their parent. Clients without it use the recorder from redis.SetOTelRecorder, as before. In redisotel-native, NewRecorder makes a recorder with its own WithCustomAttributes, which take precedence over the attributes of the global Init config (#4179) by @vladvildanov.
inst := redisotel.GetObservabilityInstance()
_ = inst.Init(redisotel.NewConfig().WithEnabled(true).WithMeterProvider(provider))
defer inst.Shutdown()
acmeRec, _ := inst.NewRecorder(redisotel.NewConfig().
WithCustomAttributes(attribute.String("tenant", "acme")))
acme := redis.NewClient(&redis.Options{Addr: "acme:6379", OTelRecorder: acmeRec})
ConnMaxLifetimeReapInterval (on Options, ClusterOptions, FailoverOptions, RingOptions and UniversalOptions, and conn_max_lifetime_reap_interval in URLs) starts a background goroutine that closes idle connections past ConnMaxLifetime or ConnMaxIdleTime and refills the pool toward MinIdleConns, 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 than ConnMaxIdleTime, 30 minutes by default. Connections in use, and connections that a re-auth or handoff worker owns, are skipped, and a refill toward MinIdleConns adds dials at low concurrency (#4334, #4340) by @ndyakov.
BACKUP START,SEAL,ABORT,CLEANUPandSTATUSfor Redis 8.10 (#4286) by @Purv-Kabaria.ACLGetUserreturns 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(#4357) by @ruziba3vich.ClusterSlotStatsandClusterSlotStatsOrderByrunCLUSTER 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 (#4358) by @ruziba3vich.
Check these when you upgrade from 9.23.0:
- 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. ContextDeadlineErrorfor socket timeouts that come from a context deadline (#4263) by @aditya-rai-5. WithContextTimeoutEnabled: true, a socket timeout caused by the deadline of the caller's context now matchescontext.DeadlineExceededwitherrors.Is, and still matchesnet.ErrorwithTimeout() == true. The complete original transport error stays in the chain. Such an error is no longer retried, because the context has already expired, and its message starts withcontext deadline exceeded:. 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(#4306) by @PerryLink, issue #4305.WithTimeoutkeeps hooks: a client returned byWithTimeoutnow runs the hooks of its parent. Before, it dropped them, so hooks added withAddHookdid not run for commands, pipelines and transactions on that client (#4095) by @CaliLuke.- CSC eligibility comes from the
COMMANDmetadata and fails closed (#3960) by @ofekshenawa. An unknown, malformed, blocking, nondeterministic or script-based command runs as usual but is not cached.JSON.MGETandTS.INFOare no longer cached by default. With CSC enabled, more eligible commands can be cached in the defaultStaticmetadata mode (theBF.*,CF.*,TOPK.*,TDIGEST.*,V*andAR*families,CMS.QUERY,EXPIRETIME,PEXPIRETIME,HEXPIRETIME,HPEXPIRETIME,PFCOUNT,SDIFFCARD,SUNIONCARD,ZINTERCARDand others).Command()results now also contain subcommand entries namedparent|child, for exampleclient|id. When built-in CSC is on, a rawCLIENT CACHINGcommand is rejected, like the other commands that change connection state (#4193) by @ofekshenawa. - Connection-pool limits and dials:
MaxActiveConnsnow counts all connections registered with the pool (pooled, excess, and dedicatedNewConnconnections) plus in-flight dial reservations. Before, admission checked only the pooled count, so clients with this limit can now receiveErrPoolExhaustedfromNewConn/EphemeralConnor during bursts that previously exceeded it.NewConnnow waits for the sharedMaxConcurrentDialslimit and honors context cancellation while waiting, and idle prewarming shares this limit without holding a pool turn. These changes apply to all clients using the pool, not only CSC ephemeral sessions (#4174) by @aditya-rai-5. - Struct scan on a bad field:
ScanonHGETALL/HMGETresults used to stop at the first field that failed to decode, and withHGETALLthe set of filled fields was random. It now sets every field it can decode and still returns an error. When several fields fail, their errors are joined witherrors.Join, in key order forHGETALLand argument order forHMGET, soerrors.Isanderrors.Asmatch each of them. For the built-in types, a field that fails to decode keeps its previous value. A custom decoder (ScanRedis,UnmarshalTextorUnmarshalBinary) runs on the existing field and can leave a failed field changed. Code that reuses the struct after an error will see more fields set (#4136 by @lazerg, #2255 by @cpoole, #4294 by @Avv123). - URL and option validation:
ParseURL,ParseClusterURLandParseFailoverURLnow reject negativedialer_retry_timeout,read_buffer_sizeandwrite_buffer_sizevalues, and a negativepool_size, which used to panic. Replace negative retry timeouts with0for no delay, or omit the parameter for the default 100 ms delay; an explicitdialer_retry_timeout=0now disables the delay (#4144) by @Samuel-Sorial. A negativePoolSizein the options structs selects the default (#4325) by @ump45nose.ParseURLandParseFailoverURLalso reject a negative database number (#4275) and a plain-second duration that overflowsint64nanoseconds (#4276) by @ump45nose. A disableddial_timeout(0or a negative value in the URL) now means no dial deadline. Before, every dial failed at once (#4168) by @PerryLink. - Empty password with a username (opt-in): a
Usernamewith an emptyPasswordsends noAUTH, the same as 9.23.0. To authenticate an ACL user created withnopass, setAuthEmptyPassword: true(orauth_empty_password=truein the URL); for sentinel connections useSentinelAuthEmptyPassword(sentinel_auth_empty_password=true). The rule also applies to credentials fromCredentialsProvider,CredentialsProviderContextandStreamingCredentialsProviderused when a connection is set up; re-authentication on a credentials refresh is unchanged. Redis Enterprise and Redis Cloud databases with unauthenticated access can reject an empty password, which is why this is opt-in. The client-side cache keeps a separate namespace for a username that sends noAUTH(#4161 by @saddamr3e, #4194 by @ndyakov). - Ring telemetry:
redisotel.InstrumentTracingandInstrumentMetricsnow instrument existing shards. Remove any per-shard instrumentation workaround when instrumenting the ring to avoid duplicate spans and metrics (#4227) by @nk-batman21. - OpenTelemetry metrics:
db.client.connection.countanddb.client.connection.pending_requestsare now asynchronous instruments, so views or selectors keyed on the instrument kind match them differently. A series that exists is reported at every collection, and the series of a closed pool stay at 0 untilShutdown.OTelConnectionCounter.RecordConnectionCountis no longer called and is deprecated; a custom recorder that built its own count from it should implementOTelPoolRegistrarand readPoolStats()(#4406, #4408) by @ndyakov. Inredisotel-native, only a server error reply getsredis:<PREFIX>aserror.type, theservercategory anddb.response.status_code. A closed connection (io.EOF) is noweofin thenetworkcategory with no status code, and a server error wrapped by a hook keeps its prefix (#4391) by @ruziba3vich. - Full-duplex clients keep one idle spare connection: a full-duplex engine raises
MinIdleConnsof its pipeline pool to 1, so the pool holds one extra idle connection for each client (for each node on a cluster). SetPipelineMinIdleConnsto a negative value to opt out (#4101) by @ndyakov. - Replies nested deeper than 1000 levels fail: the RESP reader returns an error for a reply with more than 1000 levels of nested aggregates or attributes, instead of exhausting the stack (#4296) by @xixi-box.
Script.Loadkeeps the client-computed SHA-1: aScriptmade withNewScriptno longer takes the digest from theSCRIPT LOADreply, so a server that replies with another digest cannot redirect laterRun/RunROcalls.NewScriptServerSHAstill uses the server digest (#3943) by @saddamr3e.PubSub.Channelmisuse does not panic: callingChannelandChannelWithSubscriptionson onePubSubnow returns a closed channel and logs a warning.Ring.Subscribe,PSubscribeandSSubscribewith no channels, or a failed shard lookup, return aPubSubthat carries the error (#3968) by @VedantMadane.- Search,
Cmdand return values: a search that setsLimitOffsetand leavesLimitat 0 now returns up to 10 documents from that offset. On Redis 7 it returned an empty page before, and on Redis 8 it was an error (#4285) by @kevin9327.FTHybridWithArgssendsWINDOWforCOMBINE LINEARas well as forRRF, where aWindowwithLINEARwas ignored (#4379) by @ruziba3vich.Cmd.Uint64of a negative integer returns an error, where it returned the wrapped value (#4369) by @ruziba3vich.XInfoStreamFullreports a-1consumer-group lag when Redis replies with a nil lag (#4217), andClusterClient.ScriptFlushreturnsOK(#4252) by @LindseyZ1205. - New interface methods:
Cmdable,ClusterCmdableand their sub-interfaces gain methods for the new commands (ACLGetUser,ClusterSlotStats,ClusterSlotStatsOrderBy, the 8.10 and 8.12 commands andBlessCmdable). This is the usual way go-redis adds commands. A custom type that implements these interfaces, for example a mock, must add the methods.
FT.AGGREGATEsteps:FILTERandLIMITare now steps inFTAggregateOptions.Steps, so you can filter beforeGROUPBY, filter more than once, and placeLIMITbetween steps.AggregateBuildergetsLimit(). The old tail fieldsFilterandLimitOffset/Limitstill work, are sent after all steps, and are deprecated in favor of steps (#4076) by @ndyakov- Per-stream IDs for
XRead:XReadArgs.IDsgives one ID for each stream, in the order ofStreams, and takes precedence overID(#4203) by @aozmekik - Native iterators for
ScanIterator:ScanIterator.Vals(ctx)returns aniter.Seq[string]for use withrange(#3348) by @khasanovbi - More URL options:
ParseURL,ParseClusterURLandParseFailoverURLacceptdialer_retries,dialer_retry_timeout,context_timeout_enabled,read_buffer_size,write_buffer_size,disable_identityandidentity_suffixwhere the options struct has the field (#4063) by @SulimanAbdulrazzaq.ParseClusterURLalso accepts?skip_verify=trueonrediss://URLs (#4106) andtls_verify_node_host=true, which clearsTLSConfig.ServerNameso each node is verified against the host it is dialed at and not against the host of the first URL. The default is unchanged, andrediss://cluster URLs now setMinVersion: tls.VersionTLS12, asParseURLandParseFailoverURLdo (#4145) by @PragalvaXFREZ - Context-aware credential subscriptions: the optional
auth.ContextStreamingCredentialsProviderinterface lets the client callSubscribeWithContextwhen it sets up a connection, so the context bounds the wait for the first credentials. Providers without the method keepSubscribe(#4249) by @PragalvaXFREZ TSCreateRuleOptions.AlignTimestamp: the field is now exported, so callers outside the package can set the bucket alignment forTSCreateRuleWithArgs(#4280) by @pcbeingused333
Connections, pool and transactions
- Connection handshake and
Options.Limiter: the handshake of a new connection (HELLO,AUTH,SELECT,CLIENT SETINFO,CLIENT MAINT_NOTIFICATIONS) no longer callsLimiter.Allowper command. The command that dials pays one admission and reports the handshake result once, and a PubSub connection, a reconnect after a handoff and a fresh full-duplex session each pay one. Before, a half-open circuit breaker spent its probe budget on the handshake and never closed (#4232) by @othoathydrahost. A panic in anOnConnector credentials hook now settles the admission (#4247) by @ump45nose - Silent reply mix-up after a maintenance handoff: with maintenance notifications on, a
MOVINGhandoff under concurrent traffic could give one connection two owners. Both wrote on the same socket and read each other's replies, so aGETcould return the"OK"of aSET, with no error (#4110, #4239) by @ndyakov. A completed handoff is now removed from the trackedMOVINGoperations, soGetState()no longer staysStateMoving(#4392), and the handoff queue of a nil config is capped byMaxActiveConnslike any other (#4389) by @ruziba3vich - Pool turns and idle connections:
Getfrees its pool turn when anOnGethook rejects a new connection, so the pool no longer loses a slot on each such failure (#4396) by @ruziba3vich. An idle scan that skipped an unusable connection and acquired a usable one on its last attempt no longer loses it from the idle list (#4322) by @xixi-box. Idle TLS connections that the server closed are retired and the command runs again without spending a retry (#4197) by @dunglas - Credential rotation with
MaxActiveConns: at the cap,Getnow waits withinPoolTimeoutfor an idle connection that is re-authenticating, and does not fail withErrPoolExhausted(#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 - Transactions:
TxPipelinedreturns an error and drops the connection whenEXECreplies with a different number of results than the number of queued commands, and a rejectedMULTIdrops the connection (#4186, #4192) by @saddamr3e.Tx.Closerequires anOKreply toUNWATCHand removes the connection when it cannot confirm a clean state (#4316) by @xixi-box - Pipeline setup errors: when connection setup fails with a Redis error reply (for example
WRONGPASS), each queued command now gets the error, wherePipeline.Execreturned it but every command hadErr() == nil(#4312) by @xh123637 - TLS dial and PubSub: a TLS dial honors the caller's context deadline and cancellation during the handshake (#4143) by @Samuel-Sorial. A
PubSubconnection that finished its setup afterClient.Closedrained the pool is closed and returnsErrClosed(#4157) by @aditya-rai-5. A subscribedPubSubconnection that gets aMOVINGwith a null endpoint stays under the control of thePubSub, soChannel()keeps delivering messages (#4246) by @ump45nose - Retry limits: any
MaxRetriesorMaxRedirectsbelow -1 now means one attempt with no retries, the same as -1. Before, a value such as -2 skipped the retry loop, so some commands were never sent and the call returned a nil error (#4349) by @ruziba3vich. The cluster wordingmax number of clients + cluster connections reachedis also matched byshouldRetryandIsMaxClientsError(#4367) by @ruziba3vich
Authentication and credentials
- Pub/Sub re-authentication with
StreamingCredentialsProvideron RESP3: credential rotations now re-authenticate established Pub/Sub connections in place (#4195) by @AdamMagued. Re-authentication is serialized for each connection (#4317) by @Nacl-HCl, skips a connection that was replaced after the rotation (#4309) by @ump45nose, and a close during subscription setup no longer panics (#4262) by @PragalvaXFREZ - Rejected re-authentication: the connection is closed when the server rejects a re-auth with
WRONGPASSorNOPERM, where it kept serving commands with the replaced credentials (#4058) by @saddamr3e StreamingCredentialsProviderwith derived and failover clients:Conn,EphemeralConnandWatchcarry the credentials manager, so a cold connection no longer panics (#4155) by @TastyHeadphones, andNewFailoverClientcreates it (#4182) by @lazerg. A closed Pub/Sub connection no longer stays in memory with its buffers (#4119) by @meruiden- CSC cache and TLS client certificates: clients that authenticate with different TLS client certificates (
tls-auth-clients-user) no longer share cache entries, so a restricted user cannot read entries that a privileged user fetched (#4261) by @saddamr3e - Passwords in traces and logs:
rediscmd.CmdStringredacts theHELLOpassword whenAUTHcomes afterSETNAME(#4348), and prints the value of a pointer argument to a predeclared type ortime.Timewhere it printed an address. The redaction of secrets such asCONFIG SET requirepassalso covers a keyword or password passed behind a pointer or as a named string (#4363) by @ruziba3vich
Cluster, Sentinel and Ring
- Redirects without a host: with
cluster-preferred-endpoint-type unknown-endpoint, a null host inCLUSTER SLOTStakes the host of the node that was asked (#4131) by @spicysharkco,MOVED/ASKreplies without a host reuse the host of the node that sent them (#4205) by @soujasK, and after a maintenance handoff the client uses the host of the serving connection (#4233) by @ump45nose. AMOVED/ASKto an IPv6 address that ends in a dotted quad, such as::ffff:10.0.0.1, is bracketed and dialable (#4350) by @ruziba3vich - Redirect handling: the client drops the connection when
MOVEDpoints to the node that sent it (#4229) by @SergeiSadov. When the first reply of a node batch is retryable and a later command getsMOVEDorASK, the redirected command is no longer sent twice, where a non-idempotentINCRcould run two times (#4258) by @lazerg - Cluster options and aggregation: a
-1retry backoff set onClusterOptionsnow reaches the node clients (#4345), and reusing one*ClusterOptionsfor a second client no longer turns disabled options back into their defaults (#4360) by @ruziba3vich. The response aggregators no longer panic when two shards reply with different Go types (#4397) by @ruziba3vich NewFailoverClusterClient:ConnMaxLifetimeJitterand the failing timeout are kept (#4196) by @nk-batman21, and theonClosehook is registered (#4000) by @roganartu- Sentinel: the failover dialer uses
DialTimeout, soSubscribeto an unreachable master does not hang until the kernel gives up (#4067) by @lazerg. Unused replica clients from empty or filtered discovery replies are closed (#4220) by @Grivn - Ring and cluster commands:
SetAddrsno longer leaks a client on each call when two shard names point to the same address (#4356) by @ruziba3vich.ClusterAddSlotsRangeandClusterDelSlotsRangereturn an error for an invalid range (#4225) by @ump45nose, andClusterShardsrejects an odd-lengthslotsarray (#4282) by @saddamr3e
Protocol and reply parsing
- Error elements inside arrays:
IntSliceCmd(TS.MADD,CMS.INCRBY),UintSliceCmd,FloatSliceCmd,StringSliceCmdandBoolSliceCmdnow read the whole array when an element is a Redis error, where they stopped at that element and the next pipeline command read the rest as its own reply (#4071 by @saddamr3e, #4137 by @lazerg). The reader also keeps typed errors (MOVED,ASK,LOADING) as array elements (#4274) by @ndyakov - Reply desync hardening:
ReadSlicechecks the type of the header (#4219) andVoidProcessorconsumes push frames whose first element is not a string (#4046) by @saddamr3e.Discardcounts a RESP3 attribute and the element it decorates as one element (#4318) by @waw666waw666. A buffered push drain stops at a frame boundary, so a slow handler no longer makes a healthy connection fail withi/o timeoutand drops the CSC entries fetched on it (#4224) by @ndyakov Cmdaccessors and scanning:Cmd.Float64,Float32and their slice forms accept RESP3 doubles (#4088) by @LindseyZ1205, andText,Int64,StringSliceand related accessors accept RESP3 doubles and big numbers (#4138) by @lazerg. Scanning a value that does not fit inuintreturns an error on 32-bit platforms (#4081) by @MokiMeow, andCmd.Int()rejects an out-of-range integer reply (#4256) by @b84330808- Parsing details: the
CLIENT INFOparser accepts=in values such as the client name andlib-name(#4096) by @LindseyZ1205.HGetAll(...).ScanandHMGet(...).Scanread anet.IPthatHSetstored as raw bytes (#4362) by @ruziba3vich, and the value passed to aTextUnmarshalerorBinaryUnmarshaleris a copy (#4078) by @saddamr3e Cloneof finished commands:XInfoStreamFullCmd.Clonekeeps all fields and no longer shares the pending storage of its groups and consumers (#4372). The vector set slice commands copy their result slice (#4373).FunctionStatsCmd.Clonecopies the command of the running script (#4378). Clones ofXMessageSliceCmd,XStreamSliceCmd,XInfoStreamCmd,ClientInfoCmd,ACLLogCmdandFTSearchCmdkeep every field of the value, such as theXREADGROUPclaim fields andDocument.Error(#4346). By @ruziba3vich
Commands, search, JSON and probabilistic types
- RediSearch:
FT.SEARCHon RESP2 reads the per-document score, payload and sort key correctly withNoContent(#4099) by @jayhemnani9910, and a stored JSON null field no longer fails the whole search (#4370) by @ruziba3vich.EXPLAINSCOREand an emptyRETURNparse correctly (#4140) by @lazerg.FTInforeads fractional doubles on RESP2 (#4207) by @ump45nose, theCASESENSITIVEflag of a TAG field (#4291) by @Dv2Corn,index_definitionby key (#4347) and a TAG separator ofmorM(#4371) by @ruziba3vich.FTCreatesendsSORTABLE,UNFandNOINDEXafter the field options (#4199) by @RaphaelFakhri andMAXTEXTFIELDSas a bare flag (#4344) by @ruziba3vich.FTSearchQueryappliesCountOnlyand keeps the offset (#4268) by @RaphaelFakhri.NewDropIndexBuilder(...).DeleteDocs()does not panic (#4105) by @PragalvaXFREZ FT.HYBRIDand search arguments:FTHybridWithArgsalways sends theCOMBINEargument count (#4298) by @lazerg, countsSHARD_K_RATIOin theKNNblock (#4353), sends both weights when onlyAlphaorBetais set (#4354), and the search commands no longer sendPARAMS 0for an empty map (#4355) by @ruziba3vich.- JSON:
JSONObjLen,JSONStrLen,JSONStrAppendandJSONToggleno longer fail when the path does not start with$(#4337), the array commands parse a legacy path and one such reply no longer shifts the replies after it in a pipeline (#4359),JSONArrTrimsends bothstartandstop(#4361), andJSONNumIncrBywith RESP3 returns the same string as RESP2 for a path with non-numeric matches (#4338) by @ruziba3vich.JSONGetWithArgswithniloptions sends the paths (#4185) by @LindseyZ1205 - Bloom, Cuckoo and Count-Min:
BFInfoof a non-scaling filter and a single-optionBF.INFOno longer fail (#4336, #4368),CFScanDumpdoes not fail on its last call (#4366), andBFInsert,BFMAdd,BFMExists,CFInsert,CFInsertNX,CFMExistsandCMSQueryexpand a single[]stringor[]interface{}(#4377) by @ruziba3vich niloptions no longer panic:FTExplainWithArgs,FTSynUpdateWithArgsandCFReserveWithArgs(#4248) by @hktitof,HGetEXWithArgsandHSetEXWithArgs(#4214) by @LindseyZ1205- Argument order and count:
IGNOREis sent beforeLABELSin the five time-series builders that support it (#4160) by @yuefdev.ModuleLoadexsendsARGSonce (#4191) by @LindseyZ1205.HSetandHMSetflatten typedmap[string]Targuments such asmap[string]int(#4235) by @ump45nose.FCallandFCallROexpand a[]stringor[]interface{}argument (#4365) by @ruziba3vich - Timeouts, geo and scripts:
XRead,XReadGroup,XClaim,WaitandWaitAOFno longer send a positive timeout shorter than 1 ms as0, which means wait forever (#4292) by @Dv2Corn.GeoRadiusandGeoRadiusByMemberno longer change the caller's*GeoRadiusQuery(#4173) by @LindseyZ1205, andGeoSearchLocationwith none of theWith*flags no longer fails with a parse error (#4335) by @ruziba3vich. A queuedSCRIPT LOADno longer gives an empty digest toNewScriptServerSHA(#4226), and theHOTKEYSCPU time fields use the names that the server sends (#4206) by @ump45nose
Observability
redisotel-native:server.portno longer contains the pool id (#4086) by @zhechen-cs. The connection count includes connections that existed beforeInit(#4089), and pending requests and state no longer drift acrossInitandShutdown(#4142) by @ninadsutrave. The pool usage metric does not underflow when pool statistics disagree (#4031) by @andystaples. The relaxed-timeout metric is recorded forSMIGRATING(#4390) by @ruziba3vich
- Short bulk strings in one write:
Writerwrites the header of a bulk string with one call, and writes the value and CRLF together when the value is 32 bytes or less. Benchmarks ofWriteArgsinto abufio.Writershowed 15% to 31% less time for each command on three CPUs, for example -24% to -26% forGET keyand -27% to -31% for an 8-pairMSET. The bytes on the wire do not change (#4281) by @g4lb - OpenTelemetry metrics: see the highlight above (#4269, #4406, #4407, #4408)
- CI images: the test matrix uses Redis 8.10.3 and 8.12.0 (#4231, #4241, #4264, #4288, #4404) by @ndyakov
- 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) - 32-bit build: a
386CI job runsgo vetand the tests, and the root tests compile for 32-bit (#4139) by @lazerg - Dependencies: the OpenTelemetry SDK and
golang.org/x/netare upgraded in the OTel adapters and examples, to fixgovulncheckfindings (#4087) by @ofekshenawa - Documentation: doc link definitions in the set and search command comments render as links on pkg.go.dev (#4328) by @farisbasha, and the dial and retry timing is documented (#4398) by @wozhenbang2004
- Regression and flaky tests: a cold-start full-duplex cluster test bounds the number of connections (#4223) by @ndyakov, a test locks the
MSETEXmulti-shard split (#4314) by @Zoomish, the autopipeline tests are consolidated from 28 files into 5 (#4091), and some tests move to the standardtestingpackage (#4085, #4187). Fixes for flaky or Redis Enterprise-incompatible specs: #4172, #4180, #4210, #4211, #4215, #4218, #4255, #4260, #4270, #4307
We'd like to thank all the contributors who worked on this release!
@AdamMagued, @aditya-rai-5, @andystaples, @aozmekik, @Avv123, @b84330808, @CaliLuke, @cpoole, @dunglas, @Dv2Corn, @farisbasha, @g4lb, @Grivn, @harshitdeora, @hktitof, @jayhemnani9910, @jjj-n, @kevin9327, @khasanovbi, @lazerg, @LindseyZ1205, @meruiden, @MokiMeow, @mtnaskari, @Nacl-HCl, @ndyakov, @ninadsutrave, @nk-batman21, @ofekshenawa, @othoathydrahost, @pcbeingused333, @PerryLink, @PragalvaXFREZ, @Purv-Kabaria, @RaphaelFakhri, @rleungx, @roganartu, @ruziba3vich, @saddamr3e, @Samuel-Sorial, @SergeiSadov, @soujasK, @spicysharkco, @SulimanAbdulrazzaq, @TastyHeadphones, @Tidehyc, @ump45nose, @VedantMadane, @vladvildanov, @vlady-kotsev, @waw666waw666, @wozhenbang2004, @xh123637, @xixi-box, @yamaankhan20, @yuefdev, @zhechen-cs, @Zoomish
Full Changelog: https://github.com/redis/go-redis/compare/v9.23.0...v9.24.0
9.24.0
This is a minor release. It contains everything from 9.24.0-beta.1 and 9.24.0-beta.2, so these notes cover the full 9.23.0 → 9.24.0 upgrade. The release adds:
- Redis 8.12 support: set member expiration,
ZMOVE,BITRANGEINTARRAY,CF.COMPACT, scalar-quantized HNSW,BLESSand more, tested against Redis 8.12.0. - The experimental MultiDB client for Active-Active (Redis Enterprise) failover.
- Metadata-driven cluster routing and client-side caching (CSC) eligibility that come from the
COMMANDmetadata. - CSC OPT-IN / OPT-OUT tracking modes, CSC on
ClusterClient, and CSC withEphemeralConn. - A per-client
OTelRecorder, MultiDB metrics inredisotel-native, and much less OpenTelemetry cost on the hot path. - New full-duplex options (
FullDuplexPipes,PipelineMinIdleConns) and a cluster recovery fix for full-duplex sessions. - An opt-in idle connection reaper,
ACLGetUser,ClusterSlotStatsand the Redis 8.10BACKUPcommands. - Many fixes for connections, cluster routing, authentication, reply parsing, and the search, JSON and probabilistic commands.
This release adds the new commands and options of Redis 8.12 and runs its tests against Redis 8.12.0 (#4404).
- Set member expiration:
SExpire,SPExpire,SExpireAt,SPExpireAt(each withWithArgs),STTL,SPTTL,SExpireTime,SPExpireTime,SPersist,SAddEXandSAddEXWithArgs(#4165) by @ndyakov. - Sorted sets and bitmaps:
ZMOVE,BZMOVEandZMOVEMEMBER(#4289), andBITRANGEINTARRAY(#4242) by @ndyakov. - Probabilistic and search:
CF.COMPACTasCFCompact(#4243) by @ndyakov.CELL_SIZEforCMS.INITBYDIMandCMS.INITBYPROB(CMSInitByDimCellSize,CMSInitByProbCellSize) (#4023), and scalar-quantized HNSW indexes inFT.CREATEwith the two newFT.INFOfields (#4077) by @vlady-kotsev.RERANKforFT.HYBRID, theBITRANGEINTARRAYoptions and the new command metadata (#4277) by @ndyakov. BLESS:BLESS GET,BLESS SET,BLESS CLEARandBLESS SCANfor theNO-EVICTflag (#4041) by @vlady-kotsev.BlessScanis node-local: scan each master of a cluster or ring.
NewMultiDBClient routes commands to one active database out of several standalone or cluster members (e.g. Redis Enterprise Active-Active) and fails over based on circuit breakers, health checks and a weight-based failover strategy, with auto-fallback to higher-weight members. The multidb package adds ping and lag-aware health checks and probe policies. See example/multidb (#3954) by @ndyakov. Defaults:
- MultiDB owns retries:
CommandRetries(0 = 2, -1 = none) retries on the database active at each attempt, and every attempt is counted by the breaker and failure detector. Standalone members get no retries of their own (MaxRetries0 becomes -1); an explicitMaxRetriesis kept. - Health checks: HEALTHY_ALL, 3 probes 500ms apart per check, honoring
multidb.WithProbes/WithDelay/WithTimeout;HealthCheckTimeout(3s) caps the pass. Probes that cannot fit it are rejected at construction and byAddDatabase. Under the default policy,SetActiveDatabaseandProbeTargetBeforeFailoveruse one probe per check. - Startup:
InitialDBStateMajorityAvailableneeds half the members, rounded up (1 of 2). A failed start matchesErrInsufficientHealthyDatabases; with no healthy member it also matchesErrPermanentlyNotAvailable. - Weights are in (0, 1] (0 = 1.0); -1 disables a member. The last enabled member cannot be disabled.
- The default failure detector (1000 failures and 10% within 2s) is set with
FailureDetectorConfig, whose fields are used as given; start fromDefaultMultiDBFailureDetectorConfig(). redisotel-nativereports MultiDB events (failover, active database change, circuit breaker state change, health check) in a newmultidbmetric group,MetricGroupFlagMultiDB, whichMetricGroupAllincludes (#4007) by @ndyakov.- A member
ProcessHookthat returnsnilwithout callingnextis no longer counted as a healthy database response (#4271), and a local result of a member hook in a cluster pipeline is kept when another node fails (#4279) by @harshitdeora. Full-duplex outcomes are recorded in the failure window after the active member is selected again (#4283) by @xixi-box.
Experimental: the MultiDB API can change in a minor release. User hooks and health checks must not call MultiDB control methods or Close.
Cluster routing and CSC use the same resolved COMMAND record for each command, so flags, key positions and policies cannot drift between two metadata sources (#3960, #4093) by @ofekshenawa.
- Existing default routing and the cluster-wide
DBSize,ScriptLoad,ScriptFlushandScriptExistshelpers are preserved. InstallNewCommandMetadataResolver()orclient.NewDynamicResolver()withSetCommandInfoResolverto enable metadata-based fan-out and aggregation.CommandMetadataconfiguration alone does not enable them. Cross-slot fan-out is not atomic. - With metadata routing enabled, cross-slot
MGETfollows redirects for each affected slot during resharding instead of returning a missing value for a key that moved. Successful slot groups are not replayed, and fan-out replies that containMOVEDorASKrefresh the topology for later commands. - Explicit pipelines and transactions keep node-local execution; ordered
AsyncAutoPipelinerejects fan-out before dispatch. Automatic fan-out is available through the blocking face or unordered half-duplex mode.SCAN,INFOand known diagnostics stay node-local. - Numeric sum/min/max fan-out keeps integer replies as exact
int64results, including rawDoresults; integer overflow returns an error. Aggregates with floating-point replies returnfloat64. - Resolved command key specifications take precedence over
SetFirstKeyPos. Commands missing from the snapshot keep the legacy key-position fallback; setCommandMetadataPreferLiveorCommandMetadataConfig.Overridesfor full metadata. The defaultCommandMetadataStaticmode does no network lookup unless resolution reaches an installedNewDynamicResolver. Identity probes have bounded deadlines, and after a failure or invalidation commands use conservative metadata while verification retries in the background. - Topology loading prefers
CLUSTER SHARDSand falls back toCLUSTER SLOTS, and concurrent reloads share one in-flight load. Keyless routing prefers healthy nodes without excluding every candidate on a temporary local marker.ErrClusterTopologyUnhealthysupportserrors.Is, and unknown response policies return an error. FT.CURSOR READis no longer retried after a lost reply, on standalone and cluster clients, because the server may already have advanced the cursor.- A
SCANiterator on aClusterClientnow visits every master. Before, it sent each page to a random node with the cursor of another node and could end early without an error (#4200) by @ndyakov. - With the dynamic resolver,
DEL,EXISTS,TOUCHandUNLINKon several keys of one slot returned the per-slot count multiplied by the number of keys in that slot. They now count each slot once (#4141) by @lazerg.
Experimental: the CSC options can change in a minor release.
- OPT-IN and OPT-OUT tracking modes:
Options.ClientSideCacheTrackingModeselectsTrackingModePlain(default),TrackingModeOptInorTrackingModeOptOut.Options.ClientSideCacheableis a predicate that selects the eligible unmarked calls, andWithCache(ctx)/WithoutCache(ctx)mark one call. The mode works with miss coalescing, refresh on invalidate, pipelines, autopipeline and cluster fan-out. With CSC on, the native full-duplex engine leases only the untracked pipeline pool and does not use the main pool (#4193) by @ofekshenawa. - CSC on
ClusterClient: each node client has its own cache, shared by its connection pool, with per-node capacity limits.ClusterOptions,UniversalOptionsandNewFailoverClusterClientaccept the CSC options, andCSCStats()andCSCRefreshStats()add up the registered nodes. The client does not store a reply that cannot prove that every key it depends on exists. A MOVED or ASK redirect bypasses the cache, and a topology change flushes only the caches of nodes that enter or leave routing. Replica reads, ordinary pipelines, transactions and full-duplex batches stay uncached (#4080) by @ofekshenawa. - Ephemeral connections with client-side caching: with CSC active,
EphemeralConnlazily dials a fresh, untracked connection. Session commands are allowed without disrupting the parent cache, and reads always go to Redis. The connection takes noPoolSizeturn, does not support maintenance handoff, and must be closed after use. Without CSC, idle-connection reuse is unchanged (#4174) by @aditya-rai-5.
AutoPipelineOptions.FullDuplexPipessets the number of full-duplex pipes (held connections) on a standaloneClient. 0 means 1.NumShards > 1underFullDuplexstill selects that number whenFullDuplexPipesis 0, butFullDuplexPipesis the preferred name.Config().FullDuplexPipesreports the effective count. On a cluster, a full-duplex autopipeliner keeps one pipe for each master (#4107) by @ndyakov.- Warm spare connection:
Options.PipelineMinIdleConns(default 0,pipeline_min_idle_connsin URLs) sets the minimum idle connections of the dedicated pipeline pool, and is available onClusterOptions,RingOptions,FailoverOptionsandUniversalOptions. A full-duplex engine keeps one idle spare, so a replacement for a failed held connection does not wait for a TCP or TLS dial. The spare is dialed but not initialized:HELLOandAUTHstill run on the first lease (#4101) by @ndyakov. - Cluster recovery: when the session of a node engine drops, the unacknowledged commands now go through the cluster router, so they reach the new owner of the slot. Before, they were replayed only on a new connection to the same node and failed if that node was closed or replaced (#4111) by @ndyakov.
Two groups of changes remove most of the cost of the redisotel-native metrics on the hot path.
- Full duplex: it lost about 90% of its throughput. In one test with 256 callers and 64 commands in flight on a local Redis,
GETthroughput went from about 190k/s on v9.23.0 to about 2.1M/s (about 2.0M/s with OTel off). The gain depends on RTT, the number of commands in flight and the CPU, so expect a smaller effect on a remote Redis. The full-duplex reader reads its goroutine id once for each session, andRecordOperationDurationuses a bounded attribute cache and a queue for the success path (#4269) by @ndyakov. - Pool metrics:
db.client.connection.countanddb.client.connection.pending_requestsare now observed at collection time from the pool statistics, and no longer updated on everyGetandPut. The measurement options of the pool and command metrics are cached, and the global recorder is read without a lock. In one in-memory test (500 connections, 128 workers, all metric groups on) a command ran at 165k ops/s before, 678k with the observed connection count, 895k with the cache, and about 1.05M with the observed pending requests (1.21M with OTel off).InitandShutdownwith 10k connections went from about 7.4 ms to 0.13 ms and 0.011 ms. Over a real Redis there is no measurable difference between OTel on and off (#4406, #4407, #4408) by @ndyakov.
Each client can have its own metrics recorder. Set OTelRecorder in Options, ClusterOptions, RingOptions, FailoverOptions, UniversalOptions or MultiDBOptions. The client sends its commands, pipelines, errors, cluster redirects, Pub/Sub messages, stream lag, and pool and connection events to it. Cluster nodes, ring shards, sentinel clients and MultiDB members use the recorder of their parent. Clients without it use the recorder from redis.SetOTelRecorder, as before. In redisotel-native, NewRecorder makes a recorder with its own WithCustomAttributes, which take precedence over the attributes of the global Init config (#4179) by @vladvildanov.
inst := redisotel.GetObservabilityInstance()
_ = inst.Init(redisotel.NewConfig().WithEnabled(true).WithMeterProvider(provider))
defer inst.Shutdown()
acmeRec, _ := inst.NewRecorder(redisotel.NewConfig().
WithCustomAttributes(attribute.String("tenant", "acme")))
acme := redis.NewClient(&redis.Options{Addr: "acme:6379", OTelRecorder: acmeRec})
ConnMaxLifetimeReapInterval (on Options, ClusterOptions, FailoverOptions, RingOptions and UniversalOptions, and conn_max_lifetime_reap_interval in URLs) starts a background goroutine that closes idle connections past ConnMaxLifetime or ConnMaxIdleTime and refills the pool toward MinIdleConns, 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 than ConnMaxIdleTime, 30 minutes by default. Connections in use, and connections that a re-auth or handoff worker owns, are skipped, and a refill toward MinIdleConns adds dials at low concurrency (#4334, #4340) by @ndyakov.
BACKUP START,SEAL,ABORT,CLEANUPandSTATUSfor Redis 8.10 (#4286) by @Purv-Kabaria.ACLGetUserreturns 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(#4357) by @ruziba3vich.ClusterSlotStatsandClusterSlotStatsOrderByrunCLUSTER 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 (#4358) by @ruziba3vich.
Check these when you upgrade from 9.23.0:
- 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. ContextDeadlineErrorfor socket timeouts that come from a context deadline (#4263) by @aditya-rai-5. WithContextTimeoutEnabled: true, a socket timeout caused by the deadline of the caller's context now matchescontext.DeadlineExceededwitherrors.Is, and still matchesnet.ErrorwithTimeout() == true. The complete original transport error stays in the chain. Such an error is no longer retried, because the context has already expired, and its message starts withcontext deadline exceeded:. 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(#4306) by @PerryLink, issue #4305.WithTimeoutkeeps hooks: a client returned byWithTimeoutnow runs the hooks of its parent. Before, it dropped them, so hooks added withAddHookdid not run for commands, pipelines and transactions on that client (#4095) by @CaliLuke.- CSC eligibility comes from the
COMMANDmetadata and fails closed (#3960) by @ofekshenawa. An unknown, malformed, blocking, nondeterministic or script-based command runs as usual but is not cached.JSON.MGETandTS.INFOare no longer cached by default. With CSC enabled, more eligible commands can be cached in the defaultStaticmetadata mode (theBF.*,CF.*,TOPK.*,TDIGEST.*,V*andAR*families,CMS.QUERY,EXPIRETIME,PEXPIRETIME,HEXPIRETIME,HPEXPIRETIME,PFCOUNT,SDIFFCARD,SUNIONCARD,ZINTERCARDand others).Command()results now also contain subcommand entries namedparent|child, for exampleclient|id. When built-in CSC is on, a rawCLIENT CACHINGcommand is rejected, like the other commands that change connection state (#4193) by @ofekshenawa. - Connection-pool limits and dials:
MaxActiveConnsnow counts all connections registered with the pool (pooled, excess, and dedicatedNewConnconnections) plus in-flight dial reservations. Before, admission checked only the pooled count, so clients with this limit can now receiveErrPoolExhaustedfromNewConn/EphemeralConnor during bursts that previously exceeded it.NewConnnow waits for the sharedMaxConcurrentDialslimit and honors context cancellation while waiting, and idle prewarming shares this limit without holding a pool turn. These changes apply to all clients using the pool, not only CSC ephemeral sessions (#4174) by @aditya-rai-5. - Struct scan on a bad field:
ScanonHGETALL/HMGETresults used to stop at the first field that failed to decode, and withHGETALLthe set of filled fields was random. It now sets every field it can decode and still returns an error. When several fields fail, their errors are joined witherrors.Join, in key order forHGETALLand argument order forHMGET, soerrors.Isanderrors.Asmatch each of them. For the built-in types, a field that fails to decode keeps its previous value. A custom decoder (ScanRedis,UnmarshalTextorUnmarshalBinary) runs on the existing field and can leave a failed field changed. Code that reuses the struct after an error will see more fields set (#4136 by @lazerg, #2255 by @cpoole, #4294 by @Avv123). - URL and option validation:
ParseURL,ParseClusterURLandParseFailoverURLnow reject negativedialer_retry_timeout,read_buffer_sizeandwrite_buffer_sizevalues, and a negativepool_size, which used to panic. Replace negative retry timeouts with0for no delay, or omit the parameter for the default 100 ms delay; an explicitdialer_retry_timeout=0now disables the delay (#4144) by @Samuel-Sorial. A negativePoolSizein the options structs selects the default (#4325) by @ump45nose.ParseURLandParseFailoverURLalso reject a negative database number (#4275) and a plain-second duration that overflowsint64nanoseconds (#4276) by @ump45nose. A disableddial_timeout(0or a negative value in the URL) now means no dial deadline. Before, every dial failed at once (#4168) by @PerryLink. - Empty password with a username (opt-in): a
Usernamewith an emptyPasswordsends noAUTH, the same as 9.23.0. To authenticate an ACL user created withnopass, setAuthEmptyPassword: true(orauth_empty_password=truein the URL); for sentinel connections useSentinelAuthEmptyPassword(sentinel_auth_empty_password=true). The rule also applies to credentials fromCredentialsProvider,CredentialsProviderContextandStreamingCredentialsProviderused when a connection is set up; re-authentication on a credentials refresh is unchanged. Redis Enterprise and Redis Cloud databases with unauthenticated access can reject an empty password, which is why this is opt-in. The client-side cache keeps a separate namespace for a username that sends noAUTH(#4161 by @saddamr3e, #4194 by @ndyakov). - Ring telemetry:
redisotel.InstrumentTracingandInstrumentMetricsnow instrument existing shards. Remove any per-shard instrumentation workaround when instrumenting the ring to avoid duplicate spans and metrics (#4227) by @nk-batman21. - OpenTelemetry metrics:
db.client.connection.countanddb.client.connection.pending_requestsare now asynchronous instruments, so views or selectors keyed on the instrument kind match them differently. A series that exists is reported at every collection, and the series of a closed pool stay at 0 untilShutdown.OTelConnectionCounter.RecordConnectionCountis no longer called and is deprecated; a custom recorder that built its own count from it should implementOTelPoolRegistrarand readPoolStats()(#4406, #4408) by @ndyakov. Inredisotel-native, only a server error reply getsredis:<PREFIX>aserror.type, theservercategory anddb.response.status_code. A closed connection (io.EOF) is noweofin thenetworkcategory with no status code, and a server error wrapped by a hook keeps its prefix (#4391) by @ruziba3vich. - Full-duplex clients keep one idle spare connection: a full-duplex engine raises
MinIdleConnsof its pipeline pool to 1, so the pool holds one extra idle connection for each client (for each node on a cluster). SetPipelineMinIdleConnsto a negative value to opt out (#4101) by @ndyakov. - Replies nested deeper than 1000 levels fail: the RESP reader returns an error for a reply with more than 1000 levels of nested aggregates or attributes, instead of exhausting the stack (#4296) by @xixi-box.
Script.Loadkeeps the client-computed SHA-1: aScriptmade withNewScriptno longer takes the digest from theSCRIPT LOADreply, so a server that replies with another digest cannot redirect laterRun/RunROcalls.NewScriptServerSHAstill uses the server digest (#3943) by @saddamr3e.PubSub.Channelmisuse does not panic: callingChannelandChannelWithSubscriptionson onePubSubnow returns a closed channel and logs a warning.Ring.Subscribe,PSubscribeandSSubscribewith no channels, or a failed shard lookup, return aPubSubthat carries the error (#3968) by @VedantMadane.- Search,
Cmdand return values: a search that setsLimitOffsetand leavesLimitat 0 now returns up to 10 documents from that offset. On Redis 7 it returned an empty page before, and on Redis 8 it was an error (#4285) by @kevin9327.FTHybridWithArgssendsWINDOWforCOMBINE LINEARas well as forRRF, where aWindowwithLINEARwas ignored (#4379) by @ruziba3vich.Cmd.Uint64of a negative integer returns an error, where it returned the wrapped value (#4369) by @ruziba3vich.XInfoStreamFullreports a-1consumer-group lag when Redis replies with a nil lag (#4217), andClusterClient.ScriptFlushreturnsOK(#4252) by @LindseyZ1205. - New interface methods:
Cmdable,ClusterCmdableand their sub-interfaces gain methods for the new commands (ACLGetUser,ClusterSlotStats,ClusterSlotStatsOrderBy, the 8.10 and 8.12 commands andBlessCmdable). This is the usual way go-redis adds commands. A custom type that implements these interfaces, for example a mock, must add the methods.
FT.AGGREGATEsteps:FILTERandLIMITare now steps inFTAggregateOptions.Steps, so you can filter beforeGROUPBY, filter more than once, and placeLIMITbetween steps.AggregateBuildergetsLimit(). The old tail fieldsFilterandLimitOffset/Limitstill work, are sent after all steps, and are deprecated in favor of steps (#4076) by @ndyakov- Per-stream IDs for
XRead:XReadArgs.IDsgives one ID for each stream, in the order ofStreams, and takes precedence overID(#4203) by @aozmekik - Native iterators for
ScanIterator:ScanIterator.Vals(ctx)returns aniter.Seq[string]for use withrange(#3348) by @khasanovbi - More URL options:
ParseURL,ParseClusterURLandParseFailoverURLacceptdialer_retries,dialer_retry_timeout,context_timeout_enabled,read_buffer_size,write_buffer_size,disable_identityandidentity_suffixwhere the options struct has the field (#4063) by @SulimanAbdulrazzaq.ParseClusterURLalso accepts?skip_verify=trueonrediss://URLs (#4106) andtls_verify_node_host=true, which clearsTLSConfig.ServerNameso each node is verified against the host it is dialed at and not against the host of the first URL. The default is unchanged, andrediss://cluster URLs now setMinVersion: tls.VersionTLS12, asParseURLandParseFailoverURLdo (#4145) by @PragalvaXFREZ - Context-aware credential subscriptions: the optional
auth.ContextStreamingCredentialsProviderinterface lets the client callSubscribeWithContextwhen it sets up a connection, so the context bounds the wait for the first credentials. Providers without the method keepSubscribe(#4249) by @PragalvaXFREZ TSCreateRuleOptions.AlignTimestamp: the field is now exported, so callers outside the package can set the bucket alignment forTSCreateRuleWithArgs(#4280) by @pcbeingused333
Connections, pool and transactions
- Connection handshake and
Options.Limiter: the handshake of a new connection (HELLO,AUTH,SELECT,CLIENT SETINFO,CLIENT MAINT_NOTIFICATIONS) no longer callsLimiter.Allowper command. The command that dials pays one admission and reports the handshake result once, and a PubSub connection, a reconnect after a handoff and a fresh full-duplex session each pay one. Before, a half-open circuit breaker spent its probe budget on the handshake and never closed (#4232) by @othoathydrahost. A panic in anOnConnector credentials hook now settles the admission (#4247) by @ump45nose - Silent reply mix-up after a maintenance handoff: with maintenance notifications on, a
MOVINGhandoff under concurrent traffic could give one connection two owners. Both wrote on the same socket and read each other's replies, so aGETcould return the"OK"of aSET, with no error (#4110, #4239) by @ndyakov. A completed handoff is now removed from the trackedMOVINGoperations, soGetState()no longer staysStateMoving(#4392), and the handoff queue of a nil config is capped byMaxActiveConnslike any other (#4389) by @ruziba3vich - Pool turns and idle connections:
Getfrees its pool turn when anOnGethook rejects a new connection, so the pool no longer loses a slot on each such failure (#4396) by @ruziba3vich. An idle scan that skipped an unusable connection and acquired a usable one on its last attempt no longer loses it from the idle list (#4322) by @xixi-box. Idle TLS connections that the server closed are retired and the command runs again without spending a retry (#4197) by @dunglas - Credential rotation with
MaxActiveConns: at the cap,Getnow waits withinPoolTimeoutfor an idle connection that is re-authenticating, and does not fail withErrPoolExhausted(#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 - Transactions:
TxPipelinedreturns an error and drops the connection whenEXECreplies with a different number of results than the number of queued commands, and a rejectedMULTIdrops the connection (#4186, #4192) by @saddamr3e.Tx.Closerequires anOKreply toUNWATCHand removes the connection when it cannot confirm a clean state (#4316) by @xixi-box - Pipeline setup errors: when connection setup fails with a Redis error reply (for example
WRONGPASS), each queued command now gets the error, wherePipeline.Execreturned it but every command hadErr() == nil(#4312) by @xh123637 - TLS dial and PubSub: a TLS dial honors the caller's context deadline and cancellation during the handshake (#4143) by @Samuel-Sorial. A
PubSubconnection that finished its setup afterClient.Closedrained the pool is closed and returnsErrClosed(#4157) by @aditya-rai-5. A subscribedPubSubconnection that gets aMOVINGwith a null endpoint stays under the control of thePubSub, soChannel()keeps delivering messages (#4246) by @ump45nose - Retry limits: any
MaxRetriesorMaxRedirectsbelow -1 now means one attempt with no retries, the same as -1. Before, a value such as -2 skipped the retry loop, so some commands were never sent and the call returned a nil error (#4349) by @ruziba3vich. The cluster wordingmax number of clients + cluster connections reachedis also matched byshouldRetryandIsMaxClientsError(#4367) by @ruziba3vich
Authentication and credentials
- Pub/Sub re-authentication with
StreamingCredentialsProvideron RESP3: credential rotations now re-authenticate established Pub/Sub connections in place (#4195) by @AdamMagued. Re-authentication is serialized for each connection (#4317) by @Nacl-HCl, skips a connection that was replaced after the rotation (#4309) by @ump45nose, and a close during subscription setup no longer panics (#4262) by @PragalvaXFREZ - Rejected re-authentication: the connection is closed when the server rejects a re-auth with
WRONGPASSorNOPERM, where it kept serving commands with the replaced credentials (#4058) by @saddamr3e StreamingCredentialsProviderwith derived and failover clients:Conn,EphemeralConnandWatchcarry the credentials manager, so a cold connection no longer panics (#4155) by @TastyHeadphones, andNewFailoverClientcreates it (#4182) by @lazerg. A closed Pub/Sub connection no longer stays in memory with its buffers (#4119) by @meruiden- CSC cache and TLS client certificates: clients that authenticate with different TLS client certificates (
tls-auth-clients-user) no longer share cache entries, so a restricted user cannot read entries that a privileged user fetched (#4261) by @saddamr3e - Passwords in traces and logs:
rediscmd.CmdStringredacts theHELLOpassword whenAUTHcomes afterSETNAME(#4348), and prints the value of a pointer argument to a predeclared type ortime.Timewhere it printed an address. The redaction of secrets such asCONFIG SET requirepassalso covers a keyword or password passed behind a pointer or as a named string (#4363) by @ruziba3vich
Cluster, Sentinel and Ring
- Redirects without a host: with
cluster-preferred-endpoint-type unknown-endpoint, a null host inCLUSTER SLOTStakes the host of the node that was asked (#4131) by @spicysharkco,MOVED/ASKreplies without a host reuse the host of the node that sent them (#4205) by @soujasK, and after a maintenance handoff the client uses the host of the serving connection (#4233) by @ump45nose. AMOVED/ASKto an IPv6 address that ends in a dotted quad, such as::ffff:10.0.0.1, is bracketed and dialable (#4350) by @ruziba3vich - Redirect handling: the client drops the connection when
MOVEDpoints to the node that sent it (#4229) by @SergeiSadov. When the first reply of a node batch is retryable and a later command getsMOVEDorASK, the redirected command is no longer sent twice, where a non-idempotentINCRcould run two times (#4258) by @lazerg - Cluster options and aggregation: a
-1retry backoff set onClusterOptionsnow reaches the node clients (#4345), and reusing one*ClusterOptionsfor a second client no longer turns disabled options back into their defaults (#4360) by @ruziba3vich. The response aggregators no longer panic when two shards reply with different Go types (#4397) by @ruziba3vich NewFailoverClusterClient:ConnMaxLifetimeJitterand the failing timeout are kept (#4196) by @nk-batman21, and theonClosehook is registered (#4000) by @roganartu- Sentinel: the failover dialer uses
DialTimeout, soSubscribeto an unreachable master does not hang until the kernel gives up (#4067) by @lazerg. Unused replica clients from empty or filtered discovery replies are closed (#4220) by @Grivn - Ring and cluster commands:
SetAddrsno longer leaks a client on each call when two shard names point to the same address (#4356) by @ruziba3vich.ClusterAddSlotsRangeandClusterDelSlotsRangereturn an error for an invalid range (#4225) by @ump45nose, andClusterShardsrejects an odd-lengthslotsarray (#4282) by @saddamr3e
Protocol and reply parsing
- Error elements inside arrays:
IntSliceCmd(TS.MADD,CMS.INCRBY),UintSliceCmd,FloatSliceCmd,StringSliceCmdandBoolSliceCmdnow read the whole array when an element is a Redis error, where they stopped at that element and the next pipeline command read the rest as its own reply (#4071 by @saddamr3e, #4137 by @lazerg). The reader also keeps typed errors (MOVED,ASK,LOADING) as array elements (#4274) by @ndyakov - Reply desync hardening:
ReadSlicechecks the type of the header (#4219) andVoidProcessorconsumes push frames whose first element is not a string (#4046) by @saddamr3e.Discardcounts a RESP3 attribute and the element it decorates as one element (#4318) by @waw666waw666. A buffered push drain stops at a frame boundary, so a slow handler no longer makes a healthy connection fail withi/o timeoutand drops the CSC entries fetched on it (#4224) by @ndyakov Cmdaccessors and scanning:Cmd.Float64,Float32and their slice forms accept RESP3 doubles (#4088) by @LindseyZ1205, andText,Int64,StringSliceand related accessors accept RESP3 doubles and big numbers (#4138) by @lazerg. Scanning a value that does not fit inuintreturns an error on 32-bit platforms (#4081) by @MokiMeow, andCmd.Int()rejects an out-of-range integer reply (#4256) by @b84330808- Parsing details: the
CLIENT INFOparser accepts=in values such as the client name andlib-name(#4096) by @LindseyZ1205.HGetAll(...).ScanandHMGet(...).Scanread anet.IPthatHSetstored as raw bytes (#4362) by @ruziba3vich, and the value passed to aTextUnmarshalerorBinaryUnmarshaleris a copy (#4078) by @saddamr3e Cloneof finished commands:XInfoStreamFullCmd.Clonekeeps all fields and no longer shares the pending storage of its groups and consumers (#4372). The vector set slice commands copy their result slice (#4373).FunctionStatsCmd.Clonecopies the command of the running script (#4378). Clones ofXMessageSliceCmd,XStreamSliceCmd,XInfoStreamCmd,ClientInfoCmd,ACLLogCmdandFTSearchCmdkeep every field of the value, such as theXREADGROUPclaim fields andDocument.Error(#4346). By @ruziba3vich
Commands, search, JSON and probabilistic types
- RediSearch:
FT.SEARCHon RESP2 reads the per-document score, payload and sort key correctly withNoContent(#4099) by @jayhemnani9910, and a stored JSON null field no longer fails the whole search (#4370) by @ruziba3vich.EXPLAINSCOREand an emptyRETURNparse correctly (#4140) by @lazerg.FTInforeads fractional doubles on RESP2 (#4207) by @ump45nose, theCASESENSITIVEflag of a TAG field (#4291) by @Dv2Corn,index_definitionby key (#4347) and a TAG separator ofmorM(#4371) by @ruziba3vich.FTCreatesendsSORTABLE,UNFandNOINDEXafter the field options (#4199) by @RaphaelFakhri andMAXTEXTFIELDSas a bare flag (#4344) by @ruziba3vich.FTSearchQueryappliesCountOnlyand keeps the offset (#4268) by @RaphaelFakhri.NewDropIndexBuilder(...).DeleteDocs()does not panic (#4105) by @PragalvaXFREZ FT.HYBRIDand search arguments:FTHybridWithArgsalways sends theCOMBINEargument count (#4298) by @lazerg, countsSHARD_K_RATIOin theKNNblock (#4353), sends both weights when onlyAlphaorBetais set (#4354), and the search commands no longer sendPARAMS 0for an empty map (#4355) by @ruziba3vich.- JSON:
JSONObjLen,JSONStrLen,JSONStrAppendandJSONToggleno longer fail when the path does not start with$(#4337), the array commands parse a legacy path and one such reply no longer shifts the replies after it in a pipeline (#4359),JSONArrTrimsends bothstartandstop(#4361), andJSONNumIncrBywith RESP3 returns the same string as RESP2 for a path with non-numeric matches (#4338) by @ruziba3vich.JSONGetWithArgswithniloptions sends the paths (#4185) by @LindseyZ1205 - Bloom, Cuckoo and Count-Min:
BFInfoof a non-scaling filter and a single-optionBF.INFOno longer fail (#4336, #4368),CFScanDumpdoes not fail on its last call (#4366), andBFInsert,BFMAdd,BFMExists,CFInsert,CFInsertNX,CFMExistsandCMSQueryexpand a single[]stringor[]interface{}(#4377) by @ruziba3vich niloptions no longer panic:FTExplainWithArgs,FTSynUpdateWithArgsandCFReserveWithArgs(#4248) by @hktitof,HGetEXWithArgsandHSetEXWithArgs(#4214) by @LindseyZ1205- Argument order and count:
IGNOREis sent beforeLABELSin the five time-series builders that support it (#4160) by @yuefdev.ModuleLoadexsendsARGSonce (#4191) by @LindseyZ1205.HSetandHMSetflatten typedmap[string]Targuments such asmap[string]int(#4235) by @ump45nose.FCallandFCallROexpand a[]stringor[]interface{}argument (#4365) by @ruziba3vich - Timeouts, geo and scripts:
XRead,XReadGroup,XClaim,WaitandWaitAOFno longer send a positive timeout shorter than 1 ms as0, which means wait forever (#4292) by @Dv2Corn.GeoRadiusandGeoRadiusByMemberno longer change the caller's*GeoRadiusQuery(#4173) by @LindseyZ1205, andGeoSearchLocationwith none of theWith*flags no longer fails with a parse error (#4335) by @ruziba3vich. A queuedSCRIPT LOADno longer gives an empty digest toNewScriptServerSHA(#4226), and theHOTKEYSCPU time fields use the names that the server sends (#4206) by @ump45nose
Observability
redisotel-native:server.portno longer contains the pool id (#4086) by @zhechen-cs. The connection count includes connections that existed beforeInit(#4089), and pending requests and state no longer drift acrossInitandShutdown(#4142) by @ninadsutrave. The pool usage metric does not underflow when pool statistics disagree (#4031) by @andystaples. The relaxed-timeout metric is recorded forSMIGRATING(#4390) by @ruziba3vich
- Short bulk strings in one write:
Writerwrites the header of a bulk string with one call, and writes the value and CRLF together when the value is 32 bytes or less. Benchmarks ofWriteArgsinto abufio.Writershowed 15% to 31% less time for each command on three CPUs, for example -24% to -26% forGET keyand -27% to -31% for an 8-pairMSET. The bytes on the wire do not change (#4281) by @g4lb - OpenTelemetry metrics: see the highlight above (#4269, #4406, #4407, #4408)
- CI images: the test matrix uses Redis 8.10.3 and 8.12.0 (#4231, #4241, #4264, #4288, #4404) by @ndyakov
- 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) - 32-bit build: a
386CI job runsgo vetand the tests, and the root tests compile for 32-bit (#4139) by @lazerg - Dependencies: the OpenTelemetry SDK and
golang.org/x/netare upgraded in the OTel adapters and examples, to fixgovulncheckfindings (#4087) by @ofekshenawa - Documentation: doc link definitions in the set and search command comments render as links on pkg.go.dev (#4328) by @farisbasha, and the dial and retry timing is documented (#4398) by @wozhenbang2004
- Regression and flaky tests: a cold-start full-duplex cluster test bounds the number of connections (#4223) by @ndyakov, a test locks the
MSETEXmulti-shard split (#4314) by @Zoomish, the autopipeline tests are consolidated from 28 files into 5 (#4091), and some tests move to the standardtestingpackage (#4085, #4187). Fixes for flaky or Redis Enterprise-incompatible specs: #4172, #4180, #4210, #4211, #4215, #4218, #4255, #4260, #4270, #4307
We'd like to thank all the contributors who worked on this release!
@AdamMagued, @aditya-rai-5, @andystaples, @aozmekik, @Avv123, @b84330808, @CaliLuke, @cpoole, @dunglas, @Dv2Corn, @farisbasha, @g4lb, @Grivn, @harshitdeora, @hktitof, @jayhemnani9910, @jjj-n, @kevin9327, @khasanovbi, @lazerg, @LindseyZ1205, @meruiden, @MokiMeow, @mtnaskari, @Nacl-HCl, @ndyakov, @ninadsutrave, @nk-batman21, @ofekshenawa, @othoathydrahost, @pcbeingused333, @PerryLink, @PragalvaXFREZ, @Purv-Kabaria, @RaphaelFakhri, @rleungx, @roganartu, @ruziba3vich, @saddamr3e, @Samuel-Sorial, @SergeiSadov, @soujasK, @spicysharkco, @SulimanAbdulrazzaq, @TastyHeadphones, @Tidehyc, @ump45nose, @VedantMadane, @vladvildanov, @vlady-kotsev, @waw666waw666, @wozhenbang2004, @xh123637, @xixi-box, @yamaankhan20, @yuefdev, @zhechen-cs, @Zoomish
Full Changelog: https://github.com/redis/go-redis/compare/v9.23.0...v9.24.0
v6.18.0
- Add integrations page, submissions and sponsorship policy by @asim in https://github.com/micro/go-micro/pull/5068
- Run vulnerability scans weekly and update Go to 1.26.11 by @asim in https://github.com/micro/go-micro/pull/5067
- fix(model): propagate in-stream provider errors by @shuaiyafei in https://github.com/micro/go-micro/pull/5066
- fix(ollama): avoid duplicating the cloud API version by @shuaiyafei in https://github.com/micro/go-micro/pull/5069
- fix(gemini): honor output caps during generation by @shuaiyafei in https://github.com/micro/go-micro/pull/5071
- fix(gemini): encode tool results as response objects by @shuaiyafei in https://github.com/micro/go-micro/pull/5072
- feat(registry): add kubernetes registry plugin by @jejefferson in https://github.com/micro/go-micro/pull/5073
- @shuaiyafei made their first contribution in https://github.com/micro/go-micro/pull/5066
Full Changelog: https://github.com/micro/go-micro/compare/v6.17.0...v6.18.0
Wails v3.2.0-nightly.20261123
Nightly preview of the upcoming v3.2.0.
- sync timestamp_server description with published field reference in PR by @taliesin-ai
🤖 This is an automated nightly pre-release generated from the latest changes on master. It is not selected by @latest; install it by its exact tag.
Installation:
go install github.com/wailsapp/wails/v3/cmd/wails3@v3.2.0-nightly.20261123
Tip: always pin an exact version (e.g. @v3.2.0-nightly.20261123) in go.mod and CI rather than @latest.
v1.80.0
v1.80.0 fixes client connection desynchronization when skipping response bodies and preserves cache variation headers during compression. It also adds helper APIs for downstream frameworks, makes parser errors matchable, and improves redirects, compression negotiation, and repeated-header handling.
- Skipping a response body no longer desynchronizes later requests. Reusing a
Responseafter HEAD no longer makes subsequent requests skip their bodies. When a caller explicitly skips a potentially present body,ClientandHostClientclose the connection instead of pooling it with unread bytes.PipelineClientreads and discards the body so the next pipelined response starts at the correct boundary. The caller'sSkipBodysetting is preserved. #2533 - Compression preserves every
Varyline. AddingAccept-Encodingno longer removes laterVaryfields, such asVary: Cookie. This fixes a regression that could let a shared cache reuse a response without considering all of its original variation criteria. BothCompressHandlerand compressed static-file serving are covered. #2598 - Unsigned float parsing rejects non-finite values and negative zero.
ParseUfloatand the argument getters that use it now reject NaN, infinity, and-0. Finite formats accepted bystrconv.ParseFloat, including a leading+, digit separators, and hexadecimal floats, remain supported. #2546
- Bounded decompression helpers work directly on byte slices.
AppendGunzipBytesWithLimit,AppendInflateBytesWithLimit,AppendUnbrotliBytesWithLimit, andAppendUnzstdBytesWithLimitappend decoded data while enforcing a limit on newly decoded bytes. Existing data in the destination does not count toward the limit. Exceeding the limit returnsErrBodyTooLarge; a non-positive limit leaves output unlimited. The zstd helper also limits decoder window size when a positive limit is supplied. #2520 - Frameworks can inspect header normalization and reuse redirect helpers.
RequestHeader.NormalizingDisabled()andResponseHeader.NormalizingDisabled()expose the current setting.HasNonHTTPSchemeWithoutAuthorityidentifies locations such asmailto:and native-app callbacks, andDefaultMaxRedirectsCountexports the existing default of 16.DoRedirectscontinues to use the count explicitly supplied by its caller. #2520 - Unsupported methods and unknown transfer codings have matchable errors.
errors.Iscan identifyErrUnsupportedRequestMethodregardless ofSecureErrorLogMessage. The newErrUnknownTransferCodingdistinguishes a well-formed but unsupported transfer coding from malformed framing and also matchesErrUnsupportedTransferEncoding. Custom error handlers can use these distinctions to choose between 501 and 400 responses; malformed request fields and targets still take precedence over an unknown coding. #2594
- Compression negotiation checks all supplied encodings.
HasAcceptEncodingscans everyAccept-Encodingheader line and continues after a matchingq=0member, so a later acceptable occurrence is considered. Compressible media types are also recognized case-insensitively. #2600, #2590, #2606 - Directory redirects preserve the client-facing path. For ordinary origin-form request targets,
FSadds the trailing slash to the original encoded path and retains the query string. Prefix stripping and virtual-host rewriting no longer expose the internal filesystem lookup path in the redirect. #2551 DoRedirectspreserves URL credentials on the initial request. Relative redirects retain URI credentials, while absolute redirects use only their own userinfo. An explicitAuthorizationheader still takes precedence and follows the existing host-based forwarding rules. #2531- URI updates separate queries from fragments. Updating a URI with
?next=2#newnow storesnext=2as the query andnewas the fragment, keeping the fragment out of the HTTP request line. Explicit empty query delimiters are preserved, including a redirect target ending in?. Hosts with an empty port, such asexample.com:or[::1]:, now receive the scheme's default port when dialing. #2592, #2603 - Repeated cookies and suppressed content types retain their meaning.
ResponseHeader.PeekAll("Set-Cookie")returns each cookie separately instead of joining them into one value;Peekis unchanged. Adaptednet/httphandlers that setContent-Typeto nil or empty now send no default content type, on both buffered and flushed responses. #2599, #2556
This release also adds a WebSocket README, reorganizes its tests, addresses intermittent CI failures, and clarifies retry callback eligibility and fragmented input to Request.Read.
- fix(client): don't let SkipBody desync reused responses and connections by @waw666waw666 in https://github.com/valyala/fasthttp/pull/2533
- fix: don't drop later Vary lines when adding Accept-Encoding by @waw666waw666 in https://github.com/valyala/fasthttp/pull/2598
- fix: reject NaN, infinity and negative zero in ParseUfloat by @Kernel-Hunter in https://github.com/valyala/fasthttp/pull/2546
- feat: add helper APIs for downstream frameworks by @gaby in https://github.com/valyala/fasthttp/pull/2520
- feat: make the unsupported method and unknown transfer coding errors matchable by @gaby in https://github.com/valyala/fasthttp/pull/2594
- fix(header): keep scanning Accept-Encoding after a q=0 member by @CJstate in https://github.com/valyala/fasthttp/pull/2590
- fix(fs): redirect a directory request to the path the client sent by @Dv2Corn in https://github.com/valyala/fasthttp/pull/2551
- fix: don't drop the URI userinfo in DoRedirects by @LuisFigueroaG in https://github.com/valyala/fasthttp/pull/2531
- fix(client): add the default port to a host with an empty port by @ruziba3vich in https://github.com/valyala/fasthttp/pull/2603
- fix(header): read every Accept-Encoding line in HasAcceptEncoding by @ruziba3vich in https://github.com/valyala/fasthttp/pull/2600
- fix: separate fragments in query-only URI updates by @anishpentyala in https://github.com/valyala/fasthttp/pull/2592
- fix(header): return each Set-Cookie value from ResponseHeader.PeekAll by @ruziba3vich in https://github.com/valyala/fasthttp/pull/2599
- fasthttpadaptor: send no Content-Type when the handler sets it to nil by @jaeminbird in https://github.com/valyala/fasthttp/pull/2556
- fix: recognize compressible media types case-insensitively by @Twiink in https://github.com/valyala/fasthttp/pull/2606
- websocket: sort the tests by file, tidy names and comments, add a README by @h2zi in https://github.com/valyala/fasthttp/pull/2558
- websocket: skip the tests that are flaky on Windows by @h2zi in https://github.com/valyala/fasthttp/pull/2587
- Fix five tests that fail intermittently in CI by @h2zi in https://github.com/valyala/fasthttp/pull/2589
- Fix typos in test comments by @ninglinLiu in https://github.com/valyala/fasthttp/pull/2596
- docs: clarify retry callback eligibility by @wozhenbang2004 in https://github.com/valyala/fasthttp/pull/2604
- docs: explain fragmented input to Request.Read by @wozhenbang2004 in https://github.com/valyala/fasthttp/pull/2605
- chore(deps): bump golang.org/x/crypto from 0.58.0 to 0.59.0 by @dependabot[bot] in https://github.com/valyala/fasthttp/pull/2588
- @waw666waw666 made their first contribution in https://github.com/valyala/fasthttp/pull/2533
- @Kernel-Hunter made their first contribution in https://github.com/valyala/fasthttp/pull/2546
- @ninglinLiu made their first contribution in https://github.com/valyala/fasthttp/pull/2596
- @ruziba3vich made their first contribution in https://github.com/valyala/fasthttp/pull/2603
- @anishpentyala made their first contribution in https://github.com/valyala/fasthttp/pull/2592
- @wozhenbang2004 made their first contribution in https://github.com/valyala/fasthttp/pull/2604
- @Twiink made their first contribution in https://github.com/valyala/fasthttp/pull/2606
Full Changelog: https://github.com/valyala/fasthttp/compare/v1.79.0...v1.80.0
v5.7.0
lego is an independent, free, and open-source project, if you value it, consider supporting it! ❤️
Everybody thinks that the others will donate, but in the end, nobody does.
So if you think that lego is worth it, please consider donating.
For key updates, see the changelog.
- 54679098948d4bae957fafc02ea1ee4621bf1242 Add DNS provider for Com Laude (#2886)
- bdad9af7b385246c27dbe483e3390c9c7845f693 Add DNS provider for Domain Chief (#3352)
- edac9cfbe87b3ecf8b5f5da685498f2ac5a0763e Add DNS provider for DonDominio/MrDomain (#3342)
- 20bf264d164d0cbde17193f1d6d6bd15adaec00b Add DNS provider for EdgeCDN-X (#3381)
- 2a69b7a3376bc5ef055a06e8b3d20edb45d32024 Add DNS provider for Gyro (#3370)
- 0f98a6d0091e57aa9e9688ffd4ffe9761cddf9fa Add DNS provider for NameOcean (#3376)
- 31cfb9d482f3793304921e4251d95b8a597797a4 curanet: rewrite tests related to oauth (#3336)
- e4545633ce536831472271c3cbac9c352b431a09 feat(cli): randomize the dynamic renewal period (#3386)
- 94c6728f1f8d80c08a4016f1c14e492fa848564c feat: Add DNS provider for TotalUptime (#3383)
- 168b9636e7b34a632a5556b9072296015079c9b6 feat: improve ACME server errors management (#3360)
- 0b28569a827205c0ad3ca7b865d66dd9accec2ce feat: support ML-DSA (#3365)
- 7c6c47714184a82bf019823eacab08805214df73 fix: malformed Forwarded header (#3374)
- b3392aad70bba9874d22d3e19d4b9fc20be12021 fix: retries nonce based on number of calls (#3343)
- 2c2e50c536e92b460162e1f0a5f0452a3c24dba7 gandiv5: remove useless lock (#3394)
- d7ae1324e9de568429172e17ced073e2a5f49eee gandiv5: use verification record endpoint (#3391)
- c41c7a892054f2f606fc2ea52a67380204a553cd katapult: fix cleanup (#3397)
- 62aaeb35ebd5a4ba2482440fbbe35bcb9d7aa298 mythicbeasts: rewrite token management (#3337)
- 5b554546cb3294178a079b5ac55b9245b69d5aea namecheap: improve clean up value (#3395)
- cf784c26d026c30ee9aaee7b7d48a7c5d2f1dcda netcupv1: fix subdomain parsing (#3367)
- d53b6993cedea1a585db6326cee3457bb5e3e8f7 openprovider: migrate from v1beta to v1 (#3349)
- d28153077f0f6fe5145ba5e77a9f707414af9a5d tests: add more tests on certcrypto (#3377)
- 9ea516c317b826b675fdb8846d71f7989833054f versio: provider deprecation (#3359)
v5.4.7
Security
- Proxy middleware: after routing, a
.or..path segment (also encoded as%2e) was resolved byRewrite/RegexRewriteor by the upstream into a path the router never matched.GET /api/x/../admin/usersmatched an unprotected/api/*proxy group but reached the upstream as/admin/users, skipping middleware such as authentication on/api/admin. After routing, Proxy now returns400 Bad Requestfor such paths, and rewrite targets in Proxy and the Rewrite middleware are applied literally instead of being resolved; a target with a dot segment or a leading//is rejected. Fixes GHSA-w5j2-g3fc-pwr6. Reported by AndyAnh174. - Static files:
Static,StaticFS,Group.StaticandGroup.StaticFSwith a prefix without a trailing slash registeredprefix*, so/assetsadmin/private.txtwas served from<root>/admin/private.txtfore.Static("/assets", root), bypassing a guard on/assets/admin. They now registerprefix/*, plusprefixfor the redirect toprefix/. Fixes GHSA-76qj-xf66-r429. Reported by AndyAnh174. - Static middleware on a group: documented that
middleware.Staticattached withGroup#Useis not protected by guards on routes inside the group or on nested groups, and thatGroup#Staticshould be used for files behind such guards. See GHSA-5hp7-4fcm-57f9. Reported by AndyAnh174.
Fixes
- Map binding: binding path, query, header or form data into a map whose value type is not
string,[]stringoranyreturns an error instead of skipping the values, and named string types no longer panic. Fixes #3235 in #3238. - Gzip middleware:
Accept-Encodingquality values are honored (gzip;q=0refuses gzip,x-gzipis accepted, substrings such asnotgzipno longer match), and responses that already have aContent-Encoding, for example from a reverse proxy, are passed through instead of compressed twice. Also fixesWritereporting more bytes than given at theMinLengththreshold, a truncated stream when a handler only flushes, and staleContent-LengthandContent-Encodingheaders. Fixes #3232 and #2788 in #3239. - Response:
Flushcommits an uncommitted response,WriteHeaderpasses 1xx informational codes (such as103 Early Hints) through without committing, and the built-in error handlers removeContent-Encoding,Content-LengthandContent-Dispositionbefore writing the error body. Fixes #3240, #3241 and #3242 in #3243.
Behavior changes
- After routing, Proxy rejects paths with
./..segments, and a Rewrite middleware attached after routing (onEcho#Use, a group or a route) applies its targets literally: relative targets and absolute URLs are rejected.Echo#Preis unchanged. StaticandStaticFSreturn theRouteInfoofprefix/*instead ofprefix*, and file names that only start with the prefix (for example/img-logo.pngfore.Static("/img-", dir)) are no longer served.- Binding into an unsupported map type returns
400 Bad Request. - A handler that sets
Content-Encodingitself is assumed to have encoded the body; the Gzip middleware no longer compresses it. - Custom
HTTPErrorHandlers still need to clear staleContent-Encoding,Content-LengthandContent-Dispositionthemselves.
No dependency or minimum Go-version changes.
v4.16.6
Security
- Proxy middleware: after routing, a
.or..path segment (also encoded as%2e) was resolved byRewrite/RegexRewriteor by the upstream into a path the router never matched, bypassing route and group middleware such as authentication. After routing, Proxy now returns400 Bad Requestfor such paths, and rewrite targets in Proxy and the Rewrite middleware are applied literally instead of being resolved; a target with a dot segment or a leading//is rejected. Fixes GHSA-w5j2-g3fc-pwr6. Reported by AndyAnh174. - Static files:
Static,StaticFS,Group.StaticandGroup.StaticFSwith a prefix without a trailing slash registeredprefix*, so/assetsadmin/private.txtwas served from<root>/admin/private.txtfore.Static("/assets", root), bypassing a guard on/assets/admin. They now registerprefix/*, plusprefixfor the redirect toprefix/. Fixes GHSA-76qj-xf66-r429. Reported by AndyAnh174. - Static middleware on a group: documented that
middleware.Staticattached withGroup#Useis not protected by guards on routes inside the group or on nested groups, and thatGroup#Staticshould be used for files behind such guards. See GHSA-5hp7-4fcm-57f9. Reported by AndyAnh174.
Behavior changes
- After routing, Proxy rejects paths with
./..segments, and a Rewrite middleware attached after routing applies its targets literally: relative targets and absolute URLs are rejected.Echo#Preis unchanged. StaticandStaticFSreturn the route forprefix/*instead ofprefix*, and file names that only start with the prefix are no longer served.
No public API, dependency or minimum Go-version changes; Go 1.26 or later remains required.
9.24.0-beta.2
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.
- 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
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
- 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
- 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)
We'd like to thank all the contributors who worked on this release!
@farisbasha, @kevin9327, @PerryLink, @ruziba3vich, @Tidehyc, @ump45nose, @xixi-box
Full Changelog: https://github.com/redis/go-redis/compare/v9.24.0-beta.1...v9.24.0-beta.2