Repository navigation
v4: HOTKEYS and CLIENT KILL render through IRespArgument operands; dead List<RedisValue> builders deleted - #3321
Merged
Merged
Conversation
… dead List<RedisValue> builders go The v4 model is the interpolated writer: conditional clauses belong in an operand struct that writes straight into the frame, not in a RedisValue list spliced in as an array. HOTKEYS START and CLIENT KILL were the last two command paths still rendering the old way. - HotKeysStartArgs becomes HotKeysStartOperand, with the tokens as pre-framed RespLiterals; the STOP/RESET/GET subcommands move to fragments too. HotKeysWireTests pins the clause order byte for byte. - ClientKillFilter.ToList/ToArray become ClientKillFilter.Operand - still the one encoding both public spellings of CLIENT KILL share - and ClientKillCount takes the operand instead of a rendered span. The test that compared against ToList now asserts the rendered frame, which also covers the replica/slave spelling both ways. - Dead since the old core was deleted, called by nothing: the List-based GeoSearchShape.AddArgs overloads, the GeoRadiusOptions.AddArgs extension, and StreamIdempotentId.WriteTo(RedisValue[], ref int).
mgravell
added a commit
that referenced
this pull request
Nov 2, 2026
…s, and RenderedArgs goes (#3327) The stragglers #3321 deliberately left: LatencyEventNames (the string[] -> RedisValue[] copy) becomes an internal string[] overload on the Diagnostics group writing through EventNamesOperand; the handshake's CLIENT TRACKING broadcast splice becomes TrackingPrefixesOperand (nothing when prefix-less, collapsing the two broadcast branches), with the tokens moving to pre-framed RespLiterals fragments and the dead RedisValue literals - OFF included - retired; and RenderedArgs + IRenderedArgsOwner (no implementers since the old core went) are deleted along with their tests. Wire tests pin both operands byte-for-byte.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An audit of v4 for command paths still rendering arguments the legacy way — building a
RedisValuelist/array and splicing it in — rather than writing through the interpolated handler. This PR converts the two clear cases and deletes what the old-core removal orphaned.Converted
HotKeysStartArgs(List<RedisValue>→ToArray()→ spliced hole) becomesHotKeysStartOperand : IRespArgument, writing each conditional clause straight into the frame; the tokens are now pre-framedRespLiteralsfragments (START/METRICS/CPU/NET/DURATION/SAMPLE/STOP), and the STOP/RESET/GET subcommands move offRedisLiteralsvalues too.HotKeysWireTestspins the wire shape byte-for-byte, including the duration round-up.ClientKillFilter.ToList/ToArraybecomeClientKillFilter.Operand— still the one encoding shared by both public spellings — andClientKillCounttakes the operand instead of a pre-rendered span. The test that compared againstToListnow asserts the rendered frame, and gains a replica/slave spelling theory for both server generations.Deleted (dead since the old core went; no callers)
GeoSearchShape.AddArgs(List<RedisValue>)(abstract + both overrides) — the live path is theref RespRequestBuildertwin.GeoRadiusOptionsExtensions.AddArgs— same story.StreamIdempotentId.WriteTo(RedisValue[], ref int)— the live XADD path writes via the streamAddOperand.Deliberately omitted
Left as-is, each with an in-code comment defending the current form; flagging them so the omission is a decision rather than an oversight:
RedisServer.LatencyEventNames— onestring[]→RedisValue[]conversion feeding a span hole, documented as a single allocation on a cold admin path.RespHandshakeCLIENT TRACKING prefixes — buildsRedisValue[3 + 2n]for thePREFIXpairs because "the number of PREFIX pairs is not known until here"; an operand struct would solve exactly that, but it is handshake-only.RenderedArgs.cs+IRenderedArgsOwner— orphaned old-core machinery (zero references insrc; only its own tests exercise it), but it lives onmain, so deleting it in v4 buys recurring merge churn.DebuggingAids.cs/LoggingPipe.cs#if LOGOUTPUTblocks — extendPhysicalConnection, which no longer exists, so the define would no longer compile; same merge-churn consideration.Happy to fold any of the omitted items into this PR if the trade-offs read differently to you.