Skip to content

Deprecate OutboxMessage#4989

Open
muhamadazmy wants to merge 4 commits into
mainfrom
pr4989
Open

Deprecate OutboxMessage#4989
muhamadazmy wants to merge 4 commits into
mainfrom
pr4989

Conversation

@muhamadazmy

@muhamadazmy muhamadazmy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary:
This removes the OutboxMessage to:

  • Unify usage of v2 Command(s)
  • Avoid unecessary decoding of payloads when reading
    from the outbox and instead forward as is to remote partitions.

Stack created with Sapling. Best reviewed with ReviewStack.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Test Results

  8 files  ±0    8 suites  ±0   2m 52s ⏱️ - 2m 18s
 59 tests  - 2   59 ✅  - 2  0 💤 ±0  0 ❌ ±0 
266 runs   - 2  266 ✅  - 2  0 💤 ±0  0 ❌ ±0 

Results for commit 952b288. ± Comparison against base commit d98e546.

This pull request removes 2 tests.
dev.restate.sdktesting.tests.Custom ‑ run(CustomTestConfig, URI, URI)[1]
dev.restate.sdktesting.tests.ServiceToServiceScopeConcurrency ‑ scopeAndLimitKeyArePropagatedOnServiceToServiceCalls(URI, ContainerHandle, Client)

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Test Results

  8 files  ±0    8 suites  ±0   4m 46s ⏱️ -12s
 61 tests ±0   61 ✅ ±0  0 💤 ±0  0 ❌ ±0 
268 runs  ±0  268 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 4e31a34. ± Comparison against base commit de779f3.

♻️ This comment has been updated with latest results.

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::*>().
Summary:
This removes the `OutboxMessage` to:
- Unify usage of v2 Command(s)
- Avoid unecessary decoding of payloads when reading
  from the outbox and instead forward as is to remote partitions.
@muhamadazmy muhamadazmy marked this pull request as ready for review July 6, 2026 06:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e31a34807

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

self.bifrost_appender
.sender()
.enqueue(Arc::new(envelope))
.enqueue(BodyWithKeys::new(envelope.into_raw(), keys))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bump compatibility before writing v2 envelopes

This starts writing v2 Envelope<Raw> records to Bifrost, but the compatibility marker still advertises data written by this binary as readable by Restate 1.6.0 (crates/types/src/cluster_marker.rs:36-39 even notes the required 1.7 bump). In any downgrade or failover/replay by a 1.6 binary after a 1.8 leader has appended one of these Custom/v2 WAL records, marker validation can pass and the old binary cannot decode the log, so please bump the forward-compatible version before enabling v2 writes.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant