Skip to content
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

Offline: Detect duplicate sequenced batches and close the container #22310

Merged
merged 24 commits into from
Sep 4, 2024

Conversation

markfields
Copy link
Member

@markfields markfields commented Aug 24, 2024

Description

Fixes AB#8884

If the same batch is submitted twice in parallel by two rehydrated forks of the same container, the duplicate will get sequenced, and all subsequent clients will need to notice this to avoid applying both copies.

For now, we will simply detect this case and close the container with a DataCorruptionError.

@github-actions github-actions bot added area: loader Loader related issues area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch labels Aug 24, 2024
markfields added a commit that referenced this pull request Aug 29, 2024
…Batch message to more of the system (#22343)

Empty batches are a unique case, where we submit a Grouped Batch message
with no inner runtime messages. This is needed for tracking batches
between forks of a container (each trying to resubmit the same local
content).

There are several flows that need the message or at least
sequenceNumber-related metadata:
* BatchStart/BatchEnd events
* DeltaScheduler
* savedOps mechanism in PendingStateManager
* The DataProcessingError thrown if the container forks
* Future (See #22310): MinimumSequenceNumber

We used to include the `emptyBatchSequenceNumber` and that partially
addressed this, but it's better to include the whole message. So add
this as the `keyMessage` to `InboundBatch` type - and for non-empty
batches this is just the first message (we were already referring to
that in certain places).
Made some material changes to pendingStateManager.spec.ts
@github-actions github-actions bot removed the area: loader Loader related issues label Aug 30, 2024
@markfields markfields marked this pull request as ready for review August 30, 2024 23:57
@markfields markfields requested review from anthony-murphy, dannimad, a team, pragya91, jatgarg, tyler-cai-microsoft, kian-thompson and rajatch-ff and removed request for a team August 30, 2024 23:57
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Sep 4, 2024

@fluid-example/bundle-size-tests: +5.18 KB
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 459.92 KB 461.18 KB +1.27 KB
azureClient.js 557.96 KB 559.24 KB +1.28 KB
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 260.75 KB 262 KB +1.25 KB
fluidFramework.js 399.28 KB 399.29 KB +14 Bytes
loader.js 134.26 KB 134.28 KB +14 Bytes
map.js 42.39 KB 42.39 KB +7 Bytes
matrix.js 146.56 KB 146.56 KB +7 Bytes
odspClient.js 525.23 KB 526.52 KB +1.28 KB
odspDriver.js 97.72 KB 97.74 KB +21 Bytes
odspPrefetchSnapshot.js 42.78 KB 42.79 KB +14 Bytes
sharedString.js 163.26 KB 163.26 KB +7 Bytes
sharedTree.js 389.79 KB 389.8 KB +7 Bytes
Total Size 3.29 MB 3.3 MB +5.18 KB

Baseline commit: b2deac2

Generated by 🚫 dangerJS against 1d6c394

@markfields markfields merged commit ccdc65b into microsoft:main Sep 4, 2024
30 checks passed
@markfields markfields deleted the o3/m2 branch September 4, 2024 20:10
markfields added a commit to markfields/FluidFramework that referenced this pull request Sep 26, 2024
Offline: Model empty batches differently, exposing the empty Grouped Batch message to more of the system (microsoft#22343)

Empty batches are a unique case, where we submit a Grouped Batch message
with no inner runtime messages. This is needed for tracking batches
between forks of a container (each trying to resubmit the same local
content).

There are several flows that need the message or at least
sequenceNumber-related metadata:
* BatchStart/BatchEnd events
* DeltaScheduler
* savedOps mechanism in PendingStateManager
* The DataProcessingError thrown if the container forks
* Future (See microsoft#22310): MinimumSequenceNumber

We used to include the `emptyBatchSequenceNumber` and that partially
addressed this, but it's better to include the whole message. So add
this as the `keyMessage` to `InboundBatch` type - and for non-empty
batches this is just the first message (we were already referring to
that in certain places).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants