@fluidframework/container-runtime 2.0.0-internal.6.1.1 → 2.0.0-internal.6.3.0
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/CHANGELOG.md +39 -0
- package/README.md +4 -3
- package/dist/batchTracker.d.ts +1 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +5 -4
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +4 -21
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +119 -185
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +13 -12
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +99 -16
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +380 -242
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +4 -5
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +40 -41
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +1 -2
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -8
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.js +2 -2
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +23 -25
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.d.ts +1 -1
- package/dist/deltaManagerProxyBase.js +2 -2
- package/dist/deltaManagerProxyBase.js.map +1 -1
- package/dist/deltaScheduler.js +6 -6
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts +14 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +21 -0
- package/dist/error.js.map +1 -0
- package/dist/gc/garbageCollection.d.ts +4 -6
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +26 -25
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +5 -3
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +4 -2
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.js +7 -7
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +15 -52
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +2 -0
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +4 -4
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +1 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
- package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.js +26 -68
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/finalSpace.d.ts +29 -0
- package/dist/id-compressor/finalSpace.d.ts.map +1 -0
- package/dist/id-compressor/finalSpace.js +62 -0
- package/dist/id-compressor/finalSpace.js.map +1 -0
- package/dist/id-compressor/idCompressor.d.ts +25 -250
- package/dist/id-compressor/idCompressor.d.ts.map +1 -1
- package/dist/id-compressor/idCompressor.js +387 -1150
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +32 -0
- package/dist/id-compressor/identifiers.d.ts.map +1 -0
- package/dist/id-compressor/identifiers.js +15 -0
- package/dist/id-compressor/identifiers.js.map +1 -0
- package/dist/id-compressor/index.d.ts +5 -6
- package/dist/id-compressor/index.d.ts.map +1 -1
- package/dist/id-compressor/index.js +20 -26
- package/dist/id-compressor/index.js.map +1 -1
- package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
- package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
- package/dist/id-compressor/persistanceUtilities.js +43 -0
- package/dist/id-compressor/persistanceUtilities.js.map +1 -0
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
- package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
- package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
- package/dist/id-compressor/sessions.d.ts +115 -0
- package/dist/id-compressor/sessions.d.ts.map +1 -0
- package/dist/id-compressor/sessions.js +305 -0
- package/dist/id-compressor/sessions.js.map +1 -0
- package/dist/id-compressor/utilities.d.ts +49 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -0
- package/dist/id-compressor/utilities.js +166 -0
- package/dist/id-compressor/utilities.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.js +5 -5
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +11 -10
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +3 -3
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +14 -15
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +1 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +16 -17
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +11 -5
- package/dist/opLifecycle/remoteMessageProcessor.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 +12 -5
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +36 -23
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +23 -23
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +3 -3
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +2 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +2 -3
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +8 -8
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +3 -3
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +27 -4
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +246 -74
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +6 -5
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +73 -69
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts +2 -2
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +2 -2
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +2 -2
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/index.d.ts +1 -1
- package/dist/summary/summarizerNode/index.d.ts.map +1 -1
- package/dist/summary/summarizerNode/index.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +5 -14
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +32 -109
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +5 -88
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +38 -25
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +2 -3
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +9 -8
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.js +2 -2
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +10 -4
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +52 -48
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +7 -6
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +30 -22
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +3 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +4 -21
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +91 -157
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +2 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +99 -16
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +332 -192
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +2 -3
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +3 -4
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +1 -2
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +1 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.js +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +2 -4
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.d.ts +1 -1
- package/lib/deltaManagerProxyBase.js +1 -1
- package/lib/deltaManagerProxyBase.js.map +1 -1
- package/lib/deltaScheduler.js +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts +14 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/error.js +17 -0
- package/lib/error.js.map +1 -0
- package/lib/gc/garbageCollection.d.ts +4 -6
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +26 -25
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +3 -1
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +4 -2
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.js +1 -1
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +16 -53
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +2 -0
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.d.ts +8 -30
- package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js +25 -66
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/finalSpace.d.ts +29 -0
- package/lib/id-compressor/finalSpace.d.ts.map +1 -0
- package/lib/id-compressor/finalSpace.js +58 -0
- package/lib/id-compressor/finalSpace.js.map +1 -0
- package/lib/id-compressor/idCompressor.d.ts +25 -250
- package/lib/id-compressor/idCompressor.d.ts.map +1 -1
- package/lib/id-compressor/idCompressor.js +382 -1139
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/identifiers.d.ts +32 -0
- package/lib/id-compressor/identifiers.d.ts.map +1 -0
- package/lib/id-compressor/identifiers.js +11 -0
- package/lib/id-compressor/identifiers.js.map +1 -0
- package/lib/id-compressor/index.d.ts +5 -6
- package/lib/id-compressor/index.d.ts.map +1 -1
- package/lib/id-compressor/index.js +5 -6
- package/lib/id-compressor/index.js.map +1 -1
- package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
- package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
- package/lib/id-compressor/persistanceUtilities.js +34 -0
- package/lib/id-compressor/persistanceUtilities.js.map +1 -0
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
- package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
- package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
- package/lib/id-compressor/sessions.d.ts +115 -0
- package/lib/id-compressor/sessions.d.ts.map +1 -0
- package/lib/id-compressor/sessions.js +290 -0
- package/lib/id-compressor/sessions.js.map +1 -0
- package/lib/id-compressor/utilities.d.ts +49 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -0
- package/lib/id-compressor/utilities.js +148 -0
- package/lib/id-compressor/utilities.js.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.js +3 -3
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +2 -1
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +2 -3
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +1 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -8
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +12 -6
- package/lib/opLifecycle/remoteMessageProcessor.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 +12 -5
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +21 -8
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +3 -3
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/index.d.ts +3 -3
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +2 -3
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +3 -3
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +27 -4
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +240 -68
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +6 -5
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +69 -65
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts +2 -2
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/index.d.ts +1 -1
- package/lib/summary/summarizerNode/index.d.ts.map +1 -1
- package/lib/summary/summarizerNode/index.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +5 -14
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +16 -93
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -86
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +38 -25
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +2 -3
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +2 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.js +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +10 -4
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +46 -42
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +7 -6
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +26 -18
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +30 -29
- package/src/batchTracker.ts +3 -2
- package/src/blobManager.ts +105 -185
- package/src/connectionTelemetry.ts +2 -1
- package/src/containerRuntime.ts +481 -267
- package/src/dataStore.ts +2 -3
- package/src/dataStoreContext.ts +5 -8
- package/src/dataStoreContexts.ts +2 -4
- package/src/dataStoreRegistry.ts +1 -1
- package/src/dataStores.ts +4 -7
- package/src/deltaManagerProxyBase.ts +1 -1
- package/src/deltaScheduler.ts +1 -1
- package/src/error.ts +18 -0
- package/src/gc/garbageCollection.ts +39 -41
- package/src/gc/gcConfigs.ts +4 -2
- package/src/gc/gcDefinitions.ts +4 -6
- package/src/gc/gcHelpers.ts +1 -1
- package/src/gc/gcSummaryStateTracker.ts +19 -65
- package/src/gc/gcTelemetry.ts +2 -0
- package/src/gc/gcUnreferencedStateTracker.ts +1 -1
- package/src/gc/index.ts +0 -1
- package/src/id-compressor/appendOnlySortedMap.ts +26 -87
- package/src/id-compressor/finalSpace.ts +67 -0
- package/src/id-compressor/idCompressor.ts +456 -1681
- package/src/id-compressor/identifiers.ts +42 -0
- package/src/id-compressor/index.ts +11 -20
- package/src/id-compressor/persistanceUtilities.ts +58 -0
- package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
- package/src/id-compressor/sessions.ts +405 -0
- package/src/id-compressor/utilities.ts +187 -0
- package/src/index.ts +7 -1
- package/src/opLifecycle/opCompressor.ts +3 -3
- package/src/opLifecycle/opDecompressor.ts +2 -1
- package/src/opLifecycle/opGroupingManager.ts +1 -1
- package/src/opLifecycle/opSplitter.ts +4 -4
- package/src/opLifecycle/outbox.ts +14 -11
- package/src/opLifecycle/remoteMessageProcessor.ts +19 -6
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +50 -29
- package/src/scheduleManager.ts +6 -4
- package/src/summary/index.ts +4 -3
- package/src/summary/orderedClientElection.ts +8 -5
- package/src/summary/runWhileConnectedCoordinator.ts +1 -1
- package/src/summary/runningSummarizer.ts +273 -97
- package/src/summary/summarizer.ts +23 -12
- package/src/summary/summarizerClientElection.ts +2 -2
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/index.ts +1 -2
- package/src/summary/summarizerNode/summarizerNode.ts +23 -145
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +7 -38
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +3 -123
- package/src/summary/summarizerTypes.ts +40 -25
- package/src/summary/summaryCollection.ts +3 -3
- package/src/summary/summaryFormat.ts +1 -1
- package/src/summary/summaryGenerator.ts +52 -55
- package/src/summary/summaryManager.ts +36 -13
- package/dist/id-compressor/idRange.d.ts +0 -11
- package/dist/id-compressor/idRange.d.ts.map +0 -1
- package/dist/id-compressor/idRange.js +0 -29
- package/dist/id-compressor/idRange.js.map +0 -1
- package/dist/id-compressor/numericUuid.d.ts +0 -59
- package/dist/id-compressor/numericUuid.d.ts.map +0 -1
- package/dist/id-compressor/numericUuid.js +0 -325
- package/dist/id-compressor/numericUuid.js.map +0 -1
- package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
- package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
- package/dist/id-compressor/sessionIdNormalizer.js +0 -483
- package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
- package/dist/id-compressor/utils.d.ts +0 -57
- package/dist/id-compressor/utils.d.ts.map +0 -1
- package/dist/id-compressor/utils.js +0 -90
- package/dist/id-compressor/utils.js.map +0 -1
- package/dist/id-compressor/uuidUtilities.d.ts +0 -28
- package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/dist/id-compressor/uuidUtilities.js +0 -104
- package/dist/id-compressor/uuidUtilities.js.map +0 -1
- package/lib/id-compressor/idRange.d.ts +0 -11
- package/lib/id-compressor/idRange.d.ts.map +0 -1
- package/lib/id-compressor/idRange.js +0 -25
- package/lib/id-compressor/idRange.js.map +0 -1
- package/lib/id-compressor/numericUuid.d.ts +0 -59
- package/lib/id-compressor/numericUuid.d.ts.map +0 -1
- package/lib/id-compressor/numericUuid.js +0 -315
- package/lib/id-compressor/numericUuid.js.map +0 -1
- package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
- package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
- package/lib/id-compressor/sessionIdNormalizer.js +0 -479
- package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
- package/lib/id-compressor/utils.d.ts +0 -57
- package/lib/id-compressor/utils.d.ts.map +0 -1
- package/lib/id-compressor/utils.js +0 -79
- package/lib/id-compressor/utils.js.map +0 -1
- package/lib/id-compressor/uuidUtilities.d.ts +0 -28
- package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/lib/id-compressor/uuidUtilities.js +0 -96
- package/lib/id-compressor/uuidUtilities.js.map +0 -1
- package/src/id-compressor/idRange.ts +0 -35
- package/src/id-compressor/numericUuid.ts +0 -383
- package/src/id-compressor/sessionIdNormalizer.ts +0 -609
- package/src/id-compressor/utils.ts +0 -114
- package/src/id-compressor/uuidUtilities.ts +0 -120
|
@@ -9,10 +9,11 @@ import {
|
|
|
9
9
|
MonitoringContext,
|
|
10
10
|
createChildMonitoringContext,
|
|
11
11
|
createChildLogger,
|
|
12
|
+
UsageError,
|
|
12
13
|
} from "@fluidframework/telemetry-utils";
|
|
13
|
-
import { assert, delay, Deferred, PromiseTimer } from "@fluidframework/
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { assert, delay, Deferred, PromiseTimer } from "@fluidframework/core-utils";
|
|
15
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
16
|
+
import { DriverErrorTypes } from "@fluidframework/driver-definitions";
|
|
16
17
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
17
18
|
import { ISummaryConfiguration } from "../containerRuntime";
|
|
18
19
|
import { opSize } from "../opProperties";
|
|
@@ -33,6 +34,8 @@ import {
|
|
|
33
34
|
ISummarizerRuntime,
|
|
34
35
|
ISummarizeRunnerTelemetry,
|
|
35
36
|
IRefreshSummaryAckOptions,
|
|
37
|
+
ISummarizerEvents,
|
|
38
|
+
ISummarizeEventProps,
|
|
36
39
|
} from "./summarizerTypes";
|
|
37
40
|
import { IAckedSummary, IClientSummaryWatcher, SummaryCollection } from "./summaryCollection";
|
|
38
41
|
import {
|
|
@@ -44,6 +47,17 @@ import {
|
|
|
44
47
|
|
|
45
48
|
const maxSummarizeAckWaitTime = 10 * 60 * 1000; // 10 minutes
|
|
46
49
|
|
|
50
|
+
/**
|
|
51
|
+
* The maximum number of summarization attempts that will be done by default in case of failures
|
|
52
|
+
* that can be retried.
|
|
53
|
+
*/
|
|
54
|
+
export const defaultMaxAttempts = 2;
|
|
55
|
+
/**
|
|
56
|
+
* The default value for maximum number of summarization attempts that will be done for summarization failures where
|
|
57
|
+
* submit fails and the failure can be retried.
|
|
58
|
+
*/
|
|
59
|
+
export const defaultMaxAttemptsForSubmitFailures = 5;
|
|
60
|
+
|
|
47
61
|
/**
|
|
48
62
|
* An instance of RunningSummarizer manages the heuristics for summarizing.
|
|
49
63
|
* Until disposed, the instance of RunningSummarizer can assume that it is
|
|
@@ -51,7 +65,7 @@ const maxSummarizeAckWaitTime = 10 * 60 * 1000; // 10 minutes
|
|
|
51
65
|
* track of summaries that it is generating as they are broadcast and acked/nacked.
|
|
52
66
|
* This object is created and controlled by Summarizer object.
|
|
53
67
|
*/
|
|
54
|
-
export class RunningSummarizer implements IDisposable {
|
|
68
|
+
export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> implements IDisposable {
|
|
55
69
|
public static async start(
|
|
56
70
|
logger: ITelemetryBaseLogger,
|
|
57
71
|
summaryWatcher: IClientSummaryWatcher,
|
|
@@ -137,7 +151,7 @@ export class RunningSummarizer implements IDisposable {
|
|
|
137
151
|
| {
|
|
138
152
|
reason: SummarizeReason;
|
|
139
153
|
afterSequenceNumber: number;
|
|
140
|
-
|
|
154
|
+
summarizeOptions: ISummarizeOptions;
|
|
141
155
|
readonly resultsBuilder: SummarizeResultBuilder;
|
|
142
156
|
}
|
|
143
157
|
| undefined;
|
|
@@ -147,6 +161,9 @@ export class RunningSummarizer implements IDisposable {
|
|
|
147
161
|
|
|
148
162
|
private readonly runtimeListener;
|
|
149
163
|
|
|
164
|
+
/** The maximum number of summary attempts to do when submit summary fails. */
|
|
165
|
+
private readonly maxAttemptsForSubmitFailures: number;
|
|
166
|
+
|
|
150
167
|
private constructor(
|
|
151
168
|
baseLogger: ITelemetryBaseLogger,
|
|
152
169
|
private readonly summaryWatcher: IClientSummaryWatcher,
|
|
@@ -163,6 +180,8 @@ export class RunningSummarizer implements IDisposable {
|
|
|
163
180
|
private readonly stopSummarizerCallback: (reason: SummarizerStopReason) => void,
|
|
164
181
|
private readonly runtime: ISummarizerRuntime,
|
|
165
182
|
) {
|
|
183
|
+
super();
|
|
184
|
+
|
|
166
185
|
const telemetryProps: ISummarizeRunnerTelemetry = {
|
|
167
186
|
summarizeCount: () => this.summarizeCount,
|
|
168
187
|
summarizerSuccessfulAttempts: () => this.totalSuccessfulAttempts,
|
|
@@ -240,6 +259,17 @@ export class RunningSummarizer implements IDisposable {
|
|
|
240
259
|
this.handleOp(op, runtimeMessage === true);
|
|
241
260
|
};
|
|
242
261
|
this.runtime.on("op", this.runtimeListener);
|
|
262
|
+
|
|
263
|
+
// The max attempts for submit failures can be overridden via a feature flag. This allows us to
|
|
264
|
+
// tweak this as per telemetry data until we arrive at a stable number.
|
|
265
|
+
// If its set to a number higher than `defaultMaxAttemptsForSubmitFailures`, it will be ignored.
|
|
266
|
+
const overrideMaxAttempts = this.mc.config.getNumber(
|
|
267
|
+
"Fluid.Summarizer.AttemptsForSubmitFailures",
|
|
268
|
+
);
|
|
269
|
+
this.maxAttemptsForSubmitFailures =
|
|
270
|
+
overrideMaxAttempts && overrideMaxAttempts < defaultMaxAttemptsForSubmitFailures
|
|
271
|
+
? overrideMaxAttempts
|
|
272
|
+
: defaultMaxAttemptsForSubmitFailures;
|
|
243
273
|
}
|
|
244
274
|
|
|
245
275
|
private async handleSummaryAck(): Promise<number> {
|
|
@@ -281,7 +311,7 @@ export class RunningSummarizer implements IDisposable {
|
|
|
281
311
|
// by calling `refreshLatestSummaryAckFromServer` and we will be fine.
|
|
282
312
|
const isIgnoredError =
|
|
283
313
|
isFluidError(error) &&
|
|
284
|
-
error.errorType ===
|
|
314
|
+
error.errorType === DriverErrorTypes.fileNotFoundOrAccessDeniedError;
|
|
285
315
|
|
|
286
316
|
summaryLogger.sendTelemetryEvent(
|
|
287
317
|
{
|
|
@@ -429,7 +459,7 @@ export class RunningSummarizer implements IDisposable {
|
|
|
429
459
|
if (this.summarizingLock === undefined) {
|
|
430
460
|
this.trySummarizeOnce(
|
|
431
461
|
// summarizeProps
|
|
432
|
-
{
|
|
462
|
+
{ summarizeReason: "lastSummary" },
|
|
433
463
|
// ISummarizeOptions, using defaults: { refreshLatestAck: false, fullTree: false }
|
|
434
464
|
{},
|
|
435
465
|
);
|
|
@@ -524,7 +554,6 @@ export class RunningSummarizer implements IDisposable {
|
|
|
524
554
|
private trySummarizeOnce(
|
|
525
555
|
summarizeProps: ISummarizeTelemetryProperties,
|
|
526
556
|
options: ISummarizeOptions,
|
|
527
|
-
cancellationToken = this.cancellationToken,
|
|
528
557
|
resultsBuilder = new SummarizeResultBuilder(),
|
|
529
558
|
): ISummarizeResults {
|
|
530
559
|
this.lockedSummaryAction(
|
|
@@ -532,12 +561,16 @@ export class RunningSummarizer implements IDisposable {
|
|
|
532
561
|
this.beforeSummaryAction();
|
|
533
562
|
},
|
|
534
563
|
async () => {
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
564
|
+
const summaryLogger = createChildLogger({
|
|
565
|
+
logger: this.mc.logger,
|
|
566
|
+
properties: { all: summarizeProps },
|
|
567
|
+
});
|
|
568
|
+
const summaryOptions: ISubmitSummaryOptions = {
|
|
569
|
+
...options,
|
|
570
|
+
summaryLogger,
|
|
571
|
+
cancellationToken: this.cancellationToken,
|
|
572
|
+
};
|
|
573
|
+
const summarizeResult = this.generator.summarize(summaryOptions, resultsBuilder);
|
|
541
574
|
// ensure we wait till the end of the process
|
|
542
575
|
return summarizeResult.receivedSummaryAckOrNack;
|
|
543
576
|
},
|
|
@@ -555,10 +588,7 @@ export class RunningSummarizer implements IDisposable {
|
|
|
555
588
|
}
|
|
556
589
|
|
|
557
590
|
/** Heuristics summarize attempt. */
|
|
558
|
-
private trySummarize(
|
|
559
|
-
reason: SummarizeReason,
|
|
560
|
-
cancellationToken = this.cancellationToken,
|
|
561
|
-
): void {
|
|
591
|
+
private trySummarize(reason: SummarizeReason): void {
|
|
562
592
|
if (this.summarizingLock !== undefined) {
|
|
563
593
|
// lockedSummaryAction() will retry heuristic-based summary at the end of current attempt
|
|
564
594
|
// if it's still needed
|
|
@@ -571,68 +601,9 @@ export class RunningSummarizer implements IDisposable {
|
|
|
571
601
|
this.beforeSummaryAction();
|
|
572
602
|
},
|
|
573
603
|
async () => {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
];
|
|
578
|
-
let overrideDelaySeconds: number | undefined;
|
|
579
|
-
let summaryAttempts = 0;
|
|
580
|
-
let summaryAttemptsPerPhase = 0;
|
|
581
|
-
let summaryAttemptPhase = 0;
|
|
582
|
-
while (summaryAttemptPhase < attempts.length) {
|
|
583
|
-
if (this.cancellationToken.cancelled) {
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
// We only want to attempt 1 summary when reason is "lastSummary"
|
|
588
|
-
if (++summaryAttempts > 1 && reason === "lastSummary") {
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
summaryAttemptsPerPhase++;
|
|
593
|
-
|
|
594
|
-
const summarizeOptions = attempts[summaryAttemptPhase];
|
|
595
|
-
const summarizeProps: ISummarizeTelemetryProperties = {
|
|
596
|
-
reason,
|
|
597
|
-
summaryAttempts,
|
|
598
|
-
summaryAttemptsPerPhase,
|
|
599
|
-
summaryAttemptPhase: summaryAttemptPhase + 1, // make everything 1-based
|
|
600
|
-
...summarizeOptions,
|
|
601
|
-
};
|
|
602
|
-
|
|
603
|
-
// Note: no need to account for cancellationToken.waitCancelled here, as
|
|
604
|
-
// this is accounted SummaryGenerator.summarizeCore that controls receivedSummaryAckOrNack.
|
|
605
|
-
const resultSummarize = this.generator.summarize(
|
|
606
|
-
summarizeProps,
|
|
607
|
-
summarizeOptions,
|
|
608
|
-
cancellationToken,
|
|
609
|
-
);
|
|
610
|
-
const result = await resultSummarize.receivedSummaryAckOrNack;
|
|
611
|
-
|
|
612
|
-
if (result.success) {
|
|
613
|
-
return;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// Check for retryDelay that can come from summaryNack or upload summary flow.
|
|
617
|
-
// Retry the same step only once per retryAfter response.
|
|
618
|
-
const delaySeconds = result.retryAfterSeconds;
|
|
619
|
-
if (delaySeconds === undefined || summaryAttemptsPerPhase > 1) {
|
|
620
|
-
summaryAttemptPhase++;
|
|
621
|
-
summaryAttemptsPerPhase = 0;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
if (delaySeconds !== undefined) {
|
|
625
|
-
this.mc.logger.sendPerformanceEvent({
|
|
626
|
-
eventName: "SummarizeAttemptDelay",
|
|
627
|
-
duration: delaySeconds,
|
|
628
|
-
summaryNackDelay: overrideDelaySeconds !== undefined,
|
|
629
|
-
...summarizeProps,
|
|
630
|
-
});
|
|
631
|
-
await delay(delaySeconds * 1000);
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
this.stopSummarizerCallback("failToSummarize");
|
|
604
|
+
return this.mc.config.getBoolean("Fluid.Summarizer.UseDynamicRetries")
|
|
605
|
+
? this.trySummarizeWithRetries(reason)
|
|
606
|
+
: this.trySummarizeWithStaticAttempts(reason);
|
|
636
607
|
},
|
|
637
608
|
() => {
|
|
638
609
|
this.afterSummaryAction();
|
|
@@ -642,10 +613,220 @@ export class RunningSummarizer implements IDisposable {
|
|
|
642
613
|
});
|
|
643
614
|
}
|
|
644
615
|
|
|
616
|
+
/**
|
|
617
|
+
* Tries to summarize 2 times with pre-defined summary options. If an attempt fails with "retryAfterSeconds"
|
|
618
|
+
* param, that attempt is tried once more.
|
|
619
|
+
*/
|
|
620
|
+
private async trySummarizeWithStaticAttempts(reason: SummarizeReason) {
|
|
621
|
+
const attemptOptions: ISummarizeOptions[] = [
|
|
622
|
+
{ refreshLatestAck: false, fullTree: false },
|
|
623
|
+
{ refreshLatestAck: true, fullTree: false },
|
|
624
|
+
];
|
|
625
|
+
let summaryAttempts = 0;
|
|
626
|
+
let summaryAttemptsPerPhase = 0;
|
|
627
|
+
let summaryAttemptPhase = 0;
|
|
628
|
+
while (summaryAttemptPhase < attemptOptions.length) {
|
|
629
|
+
if (this.cancellationToken.cancelled) {
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// We only want to attempt 1 summary when reason is "lastSummary"
|
|
634
|
+
if (++summaryAttempts > 1 && reason === "lastSummary") {
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
summaryAttemptsPerPhase++;
|
|
639
|
+
|
|
640
|
+
const summarizeOptions = attemptOptions[summaryAttemptPhase];
|
|
641
|
+
const summarizeProps: ISummarizeTelemetryProperties = {
|
|
642
|
+
summarizeReason: reason,
|
|
643
|
+
summaryAttempts,
|
|
644
|
+
summaryAttemptsPerPhase,
|
|
645
|
+
summaryAttemptPhase: summaryAttemptPhase + 1, // make everything 1-based
|
|
646
|
+
...summarizeOptions,
|
|
647
|
+
};
|
|
648
|
+
const summaryLogger = createChildLogger({
|
|
649
|
+
logger: this.mc.logger,
|
|
650
|
+
properties: { all: summarizeProps },
|
|
651
|
+
});
|
|
652
|
+
const summaryOptions: ISubmitSummaryOptions = {
|
|
653
|
+
...summarizeOptions,
|
|
654
|
+
summaryLogger,
|
|
655
|
+
cancellationToken: this.cancellationToken,
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
// Note: no need to account for cancellationToken.waitCancelled here, as
|
|
659
|
+
// this is accounted SummaryGenerator.summarizeCore that controls receivedSummaryAckOrNack.
|
|
660
|
+
const resultSummarize = this.generator.summarize(summaryOptions);
|
|
661
|
+
const ackNackResult = await resultSummarize.receivedSummaryAckOrNack;
|
|
662
|
+
if (ackNackResult.success) {
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// Check for retryDelay that can come from summaryNack, upload summary or submit summary flows.
|
|
667
|
+
// Retry the same step only once per retryAfter response.
|
|
668
|
+
const submitResult = await resultSummarize.summarySubmitted;
|
|
669
|
+
const delaySeconds = !submitResult.success
|
|
670
|
+
? submitResult.data?.retryAfterSeconds
|
|
671
|
+
: ackNackResult.data?.retryAfterSeconds;
|
|
672
|
+
if (delaySeconds === undefined || summaryAttemptsPerPhase > 1) {
|
|
673
|
+
summaryAttemptPhase++;
|
|
674
|
+
summaryAttemptsPerPhase = 0;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if (delaySeconds !== undefined) {
|
|
678
|
+
this.mc.logger.sendPerformanceEvent({
|
|
679
|
+
eventName: "SummarizeAttemptDelay",
|
|
680
|
+
duration: delaySeconds,
|
|
681
|
+
summaryNackDelay: ackNackResult.data?.retryAfterSeconds !== undefined,
|
|
682
|
+
...summarizeProps,
|
|
683
|
+
});
|
|
684
|
+
await delay(delaySeconds * 1000);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
this.stopSummarizerCallback("failToSummarize");
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Tries to summarize with retries where retry is based on the failure params.
|
|
692
|
+
* For example, summarization may be retried for failures with "retryAfterSeconds" param.
|
|
693
|
+
*/
|
|
694
|
+
private async trySummarizeWithRetries(reason: SummarizeReason) {
|
|
695
|
+
// Helper to set summarize options, telemetry properties and call summarize.
|
|
696
|
+
const attemptSummarize = (attemptNumber: number, finalAttempt: boolean) => {
|
|
697
|
+
const summarizeOptions: ISummarizeOptions = {
|
|
698
|
+
fullTree: false,
|
|
699
|
+
};
|
|
700
|
+
const summarizeProps: ISummarizeTelemetryProperties = {
|
|
701
|
+
summarizeReason: reason,
|
|
702
|
+
summaryAttempts: attemptNumber,
|
|
703
|
+
...summarizeOptions,
|
|
704
|
+
finalAttempt,
|
|
705
|
+
};
|
|
706
|
+
const summaryLogger = createChildLogger({
|
|
707
|
+
logger: this.mc.logger,
|
|
708
|
+
properties: { all: summarizeProps },
|
|
709
|
+
});
|
|
710
|
+
const summaryOptions: ISubmitSummaryOptions = {
|
|
711
|
+
...summarizeOptions,
|
|
712
|
+
summaryLogger,
|
|
713
|
+
cancellationToken: this.cancellationToken,
|
|
714
|
+
finalAttempt,
|
|
715
|
+
};
|
|
716
|
+
const summarizeResult = this.generator.summarize(summaryOptions);
|
|
717
|
+
return { summarizeProps, summarizeResult };
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
// The max number of attempts are based on the stage at which summarization failed. If it fails before it is
|
|
721
|
+
// submitted, a different value is used compared to if it fails after submission. Usually, in the former case,
|
|
722
|
+
// we would retry more often as its cheaper and retries are likely to succeed.
|
|
723
|
+
// This makes it harder to predict how many attempts would actually happen as that depends on how far an attempt
|
|
724
|
+
// made. To keep things simple, the max attempts is reset after every attempt based on where it failed. This may
|
|
725
|
+
// result in some failures not being retried depending on what happened before this attempt. That's fine because
|
|
726
|
+
// such scenarios are very unlikely and even if it happens, it would resolve when a new summarizer starts over.
|
|
727
|
+
// For example - When failure switches from one the submit failures to nack failure, only one more retry will
|
|
728
|
+
// happen irrespective of the value of `defaultMaxAttempts`.
|
|
729
|
+
let maxAttempts = defaultMaxAttempts;
|
|
730
|
+
let currentAttempt = 0;
|
|
731
|
+
let retryAfterSeconds: number | undefined;
|
|
732
|
+
let done = false;
|
|
733
|
+
let result: "success" | "failure" | "canceled" = "success";
|
|
734
|
+
do {
|
|
735
|
+
currentAttempt++;
|
|
736
|
+
if (this.cancellationToken.cancelled) {
|
|
737
|
+
result = "canceled";
|
|
738
|
+
done = true;
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
const { summarizeProps, summarizeResult } = attemptSummarize(
|
|
743
|
+
currentAttempt,
|
|
744
|
+
false /* finalAttempt */,
|
|
745
|
+
);
|
|
746
|
+
|
|
747
|
+
// Ack / nack is the final step, so if it succeeds we're done.
|
|
748
|
+
const ackNackResult = await summarizeResult.receivedSummaryAckOrNack;
|
|
749
|
+
if (ackNackResult.success) {
|
|
750
|
+
result = "success";
|
|
751
|
+
done = true;
|
|
752
|
+
break;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// Update max attempts and retry params from the failure result.
|
|
756
|
+
// If submit summary failed, use the params from "summarySubmitted" result. Else, use the params
|
|
757
|
+
// from "receivedSummaryAckOrNack" result.
|
|
758
|
+
// Note: Check "summarySubmitted" result first because if it fails, ack nack would fail as well.
|
|
759
|
+
const submitSummaryResult = await summarizeResult.summarySubmitted;
|
|
760
|
+
if (!submitSummaryResult.success) {
|
|
761
|
+
maxAttempts = this.maxAttemptsForSubmitFailures;
|
|
762
|
+
retryAfterSeconds = submitSummaryResult.data?.retryAfterSeconds;
|
|
763
|
+
} else {
|
|
764
|
+
maxAttempts = defaultMaxAttempts;
|
|
765
|
+
retryAfterSeconds = ackNackResult.data?.retryAfterSeconds;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// Emit "summarize" event for this failed attempt.
|
|
769
|
+
result = "failure";
|
|
770
|
+
const eventProps: ISummarizeEventProps = {
|
|
771
|
+
result,
|
|
772
|
+
currentAttempt,
|
|
773
|
+
maxAttempts,
|
|
774
|
+
error: ackNackResult.error,
|
|
775
|
+
};
|
|
776
|
+
this.emit("summarize", eventProps);
|
|
777
|
+
|
|
778
|
+
// If the failure doesn't have "retryAfterSeconds" or the max number of attempts have been done, we're done.
|
|
779
|
+
if (retryAfterSeconds === undefined || currentAttempt >= maxAttempts - 1) {
|
|
780
|
+
done = true;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
// If the failure has "retryAfterSeconds", add a delay of that time. In this case, a final attempt will
|
|
784
|
+
// take place and we need to wait for "retryAfterSeconds" before that.
|
|
785
|
+
if (retryAfterSeconds !== undefined) {
|
|
786
|
+
this.mc.logger.sendPerformanceEvent({
|
|
787
|
+
eventName: "SummarizeAttemptDelay",
|
|
788
|
+
duration: retryAfterSeconds,
|
|
789
|
+
summaryNackDelay: ackNackResult.data?.retryAfterSeconds !== undefined,
|
|
790
|
+
stage: submitSummaryResult.data?.stage,
|
|
791
|
+
dynamicRetries: true, // To differentiate this telemetry from regular retry logic
|
|
792
|
+
...summarizeProps,
|
|
793
|
+
});
|
|
794
|
+
await delay(retryAfterSeconds * 1000);
|
|
795
|
+
}
|
|
796
|
+
} while (!done);
|
|
797
|
+
|
|
798
|
+
// If summarize attempt did not fail, emit "summarize" event and return. A failed attempt may be retried below.
|
|
799
|
+
if (result !== "failure") {
|
|
800
|
+
this.emit("summarize", { result, currentAttempt, maxAttempts });
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
// If summarization wasn't successful above and the failure contains "retryAfterSeconds", perform one last
|
|
805
|
+
// attempt. This gives a chance to the runtime to perform additional steps in the last attempt.
|
|
806
|
+
if (retryAfterSeconds !== undefined) {
|
|
807
|
+
const { summarizeResult } = attemptSummarize(++currentAttempt, true /* finalAttempt */);
|
|
808
|
+
// Ack / nack is the final step, so if it succeeds we're done.
|
|
809
|
+
const ackNackResult = await summarizeResult.receivedSummaryAckOrNack;
|
|
810
|
+
result = ackNackResult.success ? "success" : "failure";
|
|
811
|
+
const eventProps: ISummarizeEventProps = {
|
|
812
|
+
result,
|
|
813
|
+
currentAttempt,
|
|
814
|
+
maxAttempts,
|
|
815
|
+
error: ackNackResult.success ? undefined : ackNackResult.error,
|
|
816
|
+
};
|
|
817
|
+
this.emit("summarize", eventProps);
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// If summarization is still unsuccessful, stop the summarizer.
|
|
821
|
+
if (result === "failure") {
|
|
822
|
+
this.stopSummarizerCallback("failToSummarize");
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
645
826
|
/** {@inheritdoc (ISummarizer:interface).summarizeOnDemand} */
|
|
646
827
|
public summarizeOnDemand(
|
|
828
|
+
options: IOnDemandSummarizeOptions,
|
|
647
829
|
resultsBuilder: SummarizeResultBuilder = new SummarizeResultBuilder(),
|
|
648
|
-
{ reason, ...options }: IOnDemandSummarizeOptions,
|
|
649
830
|
): ISummarizeResults {
|
|
650
831
|
if (this.stopping) {
|
|
651
832
|
resultsBuilder.fail("RunningSummarizer stopped or disposed", undefined);
|
|
@@ -658,23 +839,18 @@ export class RunningSummarizer implements IDisposable {
|
|
|
658
839
|
throw new UsageError("Attempted to run an already-running summarizer on demand");
|
|
659
840
|
}
|
|
660
841
|
|
|
842
|
+
const { reason, ...summarizeOptions } = options;
|
|
661
843
|
const result = this.trySummarizeOnce(
|
|
662
|
-
{
|
|
663
|
-
|
|
664
|
-
this.cancellationToken,
|
|
844
|
+
{ summarizeReason: `onDemand/${reason}` },
|
|
845
|
+
summarizeOptions,
|
|
665
846
|
resultsBuilder,
|
|
666
847
|
);
|
|
667
848
|
return result;
|
|
668
849
|
}
|
|
669
850
|
|
|
670
851
|
/** {@inheritdoc (ISummarizer:interface).enqueueSummarize} */
|
|
671
|
-
public enqueueSummarize({
|
|
672
|
-
reason,
|
|
673
|
-
afterSequenceNumber = 0,
|
|
674
|
-
override = false,
|
|
675
|
-
...options
|
|
676
|
-
}: IEnqueueSummarizeOptions): EnqueueSummarizeResult {
|
|
677
|
-
const onDemandReason = `enqueue;${reason}` as const;
|
|
852
|
+
public enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult {
|
|
853
|
+
const { reason, afterSequenceNumber = 0, override = false, ...summarizeOptions } = options;
|
|
678
854
|
let overridden = false;
|
|
679
855
|
if (this.enqueuedSummary !== undefined) {
|
|
680
856
|
if (!override) {
|
|
@@ -688,10 +864,11 @@ export class RunningSummarizer implements IDisposable {
|
|
|
688
864
|
this.enqueuedSummary = undefined;
|
|
689
865
|
overridden = true;
|
|
690
866
|
}
|
|
867
|
+
|
|
691
868
|
this.enqueuedSummary = {
|
|
692
|
-
reason:
|
|
869
|
+
reason: `enqueue;${reason}`,
|
|
693
870
|
afterSequenceNumber,
|
|
694
|
-
|
|
871
|
+
summarizeOptions,
|
|
695
872
|
resultsBuilder: new SummarizeResultBuilder(),
|
|
696
873
|
};
|
|
697
874
|
const results = this.enqueuedSummary.resultsBuilder.build();
|
|
@@ -718,13 +895,12 @@ export class RunningSummarizer implements IDisposable {
|
|
|
718
895
|
// If no enqueued summary is ready or a summary is already in progress, take no action.
|
|
719
896
|
return false;
|
|
720
897
|
}
|
|
721
|
-
const { reason, resultsBuilder,
|
|
898
|
+
const { reason, resultsBuilder, summarizeOptions } = this.enqueuedSummary;
|
|
722
899
|
// Set to undefined first, so that subsequent enqueue attempt while summarize will occur later.
|
|
723
900
|
this.enqueuedSummary = undefined;
|
|
724
901
|
this.trySummarizeOnce(
|
|
725
|
-
{
|
|
726
|
-
|
|
727
|
-
this.cancellationToken,
|
|
902
|
+
{ summarizeReason: `enqueuedSummary/${reason}` },
|
|
903
|
+
summarizeOptions,
|
|
728
904
|
resultsBuilder,
|
|
729
905
|
);
|
|
730
906
|
return true;
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { Deferred } from "@fluidframework/core-utils";
|
|
7
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
8
8
|
import {
|
|
9
9
|
ITelemetryLoggerExt,
|
|
10
10
|
createChildLogger,
|
|
11
11
|
IFluidErrorBase,
|
|
12
12
|
LoggingError,
|
|
13
|
+
UsageError,
|
|
13
14
|
wrapErrorAndLog,
|
|
14
15
|
} from "@fluidframework/telemetry-utils";
|
|
15
16
|
import { ILoader, LoaderHeader } from "@fluidframework/container-definitions";
|
|
16
|
-
import { UsageError } from "@fluidframework/container-utils";
|
|
17
17
|
import { DriverHeader } from "@fluidframework/driver-definitions";
|
|
18
18
|
import { requestFluidObject } from "@fluidframework/runtime-utils";
|
|
19
19
|
import { FluidObject, IFluidHandleContext, IRequest } from "@fluidframework/core-interfaces";
|
|
@@ -30,6 +30,12 @@ import {
|
|
|
30
30
|
ISummarizerRuntime,
|
|
31
31
|
ISummarizingWarning,
|
|
32
32
|
SummarizerStopReason,
|
|
33
|
+
IOnDemandSummarizeOptions,
|
|
34
|
+
ISummarizeResults,
|
|
35
|
+
IEnqueueSummarizeOptions,
|
|
36
|
+
EnqueueSummarizeResult,
|
|
37
|
+
ISummarizerEvents,
|
|
38
|
+
ISummarizeEventProps,
|
|
33
39
|
} from "./summarizerTypes";
|
|
34
40
|
import { SummarizeHeuristicData } from "./summarizerHeuristics";
|
|
35
41
|
import { SummarizeResultBuilder } from "./summaryGenerator";
|
|
@@ -61,7 +67,7 @@ export const createSummarizingWarning = (errorMessage: string, logged: boolean)
|
|
|
61
67
|
* It is the main entry point for summary work.
|
|
62
68
|
* It is created only by summarizing container (i.e. one with clientType === "summarizer")
|
|
63
69
|
*/
|
|
64
|
-
export class Summarizer extends
|
|
70
|
+
export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
|
|
65
71
|
public get ISummarizer() {
|
|
66
72
|
return this;
|
|
67
73
|
}
|
|
@@ -277,11 +283,15 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
277
283
|
this.runtime,
|
|
278
284
|
);
|
|
279
285
|
this.runningSummarizer = runningSummarizer;
|
|
286
|
+
this.runningSummarizer.on("summarize", this.handleSummarizeEvent);
|
|
280
287
|
this.starting = false;
|
|
281
|
-
|
|
282
288
|
return runningSummarizer;
|
|
283
289
|
}
|
|
284
290
|
|
|
291
|
+
private readonly handleSummarizeEvent = (eventProps: ISummarizeEventProps) => {
|
|
292
|
+
this.emit("summarize", eventProps);
|
|
293
|
+
};
|
|
294
|
+
|
|
285
295
|
/**
|
|
286
296
|
* Disposes of resources after running. This cleanup will
|
|
287
297
|
* clear any outstanding timers and reset some of the state
|
|
@@ -294,12 +304,13 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
294
304
|
|
|
295
305
|
this._disposed = true;
|
|
296
306
|
if (this.runningSummarizer) {
|
|
307
|
+
this.runningSummarizer.off("summarize", this.handleSummarizeEvent);
|
|
297
308
|
this.runningSummarizer.dispose();
|
|
298
309
|
this.runningSummarizer = undefined;
|
|
299
310
|
}
|
|
300
311
|
}
|
|
301
312
|
|
|
302
|
-
public
|
|
313
|
+
public summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults {
|
|
303
314
|
try {
|
|
304
315
|
if (this._disposed || this.runningSummarizer?.disposed) {
|
|
305
316
|
throw new UsageError("Summarizer is already disposed.");
|
|
@@ -318,7 +329,7 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
318
329
|
const builder = new SummarizeResultBuilder();
|
|
319
330
|
if (this.runningSummarizer) {
|
|
320
331
|
// Summarizer is already running. Go ahead and start.
|
|
321
|
-
return this.runningSummarizer.summarizeOnDemand(
|
|
332
|
+
return this.runningSummarizer.summarizeOnDemand(options, builder);
|
|
322
333
|
}
|
|
323
334
|
|
|
324
335
|
// Summarizer isn't running, so we need to start it, which is an async operation.
|
|
@@ -335,7 +346,7 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
335
346
|
startP
|
|
336
347
|
.then(async (runningSummarizer) => {
|
|
337
348
|
// Successfully started the summarizer. Run it.
|
|
338
|
-
runningSummarizer.summarizeOnDemand(
|
|
349
|
+
runningSummarizer.summarizeOnDemand(options, builder);
|
|
339
350
|
// Wait for a command to stop or loss of connectivity before tearing down the summarizer and client.
|
|
340
351
|
const stopReason = await Promise.race([
|
|
341
352
|
this.stopDeferred.promise,
|
|
@@ -357,9 +368,9 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
357
368
|
} catch (error) {
|
|
358
369
|
throw SummarizingWarning.wrap(error, false /* logged */, this.logger);
|
|
359
370
|
}
|
|
360
|
-
}
|
|
371
|
+
}
|
|
361
372
|
|
|
362
|
-
public
|
|
373
|
+
public enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult {
|
|
363
374
|
if (
|
|
364
375
|
this._disposed ||
|
|
365
376
|
this.runningSummarizer === undefined ||
|
|
@@ -367,8 +378,8 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
367
378
|
) {
|
|
368
379
|
throw new UsageError("Summarizer is not running or already disposed.");
|
|
369
380
|
}
|
|
370
|
-
return this.runningSummarizer.enqueueSummarize(
|
|
371
|
-
}
|
|
381
|
+
return this.runningSummarizer.enqueueSummarize(options);
|
|
382
|
+
}
|
|
372
383
|
|
|
373
384
|
public recordSummaryAttempt?(summaryRefSeqNum?: number) {
|
|
374
385
|
this._heuristicData?.recordAttempt(summaryRefSeqNum);
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IEvent, IEventProvider } from "@fluidframework/
|
|
6
|
+
import { IEvent, IEventProvider } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
8
|
-
import { TypedEventEmitter } from "@
|
|
8
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
9
9
|
import { IClientDetails, MessageType } from "@fluidframework/protocol-definitions";
|
|
10
10
|
import {
|
|
11
11
|
IOrderedClientElection,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
|
-
import { Timer } from "@fluidframework/
|
|
7
|
+
import { Timer } from "@fluidframework/core-utils";
|
|
8
8
|
import { ISummaryConfigurationHeuristics } from "../containerRuntime";
|
|
9
9
|
import {
|
|
10
10
|
ISummarizeHeuristicData,
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
IRefreshSummaryResult,
|
|
8
8
|
ISummarizerNodeRootContract,
|
|
9
|
-
RefreshSummaryResult,
|
|
10
9
|
ValidateSummaryResult,
|
|
11
10
|
} from "./summarizerNodeUtils";
|
|
12
11
|
export { IRootSummarizerNode, createRootSummarizerNode } from "./summarizerNode";
|