@fluidframework/container-runtime 2.0.0-dev.3.1.0.125672 → 2.0.0-dev.4.1.0.148229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blobManager.d.ts +24 -11
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +112 -55
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +60 -75
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +295 -256
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +39 -13
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +112 -49
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +28 -4
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +107 -41
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts +19 -0
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -0
- package/dist/deltaManagerSummarizerProxy.js +40 -0
- package/dist/deltaManagerSummarizerProxy.js.map +1 -0
- package/dist/gc/garbageCollection.d.ts +204 -0
- package/dist/gc/garbageCollection.d.ts.map +1 -0
- package/dist/{garbageCollection.js → gc/garbageCollection.js} +190 -554
- package/dist/gc/garbageCollection.js.map +1 -0
- package/dist/gc/gcConfigs.d.ts +22 -0
- package/dist/gc/gcConfigs.d.ts.map +1 -0
- package/dist/gc/gcConfigs.js +143 -0
- package/dist/gc/gcConfigs.js.map +1 -0
- package/dist/gc/gcDefinitions.d.ts +320 -0
- package/dist/gc/gcDefinitions.d.ts.map +1 -0
- package/dist/gc/gcDefinitions.js +81 -0
- package/dist/gc/gcDefinitions.js.map +1 -0
- package/dist/gc/gcHelpers.d.ts +86 -0
- package/dist/gc/gcHelpers.d.ts.map +1 -0
- package/dist/gc/gcHelpers.js +268 -0
- package/dist/gc/gcHelpers.js.map +1 -0
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts +16 -0
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
- package/dist/gc/gcReferenceGraphAlgorithm.js +49 -0
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -0
- package/dist/gc/gcSummaryDefinitions.d.ts +52 -0
- package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -0
- package/dist/gc/gcSummaryDefinitions.js +7 -0
- package/dist/gc/gcSummaryDefinitions.js.map +1 -0
- package/dist/gc/gcSummaryStateTracker.d.ts +93 -0
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/dist/gc/gcSummaryStateTracker.js +239 -0
- package/dist/gc/gcSummaryStateTracker.js.map +1 -0
- package/dist/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/dist/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +2 -2
- package/dist/gc/gcSweepReadyUsageDetection.js.map +1 -0
- package/dist/gc/gcUnreferencedStateTracker.d.ts +34 -0
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/dist/gc/gcUnreferencedStateTracker.js +94 -0
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -0
- package/dist/gc/index.d.ts +13 -0
- package/dist/gc/index.d.ts.map +1 -0
- package/dist/gc/index.js +50 -0
- package/dist/gc/index.js.map +1 -0
- package/dist/index.d.ts +3 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -9
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +11 -13
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +26 -38
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +4 -0
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +1 -1
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +2 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +25 -10
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +4 -0
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +42 -4
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +15 -3
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +35 -10
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +19 -3
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +88 -49
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +3 -3
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +20 -21
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/storageServiceWithAttachBlobs.d.ts +17 -0
- package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -0
- package/dist/storageServiceWithAttachBlobs.js +32 -0
- package/dist/storageServiceWithAttachBlobs.js.map +1 -0
- package/dist/summary/index.d.ts +17 -0
- package/dist/summary/index.d.ts.map +1 -0
- package/dist/summary/index.js +46 -0
- package/dist/summary/index.js.map +1 -0
- package/dist/summary/orderedClientElection.d.ts.map +1 -0
- package/dist/summary/orderedClientElection.js.map +1 -0
- package/dist/{runWhileConnectedCoordinator.d.ts → summary/runWhileConnectedCoordinator.d.ts} +3 -2
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/dist/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.js} +5 -4
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -0
- package/{lib → dist/summary}/runningSummarizer.d.ts +19 -18
- package/dist/summary/runningSummarizer.d.ts.map +1 -0
- package/dist/{runningSummarizer.js → summary/runningSummarizer.js} +158 -56
- package/dist/summary/runningSummarizer.js.map +1 -0
- package/dist/{summarizer.d.ts → summary/summarizer.d.ts} +4 -9
- package/dist/summary/summarizer.d.ts.map +1 -0
- package/dist/{summarizer.js → summary/summarizer.js} +9 -74
- package/dist/summary/summarizer.js.map +1 -0
- package/dist/summary/summarizerClientElection.d.ts.map +1 -0
- package/dist/summary/summarizerClientElection.js.map +1 -0
- package/{lib → dist/summary}/summarizerHeuristics.d.ts +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -0
- package/dist/{summarizerHeuristics.js → summary/summarizerHeuristics.js} +3 -3
- package/dist/summary/summarizerHeuristics.js.map +1 -0
- package/dist/summary/summarizerNode/index.d.ts +8 -0
- package/dist/summary/summarizerNode/index.d.ts.map +1 -0
- package/dist/summary/summarizerNode/index.js +12 -0
- package/dist/summary/summarizerNode/index.js.map +1 -0
- package/dist/summary/summarizerNode/summarizerNode.d.ts +149 -0
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNode.js +531 -0
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +125 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +132 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +22 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +423 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
- package/{lib → dist/summary}/summarizerTypes.d.ts +7 -17
- package/dist/summary/summarizerTypes.d.ts.map +1 -0
- package/dist/{summarizerTypes.js → summary/summarizerTypes.js} +0 -5
- package/dist/summary/summarizerTypes.js.map +1 -0
- package/dist/summary/summaryCollection.d.ts.map +1 -0
- package/dist/summary/summaryCollection.js.map +1 -0
- package/{lib → dist/summary}/summaryFormat.d.ts +3 -21
- package/dist/summary/summaryFormat.d.ts.map +1 -0
- package/dist/{summaryFormat.js → summary/summaryFormat.js} +1 -10
- package/dist/summary/summaryFormat.js.map +1 -0
- package/dist/summary/summaryGenerator.d.ts.map +1 -0
- package/dist/{summaryGenerator.js → summary/summaryGenerator.js} +4 -4
- package/dist/summary/summaryGenerator.js.map +1 -0
- package/dist/{summaryManager.d.ts → summary/summaryManager.d.ts} +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -0
- package/dist/summary/summaryManager.js.map +1 -0
- package/lib/blobManager.d.ts +24 -11
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +109 -52
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +60 -75
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +267 -228
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +39 -13
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +101 -38
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +28 -4
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +100 -34
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts +19 -0
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -0
- package/lib/deltaManagerSummarizerProxy.js +36 -0
- package/lib/deltaManagerSummarizerProxy.js.map +1 -0
- package/lib/gc/garbageCollection.d.ts +204 -0
- package/lib/gc/garbageCollection.d.ts.map +1 -0
- package/lib/{garbageCollection.js → gc/garbageCollection.js} +172 -535
- package/lib/gc/garbageCollection.js.map +1 -0
- package/lib/gc/gcConfigs.d.ts +22 -0
- package/lib/gc/gcConfigs.d.ts.map +1 -0
- package/lib/gc/gcConfigs.js +139 -0
- package/lib/gc/gcConfigs.js.map +1 -0
- package/lib/gc/gcDefinitions.d.ts +320 -0
- package/lib/gc/gcDefinitions.d.ts.map +1 -0
- package/lib/gc/gcDefinitions.js +78 -0
- package/lib/gc/gcDefinitions.js.map +1 -0
- package/lib/gc/gcHelpers.d.ts +86 -0
- package/lib/gc/gcHelpers.d.ts.map +1 -0
- package/lib/gc/gcHelpers.js +254 -0
- package/lib/gc/gcHelpers.js.map +1 -0
- package/lib/gc/gcReferenceGraphAlgorithm.d.ts +16 -0
- package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
- package/lib/gc/gcReferenceGraphAlgorithm.js +45 -0
- package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -0
- package/lib/gc/gcSummaryDefinitions.d.ts +52 -0
- package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -0
- package/lib/gc/gcSummaryDefinitions.js +6 -0
- package/lib/gc/gcSummaryDefinitions.js.map +1 -0
- package/lib/gc/gcSummaryStateTracker.d.ts +93 -0
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/lib/gc/gcSummaryStateTracker.js +235 -0
- package/lib/gc/gcSummaryStateTracker.js.map +1 -0
- package/lib/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/lib/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +1 -1
- package/lib/gc/gcSweepReadyUsageDetection.js.map +1 -0
- package/lib/gc/gcUnreferencedStateTracker.d.ts +34 -0
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/lib/gc/gcUnreferencedStateTracker.js +90 -0
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -0
- package/lib/gc/index.d.ts +13 -0
- package/lib/gc/index.d.ts.map +1 -0
- package/lib/gc/index.js +12 -0
- package/lib/gc/index.js.map +1 -0
- package/lib/index.d.ts +3 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -4
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +11 -13
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +24 -37
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +4 -0
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +1 -1
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +1 -1
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +26 -11
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +4 -0
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +42 -4
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +15 -3
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +35 -10
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +19 -3
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +90 -51
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +3 -3
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +20 -21
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/storageServiceWithAttachBlobs.d.ts +17 -0
- package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -0
- package/lib/storageServiceWithAttachBlobs.js +28 -0
- package/lib/storageServiceWithAttachBlobs.js.map +1 -0
- package/lib/summary/index.d.ts +17 -0
- package/lib/summary/index.d.ts.map +1 -0
- package/lib/summary/index.js +15 -0
- package/lib/summary/index.js.map +1 -0
- package/lib/summary/orderedClientElection.d.ts.map +1 -0
- package/lib/summary/orderedClientElection.js.map +1 -0
- package/lib/{runWhileConnectedCoordinator.d.ts → summary/runWhileConnectedCoordinator.d.ts} +3 -2
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/lib/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.js} +5 -4
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -0
- package/{dist → lib/summary}/runningSummarizer.d.ts +19 -18
- package/lib/summary/runningSummarizer.d.ts.map +1 -0
- package/lib/{runningSummarizer.js → summary/runningSummarizer.js} +159 -57
- package/lib/summary/runningSummarizer.js.map +1 -0
- package/lib/{summarizer.d.ts → summary/summarizer.d.ts} +4 -9
- package/lib/summary/summarizer.d.ts.map +1 -0
- package/lib/{summarizer.js → summary/summarizer.js} +11 -76
- package/lib/summary/summarizer.js.map +1 -0
- package/lib/summary/summarizerClientElection.d.ts.map +1 -0
- package/lib/summary/summarizerClientElection.js.map +1 -0
- package/{dist → lib/summary}/summarizerHeuristics.d.ts +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -0
- package/lib/{summarizerHeuristics.js → summary/summarizerHeuristics.js} +3 -3
- package/lib/summary/summarizerHeuristics.js.map +1 -0
- package/lib/summary/summarizerNode/index.d.ts +8 -0
- package/lib/summary/summarizerNode/index.d.ts.map +1 -0
- package/lib/summary/summarizerNode/index.js +7 -0
- package/lib/summary/summarizerNode/index.js.map +1 -0
- package/lib/summary/summarizerNode/summarizerNode.d.ts +149 -0
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNode.js +526 -0
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +125 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +125 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +22 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +419 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
- package/{dist → lib/summary}/summarizerTypes.d.ts +7 -17
- package/lib/summary/summarizerTypes.d.ts.map +1 -0
- package/lib/summary/summarizerTypes.js +6 -0
- package/{dist → lib/summary}/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts.map +1 -0
- package/lib/summary/summaryCollection.js.map +1 -0
- package/{dist → lib/summary}/summaryFormat.d.ts +3 -21
- package/lib/summary/summaryFormat.d.ts.map +1 -0
- package/lib/{summaryFormat.js → summary/summaryFormat.js} +0 -8
- package/lib/summary/summaryFormat.js.map +1 -0
- package/lib/summary/summaryGenerator.d.ts.map +1 -0
- package/lib/{summaryGenerator.js → summary/summaryGenerator.js} +4 -4
- package/lib/summary/summaryGenerator.js.map +1 -0
- package/lib/{summaryManager.d.ts → summary/summaryManager.d.ts} +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -0
- package/lib/summary/summaryManager.js.map +1 -0
- package/package.json +63 -60
- package/src/blobManager.ts +132 -69
- package/src/containerRuntime.ts +421 -382
- package/src/dataStoreContext.ts +140 -49
- package/src/dataStores.ts +139 -41
- package/src/deltaManagerSummarizerProxy.ts +46 -0
- package/{garbageCollection.md → src/gc/garbageCollection.md} +2 -2
- package/src/{garbageCollection.ts → gc/garbageCollection.ts} +245 -890
- package/src/gc/gcConfigs.ts +193 -0
- package/src/gc/gcDefinitions.ts +387 -0
- package/src/gc/gcHelpers.ts +332 -0
- package/src/gc/gcReferenceGraphAlgorithm.ts +52 -0
- package/src/gc/gcSummaryDefinitions.ts +54 -0
- package/src/gc/gcSummaryStateTracker.ts +329 -0
- package/src/{gcSweepReadyUsageDetection.ts → gc/gcSweepReadyUsageDetection.ts} +1 -1
- package/src/gc/gcUnreferencedStateTracker.ts +114 -0
- package/src/gc/index.ts +65 -0
- package/src/index.ts +10 -22
- package/src/opLifecycle/README.md +157 -0
- package/src/opLifecycle/batchManager.ts +26 -55
- package/src/opLifecycle/definitions.ts +4 -0
- package/src/opLifecycle/index.ts +1 -1
- package/src/opLifecycle/opCompressor.ts +32 -12
- package/src/opLifecycle/opDecompressor.ts +49 -5
- package/src/opLifecycle/opSplitter.ts +55 -12
- package/src/opLifecycle/outbox.ts +120 -60
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +34 -27
- package/src/storageServiceWithAttachBlobs.ts +38 -0
- package/src/summary/index.ts +105 -0
- package/src/{runWhileConnectedCoordinator.ts → summary/runWhileConnectedCoordinator.ts} +7 -7
- package/src/{runningSummarizer.ts → summary/runningSummarizer.ts} +279 -139
- package/src/{summarizer.ts → summary/summarizer.ts} +12 -97
- package/src/{summarizerHeuristics.ts → summary/summarizerHeuristics.ts} +9 -4
- package/src/summary/summarizerNode/index.ts +12 -0
- package/src/summary/summarizerNode/summarizerNode.ts +766 -0
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +214 -0
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +644 -0
- package/src/{summarizerTypes.ts → summary/summarizerTypes.ts} +8 -22
- package/src/{summaryFormat.ts → summary/summaryFormat.ts} +3 -29
- package/src/{summaryGenerator.ts → summary/summaryGenerator.ts} +12 -11
- package/src/{summaryManager.ts → summary/summaryManager.ts} +1 -1
- package/dist/garbageCollection.d.ts +0 -411
- package/dist/garbageCollection.d.ts.map +0 -1
- package/dist/garbageCollection.js.map +0 -1
- package/dist/garbageCollectionConstants.d.ts +0 -23
- package/dist/garbageCollectionConstants.d.ts.map +0 -1
- package/dist/garbageCollectionConstants.js +0 -36
- package/dist/garbageCollectionConstants.js.map +0 -1
- package/dist/garbageCollectionHelpers.d.ts +0 -15
- package/dist/garbageCollectionHelpers.d.ts.map +0 -1
- package/dist/garbageCollectionHelpers.js +0 -27
- package/dist/garbageCollectionHelpers.js.map +0 -1
- package/dist/gcSweepReadyUsageDetection.d.ts.map +0 -1
- package/dist/gcSweepReadyUsageDetection.js.map +0 -1
- package/dist/orderedClientElection.d.ts.map +0 -1
- package/dist/orderedClientElection.js.map +0 -1
- package/dist/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/dist/runWhileConnectedCoordinator.js.map +0 -1
- package/dist/runningSummarizer.d.ts.map +0 -1
- package/dist/runningSummarizer.js.map +0 -1
- package/dist/serializedSnapshotStorage.d.ts +0 -58
- package/dist/serializedSnapshotStorage.d.ts.map +0 -1
- package/dist/serializedSnapshotStorage.js +0 -110
- package/dist/serializedSnapshotStorage.js.map +0 -1
- package/dist/summarizer.d.ts.map +0 -1
- package/dist/summarizer.js.map +0 -1
- package/dist/summarizerClientElection.d.ts.map +0 -1
- package/dist/summarizerClientElection.js.map +0 -1
- package/dist/summarizerHandle.d.ts +0 -12
- package/dist/summarizerHandle.d.ts.map +0 -1
- package/dist/summarizerHandle.js +0 -22
- package/dist/summarizerHandle.js.map +0 -1
- package/dist/summarizerHeuristics.d.ts.map +0 -1
- package/dist/summarizerHeuristics.js.map +0 -1
- package/dist/summarizerTypes.d.ts.map +0 -1
- package/dist/summaryCollection.d.ts.map +0 -1
- package/dist/summaryCollection.js.map +0 -1
- package/dist/summaryFormat.d.ts.map +0 -1
- package/dist/summaryFormat.js.map +0 -1
- package/dist/summaryGenerator.d.ts.map +0 -1
- package/dist/summaryGenerator.js.map +0 -1
- package/dist/summaryManager.d.ts.map +0 -1
- package/dist/summaryManager.js.map +0 -1
- package/lib/garbageCollection.d.ts +0 -411
- package/lib/garbageCollection.d.ts.map +0 -1
- package/lib/garbageCollection.js.map +0 -1
- package/lib/garbageCollectionConstants.d.ts +0 -23
- package/lib/garbageCollectionConstants.d.ts.map +0 -1
- package/lib/garbageCollectionConstants.js +0 -33
- package/lib/garbageCollectionConstants.js.map +0 -1
- package/lib/garbageCollectionHelpers.d.ts +0 -15
- package/lib/garbageCollectionHelpers.d.ts.map +0 -1
- package/lib/garbageCollectionHelpers.js +0 -23
- package/lib/garbageCollectionHelpers.js.map +0 -1
- package/lib/gcSweepReadyUsageDetection.d.ts.map +0 -1
- package/lib/gcSweepReadyUsageDetection.js.map +0 -1
- package/lib/orderedClientElection.d.ts.map +0 -1
- package/lib/orderedClientElection.js.map +0 -1
- package/lib/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/lib/runWhileConnectedCoordinator.js.map +0 -1
- package/lib/runningSummarizer.d.ts.map +0 -1
- package/lib/runningSummarizer.js.map +0 -1
- package/lib/serializedSnapshotStorage.d.ts +0 -58
- package/lib/serializedSnapshotStorage.d.ts.map +0 -1
- package/lib/serializedSnapshotStorage.js +0 -106
- package/lib/serializedSnapshotStorage.js.map +0 -1
- package/lib/summarizer.d.ts.map +0 -1
- package/lib/summarizer.js.map +0 -1
- package/lib/summarizerClientElection.d.ts.map +0 -1
- package/lib/summarizerClientElection.js.map +0 -1
- package/lib/summarizerHandle.d.ts +0 -12
- package/lib/summarizerHandle.d.ts.map +0 -1
- package/lib/summarizerHandle.js +0 -18
- package/lib/summarizerHandle.js.map +0 -1
- package/lib/summarizerHeuristics.d.ts.map +0 -1
- package/lib/summarizerHeuristics.js.map +0 -1
- package/lib/summarizerTypes.d.ts.map +0 -1
- package/lib/summarizerTypes.js +0 -9
- package/lib/summarizerTypes.js.map +0 -1
- package/lib/summaryCollection.d.ts.map +0 -1
- package/lib/summaryCollection.js.map +0 -1
- package/lib/summaryFormat.d.ts.map +0 -1
- package/lib/summaryFormat.js.map +0 -1
- package/lib/summaryGenerator.d.ts.map +0 -1
- package/lib/summaryGenerator.js.map +0 -1
- package/lib/summaryManager.d.ts.map +0 -1
- package/lib/summaryManager.js.map +0 -1
- package/src/garbageCollectionConstants.ts +0 -38
- package/src/garbageCollectionHelpers.ts +0 -37
- package/src/serializedSnapshotStorage.ts +0 -151
- package/src/summarizerHandle.ts +0 -23
- /package/dist/{gcSweepReadyUsageDetection.d.ts → gc/gcSweepReadyUsageDetection.d.ts} +0 -0
- /package/dist/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
- /package/dist/{orderedClientElection.js → summary/orderedClientElection.js} +0 -0
- /package/dist/{summarizerClientElection.d.ts → summary/summarizerClientElection.d.ts} +0 -0
- /package/dist/{summarizerClientElection.js → summary/summarizerClientElection.js} +0 -0
- /package/dist/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +0 -0
- /package/dist/{summaryCollection.js → summary/summaryCollection.js} +0 -0
- /package/dist/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +0 -0
- /package/dist/{summaryManager.js → summary/summaryManager.js} +0 -0
- /package/lib/{gcSweepReadyUsageDetection.d.ts → gc/gcSweepReadyUsageDetection.d.ts} +0 -0
- /package/lib/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
- /package/lib/{orderedClientElection.js → summary/orderedClientElection.js} +0 -0
- /package/lib/{summarizerClientElection.d.ts → summary/summarizerClientElection.d.ts} +0 -0
- /package/lib/{summarizerClientElection.js → summary/summarizerClientElection.js} +0 -0
- /package/lib/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +0 -0
- /package/lib/{summaryCollection.js → summary/summaryCollection.js} +0 -0
- /package/lib/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +0 -0
- /package/lib/{summaryManager.js → summary/summaryManager.js} +0 -0
- /package/src/{orderedClientElection.ts → summary/orderedClientElection.ts} +0 -0
- /package/src/{summarizerClientElection.ts → summary/summarizerClientElection.ts} +0 -0
- /package/src/{summaryCollection.ts → summary/summaryCollection.ts} +0 -0
|
@@ -6,11 +6,16 @@
|
|
|
6
6
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
7
7
|
import { assert } from "@fluidframework/common-utils";
|
|
8
8
|
import { IContainerContext } from "@fluidframework/container-definitions";
|
|
9
|
-
import { GenericError } from "@fluidframework/container-utils";
|
|
9
|
+
import { GenericError, UsageError } from "@fluidframework/container-utils";
|
|
10
10
|
import { MessageType } from "@fluidframework/protocol-definitions";
|
|
11
|
+
import {
|
|
12
|
+
ChildLogger,
|
|
13
|
+
loggerToMonitoringContext,
|
|
14
|
+
MonitoringContext,
|
|
15
|
+
} from "@fluidframework/telemetry-utils";
|
|
11
16
|
import { ICompressionRuntimeOptions } from "../containerRuntime";
|
|
12
17
|
import { PendingStateManager } from "../pendingStateManager";
|
|
13
|
-
import { BatchManager } from "./batchManager";
|
|
18
|
+
import { BatchManager, estimateSocketSize } from "./batchManager";
|
|
14
19
|
import { BatchMessage, IBatch } from "./definitions";
|
|
15
20
|
import { OpCompressor } from "./opCompressor";
|
|
16
21
|
import { OpSplitter } from "./opSplitter";
|
|
@@ -19,7 +24,7 @@ export interface IOutboxConfig {
|
|
|
19
24
|
readonly compressionOptions: ICompressionRuntimeOptions;
|
|
20
25
|
// The maximum size of a batch that we can send over the wire.
|
|
21
26
|
readonly maxBatchSizeInBytes: number;
|
|
22
|
-
readonly
|
|
27
|
+
readonly disablePartialFlush: boolean;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
export interface IOutboxParameters {
|
|
@@ -33,11 +38,22 @@ export interface IOutboxParameters {
|
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
export class Outbox {
|
|
41
|
+
private readonly mc: MonitoringContext;
|
|
36
42
|
private readonly attachFlowBatch: BatchManager;
|
|
37
43
|
private readonly mainBatch: BatchManager;
|
|
38
|
-
private readonly defaultAttachFlowSoftLimitInBytes =
|
|
44
|
+
private readonly defaultAttachFlowSoftLimitInBytes = 320 * 1024;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Track the number of ops which were detected to have a mismatched
|
|
48
|
+
* reference sequence number, in order to self-throttle the telemetry events.
|
|
49
|
+
*
|
|
50
|
+
* This should be removed as part of ADO:2322
|
|
51
|
+
*/
|
|
52
|
+
private readonly maxMismatchedOpsToReport = 3;
|
|
53
|
+
private mismatchedOpsReported = 0;
|
|
39
54
|
|
|
40
55
|
constructor(private readonly params: IOutboxParameters) {
|
|
56
|
+
this.mc = loggerToMonitoringContext(ChildLogger.create(params.logger, "Outbox"));
|
|
41
57
|
const isCompressionEnabled =
|
|
42
58
|
this.params.config.compressionOptions.minimumBatchSizeInBytes !==
|
|
43
59
|
Number.POSITIVE_INFINITY;
|
|
@@ -45,28 +61,63 @@ export class Outbox {
|
|
|
45
61
|
const hardLimit = isCompressionEnabled ? Infinity : this.params.config.maxBatchSizeInBytes;
|
|
46
62
|
const softLimit = isCompressionEnabled ? Infinity : this.defaultAttachFlowSoftLimitInBytes;
|
|
47
63
|
|
|
48
|
-
this.attachFlowBatch = new BatchManager(
|
|
49
|
-
|
|
50
|
-
hardLimit,
|
|
51
|
-
softLimit,
|
|
52
|
-
enableOpReentryCheck: params.config.enableOpReentryCheck,
|
|
53
|
-
},
|
|
54
|
-
params.logger,
|
|
55
|
-
);
|
|
56
|
-
this.mainBatch = new BatchManager(
|
|
57
|
-
{
|
|
58
|
-
hardLimit,
|
|
59
|
-
enableOpReentryCheck: params.config.enableOpReentryCheck,
|
|
60
|
-
},
|
|
61
|
-
params.logger,
|
|
62
|
-
);
|
|
64
|
+
this.attachFlowBatch = new BatchManager({ hardLimit, softLimit });
|
|
65
|
+
this.mainBatch = new BatchManager({ hardLimit });
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
public get isEmpty(): boolean {
|
|
66
69
|
return this.attachFlowBatch.length === 0 && this.mainBatch.length === 0;
|
|
67
70
|
}
|
|
68
71
|
|
|
72
|
+
/**
|
|
73
|
+
* If we detect that the reference sequence number of the incoming message does not match
|
|
74
|
+
* what was already in the batch managers, this means that batching has been interrupted so
|
|
75
|
+
* we will flush the accumulated messages to account for that and create a new batch with the new
|
|
76
|
+
* message as the first message.
|
|
77
|
+
*
|
|
78
|
+
* @param message - the incoming message
|
|
79
|
+
*/
|
|
80
|
+
private maybeFlushPartialBatch(message: BatchMessage) {
|
|
81
|
+
const mainBatchReference = this.mainBatch.referenceSequenceNumber;
|
|
82
|
+
const attachFlowBatchReference = this.attachFlowBatch.referenceSequenceNumber;
|
|
83
|
+
assert(
|
|
84
|
+
this.params.config.disablePartialFlush ||
|
|
85
|
+
mainBatchReference === undefined ||
|
|
86
|
+
attachFlowBatchReference === undefined ||
|
|
87
|
+
mainBatchReference === attachFlowBatchReference,
|
|
88
|
+
0x58d /* Reference sequence numbers from both batches must be in sync */,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
if (
|
|
92
|
+
(mainBatchReference === undefined ||
|
|
93
|
+
mainBatchReference === message.referenceSequenceNumber) &&
|
|
94
|
+
(attachFlowBatchReference === undefined ||
|
|
95
|
+
attachFlowBatchReference === message.referenceSequenceNumber)
|
|
96
|
+
) {
|
|
97
|
+
// The reference sequence numbers are stable, there is nothing to do
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (++this.mismatchedOpsReported <= this.maxMismatchedOpsToReport) {
|
|
102
|
+
this.mc.logger.sendErrorEvent(
|
|
103
|
+
{
|
|
104
|
+
eventName: "ReferenceSequenceNumberMismatch",
|
|
105
|
+
mainReferenceSequenceNumber: mainBatchReference,
|
|
106
|
+
attachReferenceSequenceNumber: attachFlowBatchReference,
|
|
107
|
+
messageReferenceSequenceNumber: message.referenceSequenceNumber,
|
|
108
|
+
},
|
|
109
|
+
new UsageError("Submission of an out of order message"),
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (!this.params.config.disablePartialFlush) {
|
|
114
|
+
this.flush();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
69
118
|
public submit(message: BatchMessage) {
|
|
119
|
+
this.maybeFlushPartialBatch(message);
|
|
120
|
+
|
|
70
121
|
if (!this.mainBatch.push(message)) {
|
|
71
122
|
throw new GenericError("BatchTooLarge", /* error */ undefined, {
|
|
72
123
|
opSize: message.contents?.length ?? 0,
|
|
@@ -78,6 +129,8 @@ export class Outbox {
|
|
|
78
129
|
}
|
|
79
130
|
|
|
80
131
|
public submitAttach(message: BatchMessage) {
|
|
132
|
+
this.maybeFlushPartialBatch(message);
|
|
133
|
+
|
|
81
134
|
if (!this.attachFlowBatch.push(message)) {
|
|
82
135
|
// BatchManager has two limits - soft limit & hard limit. Soft limit is only engaged
|
|
83
136
|
// when queue is not empty.
|
|
@@ -113,69 +166,80 @@ export class Outbox {
|
|
|
113
166
|
|
|
114
167
|
private flushInternal(rawBatch: IBatch) {
|
|
115
168
|
const processedBatch = this.compressBatch(rawBatch);
|
|
116
|
-
|
|
169
|
+
this.sendBatch(processedBatch);
|
|
117
170
|
|
|
118
|
-
this.persistBatch(
|
|
171
|
+
this.persistBatch(rawBatch.content);
|
|
119
172
|
}
|
|
120
173
|
|
|
121
174
|
private compressBatch(batch: IBatch): IBatch {
|
|
122
175
|
if (
|
|
123
176
|
batch.content.length === 0 ||
|
|
124
177
|
this.params.config.compressionOptions === undefined ||
|
|
125
|
-
this.params.config.compressionOptions.minimumBatchSizeInBytes >
|
|
178
|
+
this.params.config.compressionOptions.minimumBatchSizeInBytes >
|
|
179
|
+
batch.contentSizeInBytes ||
|
|
180
|
+
this.params.containerContext.submitBatchFn === undefined
|
|
126
181
|
) {
|
|
127
|
-
// Nothing to do if the batch is empty or if compression is disabled or if we don't need to compress
|
|
182
|
+
// Nothing to do if the batch is empty or if compression is disabled or not supported, or if we don't need to compress
|
|
128
183
|
return batch;
|
|
129
184
|
}
|
|
130
185
|
|
|
131
186
|
const compressedBatch = this.params.compressor.compressBatch(batch);
|
|
132
|
-
if (compressedBatch.contentSizeInBytes <= this.params.config.maxBatchSizeInBytes) {
|
|
133
|
-
// If we don't reach the maximum supported size of a batch, it can safely be sent as is
|
|
134
|
-
return compressedBatch;
|
|
135
|
-
}
|
|
136
187
|
|
|
137
188
|
if (this.params.splitter.isBatchChunkingEnabled) {
|
|
138
|
-
return this.params.splitter.
|
|
189
|
+
return compressedBatch.contentSizeInBytes <= this.params.splitter.chunkSizeInBytes
|
|
190
|
+
? compressedBatch
|
|
191
|
+
: this.params.splitter.splitCompressedBatch(compressedBatch);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (compressedBatch.contentSizeInBytes >= this.params.config.maxBatchSizeInBytes) {
|
|
195
|
+
throw new GenericError("BatchTooLarge", /* error */ undefined, {
|
|
196
|
+
batchSize: batch.contentSizeInBytes,
|
|
197
|
+
compressedBatchSize: compressedBatch.contentSizeInBytes,
|
|
198
|
+
count: compressedBatch.content.length,
|
|
199
|
+
limit: this.params.config.maxBatchSizeInBytes,
|
|
200
|
+
chunkingEnabled: this.params.splitter.isBatchChunkingEnabled,
|
|
201
|
+
compressionOptions: JSON.stringify(this.params.config.compressionOptions),
|
|
202
|
+
socketSize: estimateSocketSize(batch),
|
|
203
|
+
});
|
|
139
204
|
}
|
|
140
205
|
|
|
141
|
-
|
|
142
|
-
throw new GenericError("BatchTooLarge", /* error */ undefined, {
|
|
143
|
-
batchSize: batch.contentSizeInBytes,
|
|
144
|
-
compressedBatchSize: compressedBatch.contentSizeInBytes,
|
|
145
|
-
count: compressedBatch.content.length,
|
|
146
|
-
limit: this.params.config.maxBatchSizeInBytes,
|
|
147
|
-
chunkingEnabled: this.params.splitter.isBatchChunkingEnabled,
|
|
148
|
-
compressionOptions: JSON.stringify(this.params.config.compressionOptions),
|
|
149
|
-
});
|
|
206
|
+
return compressedBatch;
|
|
150
207
|
}
|
|
151
208
|
|
|
152
209
|
/**
|
|
153
210
|
* Sends the batch object to the container context to be sent over the wire.
|
|
154
211
|
*
|
|
155
212
|
* @param batch - batch to be sent
|
|
156
|
-
* @returns the client sequence number of the last batched op which was sent and
|
|
157
|
-
* -1 if there are no ops or the container cannot send ops.
|
|
158
213
|
*/
|
|
159
|
-
private sendBatch(batch: IBatch)
|
|
160
|
-
let clientSequenceNumber: number = -1;
|
|
214
|
+
private sendBatch(batch: IBatch) {
|
|
161
215
|
const length = batch.content.length;
|
|
162
216
|
|
|
163
217
|
// Did we disconnect in the middle of turn-based batch?
|
|
164
218
|
// If so, do nothing, as pending state manager will resubmit it correctly on reconnect.
|
|
165
219
|
if (length === 0 || !this.params.shouldSend()) {
|
|
166
|
-
return
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const socketSize = estimateSocketSize(batch);
|
|
224
|
+
if (socketSize >= this.params.config.maxBatchSizeInBytes) {
|
|
225
|
+
this.mc.logger.sendPerformanceEvent({
|
|
226
|
+
eventName: "LargeBatch",
|
|
227
|
+
length: batch.content.length,
|
|
228
|
+
sizeInBytes: batch.contentSizeInBytes,
|
|
229
|
+
socketSize,
|
|
230
|
+
});
|
|
167
231
|
}
|
|
168
232
|
|
|
169
233
|
if (this.params.containerContext.submitBatchFn === undefined) {
|
|
170
234
|
// Legacy path - supporting old loader versions. Can be removed only when LTS moves above
|
|
171
235
|
// version that has support for batches (submitBatchFn)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if
|
|
175
|
-
|
|
176
|
-
}
|
|
236
|
+
assert(
|
|
237
|
+
batch.content[0].compression === undefined,
|
|
238
|
+
0x5a6 /* Compression should not have happened if the loader does not support it */,
|
|
239
|
+
);
|
|
177
240
|
|
|
178
|
-
|
|
241
|
+
for (const message of batch.content) {
|
|
242
|
+
this.params.containerContext.submitFn(
|
|
179
243
|
MessageType.Operation,
|
|
180
244
|
message.deserializedContent,
|
|
181
245
|
true, // batch
|
|
@@ -185,37 +249,33 @@ export class Outbox {
|
|
|
185
249
|
|
|
186
250
|
this.params.containerContext.deltaManager.flush();
|
|
187
251
|
} else {
|
|
188
|
-
|
|
189
|
-
|
|
252
|
+
assert(
|
|
253
|
+
batch.referenceSequenceNumber !== undefined,
|
|
254
|
+
0x58e /* Batch must not be empty */,
|
|
255
|
+
);
|
|
256
|
+
this.params.containerContext.submitBatchFn(
|
|
190
257
|
batch.content.map((message) => ({
|
|
191
258
|
contents: message.contents,
|
|
192
259
|
metadata: message.metadata,
|
|
193
260
|
compression: message.compression,
|
|
261
|
+
referenceSequenceNumber: message.referenceSequenceNumber,
|
|
194
262
|
})),
|
|
263
|
+
batch.referenceSequenceNumber,
|
|
195
264
|
);
|
|
196
265
|
}
|
|
197
|
-
|
|
198
|
-
// Convert from clientSequenceNumber of last message in the batch to clientSequenceNumber of first message.
|
|
199
|
-
clientSequenceNumber -= length - 1;
|
|
200
|
-
assert(clientSequenceNumber >= 0, 0x3d0 /* clientSequenceNumber can't be negative */);
|
|
201
|
-
return clientSequenceNumber;
|
|
202
266
|
}
|
|
203
267
|
|
|
204
|
-
private persistBatch(
|
|
205
|
-
let clientSequenceNumber = initialClientSequenceNumber;
|
|
268
|
+
private persistBatch(batch: BatchMessage[]) {
|
|
206
269
|
// Let the PendingStateManager know that a message was submitted.
|
|
207
270
|
// In future, need to shift toward keeping batch as a whole!
|
|
208
271
|
for (const message of batch) {
|
|
209
272
|
this.params.pendingStateManager.onSubmitMessage(
|
|
210
273
|
message.deserializedContent.type,
|
|
211
|
-
clientSequenceNumber,
|
|
212
274
|
message.referenceSequenceNumber,
|
|
213
275
|
message.deserializedContent.contents,
|
|
214
276
|
message.localOpMetadata,
|
|
215
277
|
message.metadata,
|
|
216
278
|
);
|
|
217
|
-
|
|
218
|
-
clientSequenceNumber++;
|
|
219
279
|
}
|
|
220
280
|
}
|
|
221
281
|
|
package/src/packageVersion.ts
CHANGED
|
@@ -29,12 +29,13 @@ export interface IPendingMessage {
|
|
|
29
29
|
/**
|
|
30
30
|
* This represents an explicit flush call and is added to the pending queue when flush is called on the ContainerRuntime
|
|
31
31
|
* to flush pending messages.
|
|
32
|
-
*
|
|
32
|
+
* ! TODO: Remove in "2.0.0-internal.5.0.0" AB#2496
|
|
33
33
|
*/
|
|
34
34
|
export interface IPendingFlush {
|
|
35
35
|
type: "flush";
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/** ! TODO: Remove in "2.0.0-internal.5.0.0" AB#2496 */
|
|
38
39
|
export type IPendingState = IPendingMessage | IPendingFlush;
|
|
39
40
|
|
|
40
41
|
export interface IPendingLocalState {
|
|
@@ -107,17 +108,11 @@ export class PendingStateManager implements IDisposable {
|
|
|
107
108
|
);
|
|
108
109
|
if (!this.pendingMessages.isEmpty()) {
|
|
109
110
|
return {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
// TODO: Remove in 2.0.0-internal.4.0.0 (AB#2496)
|
|
116
|
-
if (message.opMetadata?.batch === false) {
|
|
117
|
-
arr.push({ type: "flush" });
|
|
118
|
-
}
|
|
119
|
-
return arr;
|
|
120
|
-
}, new Array<IPendingState>()),
|
|
111
|
+
// delete localOpMetadata since it may not be serializable
|
|
112
|
+
// and will be regenerated by applyStashedOp()
|
|
113
|
+
pendingStates: this.pendingMessages
|
|
114
|
+
.toArray()
|
|
115
|
+
.map((message) => ({ ...message, localOpMetadata: undefined })),
|
|
121
116
|
};
|
|
122
117
|
}
|
|
123
118
|
}
|
|
@@ -130,7 +125,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
130
125
|
* Convert old local state format to the new format
|
|
131
126
|
* The old format contained "flush" messages as the indicator of batch ends
|
|
132
127
|
* The new format instead uses batch metadata on the last message to indicate batch ends
|
|
133
|
-
* ! TODO: Remove this conversion in "2.0.0-internal.
|
|
128
|
+
* ! TODO: Remove this conversion in "2.0.0-internal.5.0.0" as version from "2.0.0-internal.4.0.0" will be new format
|
|
134
129
|
* AB#2496 tracks removal
|
|
135
130
|
*/
|
|
136
131
|
if (initialLocalState?.pendingStates) {
|
|
@@ -168,13 +163,11 @@ export class PendingStateManager implements IDisposable {
|
|
|
168
163
|
* Called when a message is submitted locally. Adds the message and the associated details to the pending state
|
|
169
164
|
* queue.
|
|
170
165
|
* @param type - The container message type.
|
|
171
|
-
* @param clientSequenceNumber - The clientSequenceNumber associated with the message.
|
|
172
166
|
* @param content - The message content.
|
|
173
167
|
* @param localOpMetadata - The local metadata associated with the message.
|
|
174
168
|
*/
|
|
175
169
|
public onSubmitMessage(
|
|
176
170
|
type: ContainerMessageType,
|
|
177
|
-
clientSequenceNumber: number,
|
|
178
171
|
referenceSequenceNumber: number,
|
|
179
172
|
content: any,
|
|
180
173
|
localOpMetadata: unknown,
|
|
@@ -183,7 +176,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
183
176
|
const pendingMessage: IPendingMessage = {
|
|
184
177
|
type: "message",
|
|
185
178
|
messageType: type,
|
|
186
|
-
clientSequenceNumber,
|
|
179
|
+
clientSequenceNumber: -1, // dummy value (not to be used anywhere)
|
|
187
180
|
referenceSequenceNumber,
|
|
188
181
|
content,
|
|
189
182
|
localOpMetadata,
|
|
@@ -241,18 +234,34 @@ export class PendingStateManager implements IDisposable {
|
|
|
241
234
|
);
|
|
242
235
|
this.pendingMessages.shift();
|
|
243
236
|
|
|
244
|
-
|
|
245
|
-
// The clientSequenceNumber of the incoming message must match that of the pending message.
|
|
246
|
-
if (pendingMessage.clientSequenceNumber !== message.clientSequenceNumber) {
|
|
237
|
+
if (pendingMessage.messageType !== message.type) {
|
|
247
238
|
// Close the container because this could indicate data corruption.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
239
|
+
this.stateHandler.close(
|
|
240
|
+
DataProcessingError.create(
|
|
241
|
+
"pending local message type mismatch",
|
|
242
|
+
"unexpectedAckReceived",
|
|
243
|
+
message,
|
|
244
|
+
{
|
|
245
|
+
expectedMessageType: pendingMessage.messageType,
|
|
246
|
+
},
|
|
247
|
+
),
|
|
253
248
|
);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
254
251
|
|
|
255
|
-
|
|
252
|
+
const pendingMessageContent = JSON.stringify(pendingMessage.content);
|
|
253
|
+
const messageContent = JSON.stringify(message.contents);
|
|
254
|
+
|
|
255
|
+
// Stringified content does not match
|
|
256
|
+
if (pendingMessageContent !== messageContent) {
|
|
257
|
+
// Close the container because this could indicate data corruption.
|
|
258
|
+
this.stateHandler.close(
|
|
259
|
+
DataProcessingError.create(
|
|
260
|
+
"pending local message content mismatch",
|
|
261
|
+
"unexpectedAckReceived",
|
|
262
|
+
message,
|
|
263
|
+
),
|
|
264
|
+
);
|
|
256
265
|
return;
|
|
257
266
|
}
|
|
258
267
|
|
|
@@ -322,8 +331,6 @@ export class PendingStateManager implements IDisposable {
|
|
|
322
331
|
hasBatchStart: batchBeginMetadata === true,
|
|
323
332
|
hasBatchEnd: batchEndMetadata === false,
|
|
324
333
|
messageType: message.type,
|
|
325
|
-
batchStartSequenceNumber:
|
|
326
|
-
this.pendingBatchBeginMessage.clientSequenceNumber,
|
|
327
334
|
pendingMessagesCount: this.pendingMessagesCount,
|
|
328
335
|
},
|
|
329
336
|
),
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
IDocumentStorageService,
|
|
8
|
+
IDocumentStorageServicePolicies,
|
|
9
|
+
} from "@fluidframework/driver-definitions";
|
|
10
|
+
import { DocumentStorageServiceProxy } from "@fluidframework/driver-utils";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* IDocumentStorageService proxy which intercepts requests if they can be satisfied by the blobs received in the
|
|
14
|
+
* attach message. We use this to avoid an unnecessary request to the storage service.
|
|
15
|
+
*/
|
|
16
|
+
export class StorageServiceWithAttachBlobs extends DocumentStorageServiceProxy {
|
|
17
|
+
constructor(
|
|
18
|
+
internalStorageService: IDocumentStorageService,
|
|
19
|
+
private readonly attachBlobs: Map<string, ArrayBufferLike>,
|
|
20
|
+
) {
|
|
21
|
+
super(internalStorageService);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public get policies(): IDocumentStorageServicePolicies | undefined {
|
|
25
|
+
return this.internalStorageService.policies;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public async readBlob(id: string): Promise<ArrayBufferLike> {
|
|
29
|
+
const blob = this.attachBlobs.get(id);
|
|
30
|
+
if (blob !== undefined) {
|
|
31
|
+
return blob;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Note that it is intentional not to cache the result of this readBlob - we'll trust the real
|
|
35
|
+
// IDocumentStorageService to cache appropriately, no need to double-cache.
|
|
36
|
+
return this.internalStorageService.readBlob(id);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
IOrderedClientCollection,
|
|
8
|
+
IOrderedClientElection,
|
|
9
|
+
ISerializedElection,
|
|
10
|
+
ITrackedClient,
|
|
11
|
+
OrderedClientCollection,
|
|
12
|
+
OrderedClientElection,
|
|
13
|
+
} from "./orderedClientElection";
|
|
14
|
+
export { RunningSummarizer } from "./runningSummarizer";
|
|
15
|
+
export {
|
|
16
|
+
ICancellableSummarizerController,
|
|
17
|
+
neverCancelledSummaryToken,
|
|
18
|
+
RunWhileConnectedCoordinator,
|
|
19
|
+
} from "./runWhileConnectedCoordinator";
|
|
20
|
+
export { Summarizer } from "./summarizer";
|
|
21
|
+
export {
|
|
22
|
+
ISummarizerClientElection,
|
|
23
|
+
ISummarizerClientElectionEvents,
|
|
24
|
+
SummarizerClientElection,
|
|
25
|
+
summarizerClientType,
|
|
26
|
+
} from "./summarizerClientElection";
|
|
27
|
+
export { SummarizeHeuristicData, SummarizeHeuristicRunner } from "./summarizerHeuristics";
|
|
28
|
+
export {
|
|
29
|
+
createRootSummarizerNode,
|
|
30
|
+
createRootSummarizerNodeWithGC,
|
|
31
|
+
IFetchSnapshotResult,
|
|
32
|
+
IRootSummarizerNode,
|
|
33
|
+
IRootSummarizerNodeWithGC,
|
|
34
|
+
RefreshSummaryResult,
|
|
35
|
+
} from "./summarizerNode";
|
|
36
|
+
export {
|
|
37
|
+
IConnectableRuntime,
|
|
38
|
+
IGeneratedSummaryStats,
|
|
39
|
+
IRefreshSummaryAckOptions,
|
|
40
|
+
ISubmitSummaryOptions,
|
|
41
|
+
ISummarizeAttempt,
|
|
42
|
+
ISummarizeHeuristicData,
|
|
43
|
+
ISummarizer,
|
|
44
|
+
ISummarizeResults,
|
|
45
|
+
ISummarizerEvents,
|
|
46
|
+
ISummarizerInternalsProvider,
|
|
47
|
+
ISummarizerRuntime,
|
|
48
|
+
ISummaryCancellationToken,
|
|
49
|
+
SubmitSummaryResult,
|
|
50
|
+
SummarizerStopReason,
|
|
51
|
+
EnqueueSummarizeResult,
|
|
52
|
+
IAckSummaryResult,
|
|
53
|
+
IBaseSummarizeResult,
|
|
54
|
+
IBroadcastSummaryResult,
|
|
55
|
+
ICancellationToken,
|
|
56
|
+
IEnqueueSummarizeOptions,
|
|
57
|
+
IGenerateSummaryTreeResult,
|
|
58
|
+
INackSummaryResult,
|
|
59
|
+
IOnDemandSummarizeOptions,
|
|
60
|
+
ISubmitSummaryOpResult,
|
|
61
|
+
ISummarizeOptions,
|
|
62
|
+
ISummarizingWarning,
|
|
63
|
+
IUploadSummaryResult,
|
|
64
|
+
SummarizeResultPart,
|
|
65
|
+
} from "./summarizerTypes";
|
|
66
|
+
export {
|
|
67
|
+
IAckedSummary,
|
|
68
|
+
ISummaryCollectionOpEvents,
|
|
69
|
+
ISummaryOpMessage,
|
|
70
|
+
SummaryCollection,
|
|
71
|
+
IClientSummaryWatcher,
|
|
72
|
+
ISummary,
|
|
73
|
+
ISummaryAckMessage,
|
|
74
|
+
ISummaryNackMessage,
|
|
75
|
+
OpActionEventListener,
|
|
76
|
+
OpActionEventName,
|
|
77
|
+
} from "./summaryCollection";
|
|
78
|
+
export {
|
|
79
|
+
aliasBlobName,
|
|
80
|
+
blobsTreeName,
|
|
81
|
+
chunksBlobName,
|
|
82
|
+
dataStoreAttributesBlobName,
|
|
83
|
+
electedSummarizerBlobName,
|
|
84
|
+
extractSummaryMetadataMessage,
|
|
85
|
+
getAttributesFormatVersion,
|
|
86
|
+
getFluidDataStoreAttributes,
|
|
87
|
+
hasIsolatedChannels,
|
|
88
|
+
IContainerRuntimeMetadata,
|
|
89
|
+
ICreateContainerMetadata,
|
|
90
|
+
ISummaryMetadataMessage,
|
|
91
|
+
metadataBlobName,
|
|
92
|
+
nonDataStorePaths,
|
|
93
|
+
ReadFluidDataStoreAttributes,
|
|
94
|
+
rootHasIsolatedChannels,
|
|
95
|
+
WriteFluidDataStoreAttributes,
|
|
96
|
+
wrapSummaryInChannelsTree,
|
|
97
|
+
} from "./summaryFormat";
|
|
98
|
+
export { SummarizeReason } from "./summaryGenerator";
|
|
99
|
+
export {
|
|
100
|
+
IConnectedEvents,
|
|
101
|
+
IConnectedState,
|
|
102
|
+
ISummaryManagerConfig,
|
|
103
|
+
SummaryManager,
|
|
104
|
+
SummaryManagerState,
|
|
105
|
+
} from "./summaryManager";
|
|
@@ -35,10 +35,7 @@ export class RunWhileConnectedCoordinator implements ICancellableSummarizerContr
|
|
|
35
35
|
|
|
36
36
|
public get cancelled() {
|
|
37
37
|
if (!this._cancelled) {
|
|
38
|
-
assert(
|
|
39
|
-
this.runtime.deltaManager.active,
|
|
40
|
-
0x25d /* "We should never connect as 'read'" */,
|
|
41
|
-
);
|
|
38
|
+
assert(this.active(), 0x25d /* "We should never connect as 'read'" */);
|
|
42
39
|
|
|
43
40
|
// This check can't be enabled in current design due to lastSummary flow, where
|
|
44
41
|
// summarizer for closed container stays around and can produce one more summary.
|
|
@@ -63,13 +60,16 @@ export class RunWhileConnectedCoordinator implements ICancellableSummarizerContr
|
|
|
63
60
|
return this.stopDeferred.promise;
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
public static async create(runtime: IConnectableRuntime) {
|
|
67
|
-
const obj = new RunWhileConnectedCoordinator(runtime);
|
|
63
|
+
public static async create(runtime: IConnectableRuntime, active: () => boolean) {
|
|
64
|
+
const obj = new RunWhileConnectedCoordinator(runtime, active);
|
|
68
65
|
await obj.waitStart();
|
|
69
66
|
return obj;
|
|
70
67
|
}
|
|
71
68
|
|
|
72
|
-
protected constructor(
|
|
69
|
+
protected constructor(
|
|
70
|
+
private readonly runtime: IConnectableRuntime,
|
|
71
|
+
private readonly active: () => boolean,
|
|
72
|
+
) {}
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* Starts and waits for a promise which resolves when connected.
|