[PoC] On op submission, wait to stringify until virtualization step#24281
Closed
markfields wants to merge 2 commits intomicrosoft:mainfrom
Closed
[PoC] On op submission, wait to stringify until virtualization step#24281markfields wants to merge 2 commits intomicrosoft:mainfrom
markfields wants to merge 2 commits intomicrosoft:mainfrom
Conversation
with LocalContainerRuntimeMessage
markfields
added a commit
that referenced
this pull request
Apr 9, 2025
…oundBatchMessage in Outbox and related code (#24287) This is a glorified "rename", splitting the type `BatchMessage` into two cases: `LocalBatchMessage` and `OutboundBatchMessage`, converting between the two when necessary. The intention is to change no behavior with this change. Here are the non-typing changes (that affect runtime code): * Renaming the property `contents` to `serializedOp` for the Local batch case * Shallow-copy the whole batch and each message in `Outbox.virtualizeBatch` to convert from `LocalBatch` to `OutboundBatch`. * This is where we copy `serializedOp` over to `contents`, which paves the way for `serializedOp` to stop being serialized in the next PR, which is the end goal here * Minor refactoring of `createEmptyGroupedBatch` to support both Local/Outbound forms ### Context As ops are accumulated into a batch in the ContainerRuntime, they're currently serialized immediately. However, we plan to keep those unserialized, and only stringify when virtualizing (grouping, compressing) in preparation to send to the server. See #24281. This is the first step there. We should model pre/post virtualized batches differently because they are different. pre-virtualization batch messages are called `LocalBatchMessage` and post-virtualization are called `OutboundBatchMessage`.
Member
Author
|
Final PR is here, closing this POC branch. |
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.
Reviewer Guidance
Proof of concept, will close
This will be split into 2-3 PRs:
BatchMessagetype intoLocalBatchMessageandOutboundBatchMessage-- refactor(container-runtime): Separate types LocalBatchMessage v. OutboundBatchMessage in Outbox and related code #24287LocalBatchMessageto retain the original runtime op -- feat(container-runtime): Retain original runtime op in pending local state, as opposed to the serialized op #24364Description
Today we stringify before putting the op into the Outbox and the PendingStateManager. This means that flows like Resubmit and Rollback don't get the original op, but rather a lossy string-roundtripped copy.
Instead, we can use the original op throughout the ContainerRuntime, and wait to stringify until virtualizing the batch of ops (grouping, compressing, chunking) on the way out of the outbox to the ordering service.