-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContainerRuntime: Process incoming batches op-by-op instead of waiting for the whole batch #22508
Conversation
753648f
to
97cf37b
Compare
⯅ @fluid-example/bundle-size-tests: +1.32 KB
Baseline commit: da0c9fa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changeset looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me although I get a strong need to make the op processing clearer. We can consider a refactor in a subsequent PR
ContainerRuntime: Process incoming batches op-by-op instead of waiting for the whole batch (microsoft#22508) We are concerned that holding batch messages in ContainerRuntime even while DeltaManager advances its tracked sequence numbers through the batch could have unintended consequences. So this PR restores the old behavior of processing each message in a batch one-by-one, rather than holding until the whole batch arrives. Note that there's no change in behavior here for Grouped Batches. PR microsoft#21785 switched the RemoteMessageProcessor from returning ungrouped batch ops as they arrived, to holding them and finally returning the whole batch once the last arrived. The downstream code was also updated to take whole batches, whereas before it would take individual messages and use the batch metadata to detect batch start/end. Too many other changes were made after that PR to straight revert it. Logic was added throughout CR and PSM that looks at info about that batch which is found on the first message in the batch. So we can reverse the change and process one-at-a-time, but we need a way to carry around that "batch start info" with the first message in the batch. So we are now modeling the result that RMP yields as one of three cases: - A full batch of messages (could be from a single-message batch or a Grouped Batch) - The first message of a multi-message batch - The next message in a multi-message batch The first two cases include the "batch start info" needed for the recent Offline work. The third case just indicates whether it's the last message or not. "batch start info" and updating the downstream code to use that instead of reading it off the old "Inbound Batch" type. This PR now adds those other two cases to the RMP return type and handles processing them throughout CR and PSM.
…tches op-by-op instead of waiting for the whole batch) (#22654) ## Description Porting the following commits from `main` to `release/client/2.2`: * ce0a14c (Offline: Model empty batches differently, exposing the empty Grouped Batch message to more of the system) * e024b86 (ContainerRuntime: Refactor batch processing code to support either op-by-op or batch-all-at-once semantics) * 709f085 (ContainerRuntime: Process incoming batches op-by-op instead of waiting for the whole batch) ## Reviewer Guidance There was a ton of churn between 2.2 and 2.3 in this code (subset of [these changes to container-runtime dir](https://github.com/microsoft/FluidFramework/commits/release/client/2.3/packages/runtime/container-runtime?since=2024-08-17)), so the cherry-pick turned into more like a manual re-implementing of the change. In some ways it's a smaller diff compared to what needed to happen in `main`. So please review carefully as you would an original PR.
Description
Fixes AB#15221
Why
We are concerned that holding batch messages in ContainerRuntime even while DeltaManager advances its tracked sequence numbers through the batch could have unintended consequences. So this PR restores the old behavior of processing each message in a batch one-by-one, rather than holding until the whole batch arrives.
Note that there's no change in behavior here for Grouped Batches.
How
PR #21785 switched the RemoteMessageProcessor from returning ungrouped batch ops as they arrived, to holding them and finally returning the whole batch once the last arrived. The downstream code was also updated to take whole batches, whereas before it would take individual messages and use the batch metadata to detect batch start/end.
Too many other changes were made after that PR to straight revert it. Logic was added throughout CR and PSM that looks at info about that batch which is found on the first message in the batch. So we can reverse the change and process one-at-a-time, but we need a way to carry around that "batch start info" with the first message in the batch.
So we are now modeling the result that RMP yields as one of three cases:
The first two cases include the "batch start info" needed for the recent Offline work. The third case just indicates whether it's the last message or not.
#22501 added some of the necessary structure, introducing the type for "batch start info" and updating the downstream code to use that instead of reading it off the old "Inbound Batch" type. This PR now adds those other two cases to the RMP return type and handles processing them throughout CR and PSM.
Reviewer Guidance
Planning to port back to 2.2