Skip to content

wal-protocol: rename Record→Command and unify payload types#4710

Merged
muhamadazmy merged 1 commit into
mainfrom
pr4710
May 11, 2026
Merged

wal-protocol: rename Record→Command and unify payload types#4710
muhamadazmy merged 1 commit into
mainfrom
pr4710

Conversation

@muhamadazmy
Copy link
Copy Markdown
Contributor

@muhamadazmy muhamadazmy commented May 10, 2026

wal-protocol: rename Record→Command and unify payload types

Follow-up cleanup on the v2 envelope abstraction in crates/wal-protocol

  • Collapse the Record::Payload associated type. The Command trait now
    bounds StorageEncode + StorageDecode directly, so each command type
    IS its own payload. This removes the empty marker structs
    (pub struct AnnounceLeader; impl Record for AnnounceLeader { type Payload = ... }) that the record! macro generated, and the matching
    command! macro is reduced to a single Sealed/Command impl.
  • Drop the RecordWithKeys trait in favor of a blanket
    impl<C: Command + HasRecordKeys> From<C> for PartialEnvelope, so
    building a partial envelope is payload.into() instead of
    MyRecord::partial(payload).

Stack created with Sapling. Best reviewed with ReviewStack.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 10, 2026

Test Results

  8 files  +  3    8 suites  +3   5m 14s ⏱️ - 1m 20s
 50 tests +  7   50 ✅ + 11  0 💤 ±0  0 ❌ ±0 
218 runs  +148  218 ✅ +152  0 💤 ±0  0 ❌ ±0 

Results for commit 082ee2e. ± Comparison against base commit 55e768b.

This pull request removes 43 and adds 50 tests. Note that renamed tests count towards both.
dev.restate.sdktesting.tests.AwakeableIngressEndpointTest ‑ completeWithFailure(Client)
dev.restate.sdktesting.tests.AwakeableIngressEndpointTest ‑ completeWithSuccess(Client)
dev.restate.sdktesting.tests.AwakeableLeaderTransferTest ‑ awakeableCompletionsAreNotLostDuringLeaderTransfer(Client, ContainerHandle)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ completeAwakeable(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ completeRetryableOperation(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ proxyCallShouldBeDone(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$NewVersion ‑ proxyOneWayCallShouldBeDone(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ createAwakeable(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ startOneWayProxyCall(Client)
dev.restate.sdktesting.tests.BackwardCompatibilityTest$OldVersion ‑ startProxyCall(Client)
…
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[1]
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[2]
dev.restate.sdktesting.tests.CallOrdering ‑ ordering(boolean[], Client)[3]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[1]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[2]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromAdminAPI(BlockingOperation, Client, URI)[3]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[1]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[2]
dev.restate.sdktesting.tests.Cancellation ‑ cancelFromContext(BlockingOperation, Client)[3]
dev.restate.sdktesting.tests.Combinators ‑ awakeableOrTimeoutUsingAwaitAny(Client)
…

♻️ This comment has been updated with latest results.

@muhamadazmy muhamadazmy changed the title wal-protocol: Command trait follow ups wal-protocol: rename Record→Command and unify payload types May 10, 2026
@muhamadazmy muhamadazmy marked this pull request as ready for review May 10, 2026 17:04
Copy link
Copy Markdown

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

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: 0da58d5dfc

ℹ️ 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".

Comment thread crates/wal-protocol/src/v2.rs Outdated
Follow-up cleanup on the v2 envelope abstraction in `crates/wal-protocol`

  - Collapse the `Record::Payload` associated type. The `Command` trait now
    bounds `StorageEncode + StorageDecode` directly, so each command type
    IS its own payload. This removes the empty marker structs
    (`pub struct AnnounceLeader; impl Record for AnnounceLeader { type
    Payload = ... }`) that the `record!` macro generated, and the matching
    `command!` macro is reduced to a single `Sealed`/`Command` impl.
  - Drop the `RecordWithKeys` trait in favor of a blanket
    `impl<C: Command + HasRecordKeys> From<C> for PartialEnvelope`, so
    building a partial envelope is `payload.into()` instead of
    `MyRecord::partial(payload)`.
Copy link
Copy Markdown
Contributor

@AhmedSoliman AhmedSoliman left a comment

Choose a reason for hiding this comment

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

Very neat. Thanks @muhamadazmy a lot.

@muhamadazmy muhamadazmy merged commit d71638a into main May 11, 2026
86 of 89 checks passed
@muhamadazmy muhamadazmy deleted the pr4710 branch May 11, 2026 09:18
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants