envelope-v2: write v2 envelopes with typed commands#4700
Open
muhamadazmy wants to merge 3 commits into
Open
Conversation
This was referenced May 7, 2026
muhamadazmy
force-pushed
the
pr4700
branch
15 times, most recently
from
May 10, 2026 16:14
9e6bfe2 to
c99555d
Compare
muhamadazmy
force-pushed
the
pr4700
branch
6 times, most recently
from
May 11, 2026 09:43
e68e277 to
94c8dfb
Compare
muhamadazmy
force-pushed
the
pr4700
branch
2 times, most recently
from
May 12, 2026 13:12
df8cd5c to
c908ab4
Compare
This was referenced May 12, 2026
muhamadazmy
force-pushed
the
pr4700
branch
4 times, most recently
from
May 13, 2026 07:23
2e13782 to
8032ac8
Compare
muhamadazmy
force-pushed
the
pr4700
branch
4 times, most recently
from
June 30, 2026 08:58
9551d11 to
58dafbd
Compare
muhamadazmy
marked this pull request as ready for review
June 30, 2026 08:58
muhamadazmy
force-pushed
the
pr4700
branch
2 times, most recently
from
June 30, 2026 14:03
0724585 to
7284b36
Compare
Switch the code paths that uses IngestionClient to start ingesting v2 Envelope instead of v1
Switch the worker's write path from the v1 Envelope/Command enum to v2
typed commands and Envelope<Raw>.
SelfProposer::{self_propose, self_propose_many, append_with_notification}
are now generic over `C: Command + HasRecordKeys` and derive the partition
key from the command via `record_keys()` — the explicit `partition_key`
parameter threaded through LeadershipState, the Actuator trait, and every
RPC handler is gone.
All worker RPC paths (append_invocation, append_invocation_response,
append_signal, cancel/kill/purge_invocation, purge_journal,
resume_invocation, restart_as_new_invocation, get_invocation_output) and
all leader-side ActionEffect proposals (Invoker, Shuffle, Timer, Cleaner,
UpsertSchema, UpsertRuleBook, scheduler decisions, version barriers,
AnnounceLeader) now construct typed commands::*Command values directly,
removing the Command::* enum wrapping and the BytesMut arena previously
used to pre-encode scheduler decisions.
With v2 envelopes now being written, drop the `try_v1_first` branch in
PartitionProcessor::decode_record — v2 is the fast path and v1 stays as
the TypedValueMismatch fallback for replay of older records. Tests under
leadership and rpc are updated to mock the new generic Actuator signatures
and decode via Envelope<Raw>::into_typed::<commands::*>().
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.
Switch the worker's write path from the v1 Envelope/Command enum to v2
typed commands and Envelope.
SelfProposer::{self_propose, self_propose_many, append_with_notification}
are now generic over
C: Command + HasRecordKeysand derive the partitionkey from the command via
record_keys()— the explicitpartition_keyparameter threaded through LeadershipState, the Actuator trait, and every
RPC handler is gone.
All worker RPC paths (append_invocation, append_invocation_response,
append_signal, cancel/kill/purge_invocation, purge_journal,
resume_invocation, restart_as_new_invocation, get_invocation_output) and
all leader-side ActionEffect proposals (Invoker, Shuffle, Timer, Cleaner,
UpsertSchema, UpsertRuleBook, scheduler decisions, version barriers,
AnnounceLeader) now construct typed commands::Command values directly,
removing the Command:: enum wrapping and the BytesMut arena previously
used to pre-encode scheduler decisions.
With v2 envelopes now being written, drop the
try_v1_firstbranch inPartitionProcessor::decode_record — v2 is the fast path and v1 stays as
the TypedValueMismatch fallback for replay of older records. Tests under
leadership and rpc are updated to mock the new generic Actuator signatures
and decode via Envelope::into_typed::commands::*().
Stack created with Sapling. Best reviewed with ReviewStack.
OutboxMessage#4989ingestionto use V2 #4980