@fluidframework/container-runtime 2.0.0-dev.5.2.0.169897 → 2.0.0-dev.6.4.0.191258
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 +147 -0
- package/README.md +4 -3
- package/dist/batchTracker.d.ts +3 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +6 -5
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +15 -18
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +212 -171
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +33 -17
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +172 -35
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +722 -425
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +15 -7
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +4 -4
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +87 -90
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +10 -10
- 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 +23 -7
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +125 -82
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.d.ts +35 -0
- package/dist/deltaManagerProxyBase.d.ts.map +1 -0
- package/dist/deltaManagerProxyBase.js +77 -0
- package/dist/deltaManagerProxyBase.js.map +1 -0
- package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +4 -2
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +10 -10
- 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 +10 -9
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +65 -56
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +18 -14
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +17 -5
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +14 -15
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +0 -8
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +11 -24
- 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 +19 -58
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +45 -35
- 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 +2 -2
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -5
- 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 +390 -1153
- 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/metadata.d.ts +18 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +7 -0
- package/dist/metadata.js.map +1 -0
- package/dist/opLifecycle/batchManager.d.ts +2 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +15 -7
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +11 -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 +2 -2
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +12 -7
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +2 -2
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +30 -21
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +19 -13
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +2 -2
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +24 -19
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +39 -6
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +138 -61
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +6 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +22 -8
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.js +1 -2
- package/dist/opProperties.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 +25 -10
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +101 -64
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +43 -33
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +4 -4
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +3 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +3 -3
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +26 -27
- 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 +31 -10
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +271 -139
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +8 -7
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +79 -78
- 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 +7 -11
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +10 -14
- 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 +40 -23
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +144 -149
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +25 -29
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +21 -16
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +74 -123
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +44 -24
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +2 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +16 -13
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +4 -0
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +8 -5
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +21 -6
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +117 -54
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +8 -7
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +38 -28
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +3 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +5 -4
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +15 -18
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +187 -146
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +23 -7
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +172 -35
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +678 -380
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +13 -5
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +4 -4
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +49 -52
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +3 -3
- 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 +23 -7
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +107 -64
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.d.ts +35 -0
- package/lib/deltaManagerProxyBase.d.ts.map +1 -0
- package/lib/deltaManagerProxyBase.js +73 -0
- package/lib/deltaManagerProxyBase.js.map +1 -0
- package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js +3 -1
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +7 -7
- 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 +10 -9
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +61 -52
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +16 -12
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +17 -5
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +13 -14
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +0 -8
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +5 -17
- 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 +20 -59
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +46 -36
- 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 +2 -2
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +2 -2
- 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 +385 -1142
- 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/metadata.d.ts +18 -0
- package/lib/metadata.d.ts.map +1 -0
- package/lib/metadata.js +6 -0
- package/lib/metadata.js.map +1 -0
- package/lib/opLifecycle/batchManager.d.ts +2 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +15 -7
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +11 -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 +2 -2
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +10 -5
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +2 -2
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +22 -13
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +17 -11
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +2 -2
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +15 -10
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +39 -6
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +132 -56
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +6 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +23 -9
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.js +1 -2
- package/lib/opProperties.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 +25 -10
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +90 -53
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +25 -15
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/index.d.ts +4 -4
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +2 -2
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +3 -3
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +21 -22
- 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 +31 -10
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +265 -133
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +8 -7
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +75 -74
- 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 +6 -10
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +9 -13
- 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 +40 -23
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +132 -137
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +25 -29
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +21 -16
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +70 -119
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +44 -24
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +2 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +9 -6
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +4 -0
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +7 -4
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +21 -6
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +109 -47
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +8 -7
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +35 -25
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +30 -32
- package/src/batchTracker.ts +7 -5
- package/src/blobManager.ts +235 -172
- package/src/connectionTelemetry.ts +19 -5
- package/src/containerRuntime.ts +853 -431
- package/src/dataStore.ts +12 -4
- package/src/dataStoreContext.ts +49 -46
- package/src/dataStoreContexts.ts +4 -4
- package/src/dataStoreRegistry.ts +1 -1
- package/src/dataStores.ts +119 -80
- package/src/deltaManagerProxyBase.ts +111 -0
- package/src/deltaManagerSummarizerProxy.ts +4 -1
- package/src/deltaScheduler.ts +7 -11
- package/src/error.ts +18 -0
- package/src/gc/garbageCollection.md +53 -5
- package/src/gc/garbageCollection.ts +58 -51
- package/src/gc/gcConfigs.ts +4 -2
- package/src/gc/gcDefinitions.ts +17 -21
- package/src/gc/gcEarlyAdoption.md +145 -0
- package/src/gc/gcHelpers.ts +1 -12
- package/src/gc/gcSummaryStateTracker.ts +19 -65
- package/src/gc/gcTelemetry.ts +15 -13
- package/src/gc/gcUnreferencedStateTracker.ts +1 -1
- package/src/gc/index.ts +2 -4
- package/src/id-compressor/appendOnlySortedMap.ts +26 -87
- package/src/id-compressor/finalSpace.ts +67 -0
- package/src/id-compressor/idCompressor.ts +458 -1682
- 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 +9 -2
- package/src/metadata.ts +19 -0
- package/src/opLifecycle/README.md +20 -0
- package/src/opLifecycle/batchManager.ts +9 -1
- package/src/opLifecycle/definitions.ts +11 -0
- package/src/opLifecycle/index.ts +1 -1
- package/src/opLifecycle/opCompressor.ts +6 -5
- package/src/opLifecycle/opDecompressor.ts +47 -17
- package/src/opLifecycle/opGroupingManager.ts +18 -8
- package/src/opLifecycle/opSplitter.ts +10 -7
- package/src/opLifecycle/outbox.ts +177 -72
- package/src/opLifecycle/remoteMessageProcessor.ts +32 -9
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +123 -78
- package/src/scheduleManager.ts +22 -11
- package/src/summary/index.ts +7 -4
- package/src/summary/orderedClientElection.ts +10 -6
- package/src/summary/runWhileConnectedCoordinator.ts +1 -1
- package/src/summary/runningSummarizer.ts +291 -163
- package/src/summary/summarizer.ts +27 -16
- package/src/summary/summarizerClientElection.ts +2 -2
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/index.ts +2 -2
- package/src/summary/summarizerNode/summarizerNode.ts +142 -184
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +27 -35
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +72 -148
- package/src/summary/summarizerTypes.ts +49 -24
- package/src/summary/summaryCollection.ts +9 -4
- package/src/summary/summaryFormat.ts +9 -2
- package/src/summary/summaryGenerator.ts +72 -49
- package/src/summary/summaryManager.ts +44 -16
- 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 -488
- 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 -30
- package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/dist/id-compressor/uuidUtilities.js +0 -106
- 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 -484
- 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 -30
- package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/lib/id-compressor/uuidUtilities.js +0 -98
- 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 -123
|
@@ -2,44 +2,40 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
5
|
+
import { ITelemetryLoggerExt, TelemetryDataTag } from "@fluidframework/telemetry-utils";
|
|
6
6
|
import { ISnapshotTree, ISummaryTree, SummaryObject } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
8
|
-
|
|
8
|
+
export interface IRefreshSummaryResult {
|
|
9
|
+
/** Tells whether this summary is tracked by this client. */
|
|
10
|
+
isSummaryTracked: boolean;
|
|
11
|
+
/** Tells whether this summary is newer than the latest one tracked by this client. */
|
|
12
|
+
isSummaryNewer: boolean;
|
|
13
|
+
}
|
|
9
14
|
/**
|
|
10
|
-
* Return type of
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* 2. The latest summary was updated and the summary corresponding to the params was tracked by this client.
|
|
15
|
-
*
|
|
16
|
-
* 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this case, the
|
|
17
|
-
* latest snapshot is fetched and the latest summary state is updated based on it.
|
|
15
|
+
* Return type of validateSummary function. In case of success, the object returned should have success: true.
|
|
16
|
+
* In case of failure, the object returned should have success: false and additional properties to indicate what
|
|
17
|
+
* the failure was, where it was, can it be retried, etc.
|
|
18
18
|
*/
|
|
19
|
-
export declare type
|
|
20
|
-
|
|
21
|
-
} | {
|
|
22
|
-
latestSummaryUpdated: true;
|
|
23
|
-
wasSummaryTracked: true;
|
|
24
|
-
summaryRefSeq: number;
|
|
19
|
+
export declare type ValidateSummaryResult = {
|
|
20
|
+
success: true;
|
|
25
21
|
} | {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
success: false;
|
|
23
|
+
/** The failure reason */
|
|
24
|
+
reason: string;
|
|
25
|
+
/** id of the node that failed during validation */
|
|
26
|
+
id: {
|
|
27
|
+
tag: TelemetryDataTag.CodeArtifact;
|
|
28
|
+
value: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
/** If the error can be retried, time to wait before retrying */
|
|
31
|
+
retryAfterSeconds?: number;
|
|
30
32
|
};
|
|
31
|
-
/**
|
|
32
|
-
* Result of snapshot fetch during refreshing latest summary state.
|
|
33
|
-
*/
|
|
34
|
-
export interface IFetchSnapshotResult {
|
|
35
|
-
snapshotTree: ISnapshotTree;
|
|
36
|
-
snapshotRefSeq: number;
|
|
37
|
-
}
|
|
38
33
|
export interface ISummarizerNodeRootContract {
|
|
39
34
|
startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt): void;
|
|
40
|
-
|
|
35
|
+
validateSummary(): ValidateSummaryResult;
|
|
36
|
+
completeSummary(proposalHandle: string, validate: boolean): void;
|
|
41
37
|
clearSummary(): void;
|
|
42
|
-
refreshLatestSummary(proposalHandle: string
|
|
38
|
+
refreshLatestSummary(proposalHandle: string, summaryRefSeq: number): Promise<IRefreshSummaryResult>;
|
|
43
39
|
}
|
|
44
40
|
/** Path for nodes in a tree with escaped special characters */
|
|
45
41
|
export declare class EscapedPath {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerNodeUtils.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"summarizerNodeUtils.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAClG,OAAO,EAAoB,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE9F,MAAM,WAAW,qBAAqB;IACrC,4DAA4D;IAC5D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sFAAsF;IACtF,cAAc,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,oBAAY,qBAAqB,GAC9B;IACA,OAAO,EAAE,IAAI,CAAC;CACb,GACD;IACA,OAAO,EAAE,KAAK,CAAC;IACf,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,EAAE,EAAE;QACH,GAAG,EAAE,gBAAgB,CAAC,YAAY,CAAC;QACnC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,CAAC;IACF,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEL,MAAM,WAAW,2BAA2B;IAC3C,YAAY,CAAC,uBAAuB,EAAE,MAAM,EAAE,aAAa,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACxF,eAAe,IAAI,qBAAqB,CAAC;IACzC,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACjE,YAAY,IAAI,IAAI,CAAC;IACrB,oBAAoB,CACnB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE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AAE,qBAAqB,GAAG,SAAS,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,sCAAsC;IACtC,cAAc,EAAE,eAAe,GAAG,SAAS,CAAC;IAC5C,2CAA2C;IAC3C,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,yDAAyD;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa;IACpE,4CAA4C;IAC5C,YAAY,EAAE,CAAC,CAAC;IAChB,uDAAuD;IACvD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC,CAa/F;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAa9F"}
|
|
@@ -12,8 +12,7 @@ export class EscapedPath {
|
|
|
12
12
|
return new EscapedPath(encodeURIComponent(path));
|
|
13
13
|
}
|
|
14
14
|
static createAndConcat(pathParts) {
|
|
15
|
-
|
|
16
|
-
let ret = EscapedPath.create((_a = pathParts[0]) !== null && _a !== void 0 ? _a : "");
|
|
15
|
+
let ret = EscapedPath.create(pathParts[0] ?? "");
|
|
17
16
|
for (let i = 1; i < pathParts.length; i++) {
|
|
18
17
|
ret = ret.concat(EscapedPath.create(pathParts[i]));
|
|
19
18
|
}
|
|
@@ -60,8 +59,7 @@ export class SummaryNode {
|
|
|
60
59
|
}
|
|
61
60
|
/** Gets the full path to this node, to be used when sending a handle */
|
|
62
61
|
get fullPath() {
|
|
63
|
-
|
|
64
|
-
return (_b = (_a = this.basePath) === null || _a === void 0 ? void 0 : _a.concat(this.localPath)) !== null && _b !== void 0 ? _b : this.localPath;
|
|
62
|
+
return this.basePath?.concat(this.localPath) ?? this.localPath;
|
|
65
63
|
}
|
|
66
64
|
/**
|
|
67
65
|
* Gets the full path to this node's innermost base summary.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerNodeUtils.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,gBAAgB,EAAyB,MAAM,qCAAqC,CAAC;AAkD9F,+DAA+D;AAC/D,MAAM,OAAO,WAAW;IACvB,YAAoC,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAC7C,MAAM,CAAC,MAAM,CAAC,IAAY;QAChC,OAAO,IAAI,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IACM,MAAM,CAAC,eAAe,CAAC,SAAmB;;QAChD,IAAI,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,MAAA,SAAS,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACnD;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;IACM,QAAQ;QACd,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACM,MAAM,CAAC,IAAiB;QAC9B,OAAO,IAAI,WAAW,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;CACD;AAED,0EAA0E;AAC1E,MAAM,OAAO,WAAW;IA6BvB,YACkB,OAKhB;QALgB,YAAO,GAAP,OAAO,CAKvB;IACC,CAAC;IAnCJ,0FAA0F;IACnF,MAAM,CA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AAC,EAAE,CAAC;SACjC,CAAC,CAAC;IACJ,CAAC;CACD;AAgCD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,WAA0B;IACjE,2EAA2E;IAC3E,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5D,IAAI,eAAe,KAAK,SAAS,EAAE;QAClC,OAAO;YACN,YAAY,EAAE,eAAe;YAC7B,gBAAgB,EAAE,gBAAgB;SAClC,CAAC;KACF;IACD,OAAO;QACN,YAAY,EAAE,WAAW;QACzB,gBAAgB,EAAE,SAAS;KAC3B,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAAqB;IAChE,2EAA2E;IAC3E,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACvD,IAAI,eAAe,KAAK,SAAS,EAAE;QAClC,OAAO;YACN,YAAY,EAAE,eAAe;YAC7B,gBAAgB,EAAE,gBAAgB;SAClC,CAAC;KACF;IACD,OAAO;QACN,YAAY,EAAE,OAAO;QACrB,gBAAgB,EAAE,SAAS;KAC3B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { ISnapshotTree, ISummaryTree, SummaryObject } from \"@fluidframework/protocol-definitions\";\nimport { channelsTreeName, ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { ReadAndParseBlob } from \"@fluidframework/runtime-utils\";\n\n/**\n * Return type of refreshSummaryAck function. There can be three different scenarios based on the passed params:\n *\n * 1. The latest summary was not updated.\n *\n * 2. The latest summary was updated and the summary corresponding to the params was tracked by this client.\n *\n * 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this case, the\n * latest snapshot is fetched and the latest summary state is updated based on it.\n */\nexport type RefreshSummaryResult =\n\t| {\n\t\t\tlatestSummaryUpdated: false;\n\t }\n\t| {\n\t\t\tlatestSummaryUpdated: true;\n\t\t\twasSummaryTracked: true;\n\t\t\tsummaryRefSeq: number;\n\t }\n\t| {\n\t\t\tlatestSummaryUpdated: true;\n\t\t\twasSummaryTracked: false;\n\t\t\tsnapshotTree: ISnapshotTree;\n\t\t\tsummaryRefSeq: number;\n\t };\n\n/**\n * Result of snapshot fetch during refreshing latest summary state.\n */\nexport interface IFetchSnapshotResult {\n\tsnapshotTree: ISnapshotTree;\n\tsnapshotRefSeq: number;\n}\n\nexport interface ISummarizerNodeRootContract {\n\tstartSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt): void;\n\tcompleteSummary(proposalHandle: string): void;\n\tclearSummary(): void;\n\trefreshLatestSummary(\n\t\tproposalHandle: string | undefined,\n\t\tsummaryRefSeq: number,\n\t\tfetchLatestSnapshot: () => Promise<IFetchSnapshotResult>,\n\t\treadAndParseBlob: ReadAndParseBlob,\n\t\tcorrelatedSummaryLogger: ITelemetryLoggerExt,\n\t): Promise<RefreshSummaryResult>;\n}\n\n/** Path for nodes in a tree with escaped special characters */\nexport class EscapedPath {\n\tprivate constructor(public readonly path: string) {}\n\tpublic static create(path: string): EscapedPath {\n\t\treturn new EscapedPath(encodeURIComponent(path));\n\t}\n\tpublic static createAndConcat(pathParts: string[]): EscapedPath {\n\t\tlet ret = EscapedPath.create(pathParts[0] ?? \"\");\n\t\tfor (let i = 1; i < pathParts.length; i++) {\n\t\t\tret = ret.concat(EscapedPath.create(pathParts[i]));\n\t\t}\n\t\treturn ret;\n\t}\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n\tpublic concat(path: EscapedPath): EscapedPath {\n\t\treturn new EscapedPath(`${this.path}/${path.path}`);\n\t}\n}\n\n/** Information about a summary relevant to a specific node in the tree */\nexport class SummaryNode {\n\t/** Creates an instance that is valid for the root with specific basePath and localPath */\n\tpublic static createForRoot(referenceSequenceNumber: number): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber,\n\t\t\tbasePath: undefined,\n\t\t\tlocalPath: EscapedPath.create(\"\"), // root hard-coded to \"\"\n\t\t});\n\t}\n\n\t/** Summary reference sequence number, i.e. last sequence number seen when it was created */\n\tpublic get referenceSequenceNumber(): number {\n\t\treturn this.summary.referenceSequenceNumber;\n\t}\n\t/** Full path to parent node, or undefined if this is the root */\n\tpublic get basePath(): EscapedPath | undefined {\n\t\treturn this.summary.basePath;\n\t}\n\t/** Relative path to this node from its parent node */\n\tpublic get localPath(): EscapedPath {\n\t\treturn this.summary.localPath;\n\t}\n\t/** Relative path from this node to its node innermost base summary */\n\tpublic get additionalPath(): EscapedPath | undefined {\n\t\treturn this.summary.additionalPath;\n\t}\n\tpublic set additionalPath(additionalPath: EscapedPath | undefined) {\n\t\tthis.summary.additionalPath = additionalPath;\n\t}\n\tconstructor(\n\t\tprivate readonly summary: {\n\t\t\treadonly referenceSequenceNumber: number;\n\t\t\treadonly basePath: EscapedPath | undefined;\n\t\t\treadonly localPath: EscapedPath;\n\t\t\tadditionalPath?: EscapedPath;\n\t\t},\n\t) {}\n\n\t/** Gets the full path to this node, to be used when sending a handle */\n\tpublic get fullPath(): EscapedPath {\n\t\treturn this.basePath?.concat(this.localPath) ?? this.localPath;\n\t}\n\n\t/**\n\t * Gets the full path to this node's innermost base summary.\n\t * The children nodes can use this as their basePath to determine their path.\n\t */\n\tpublic get fullPathForChildren(): EscapedPath {\n\t\treturn this.additionalPath !== undefined\n\t\t\t? this.fullPath.concat(this.additionalPath)\n\t\t\t: this.fullPath;\n\t}\n\n\t/**\n\t * Creates a new node within the same summary for a child of this node.\n\t * @param id - id of the child node\n\t */\n\tpublic createForChild(id: string): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\tbasePath: this.fullPathForChildren,\n\t\t\tlocalPath: EscapedPath.create(id),\n\t\t});\n\t}\n}\n\n/**\n * Information about the initial summary tree found from an attach op.\n */\nexport interface IInitialSummary {\n\tsequenceNumber: number;\n\tid: string;\n\tsummary: ISummaryTreeWithStats | undefined;\n}\n\n/**\n * Represents the details needed to create a child summarizer node.\n */\nexport interface ICreateChildDetails {\n\t/** Summary from attach op if known */\n\tinitialSummary: IInitialSummary | undefined;\n\t/** Latest summary from server node data */\n\tlatestSummary: SummaryNode | undefined;\n\t/** Sequence number of latest known change to the node */\n\tchangeSequenceNumber: number;\n\t/** A unique id of this child to be logged when sending telemetry. */\n\ttelemetryNodeId: string;\n}\n\nexport interface ISubtreeInfo<T extends ISnapshotTree | SummaryObject> {\n\t/** Tree to use to find children subtrees */\n\tchildrenTree: T;\n\t/** Additional path part where children are isolated */\n\tchildrenPathPart: string | undefined;\n}\n\n/**\n * Checks if the summary contains .channels subtree where the children subtrees\n * would be located if exists.\n * @param baseSummary - summary to check\n */\nexport function parseSummaryForSubtrees(baseSummary: ISnapshotTree): ISubtreeInfo<ISnapshotTree> {\n\t// New versions of snapshots have child nodes isolated in .channels subtree\n\tconst channelsSubtree = baseSummary.trees[channelsTreeName];\n\tif (channelsSubtree !== undefined) {\n\t\treturn {\n\t\t\tchildrenTree: channelsSubtree,\n\t\t\tchildrenPathPart: channelsTreeName,\n\t\t};\n\t}\n\treturn {\n\t\tchildrenTree: baseSummary,\n\t\tchildrenPathPart: undefined,\n\t};\n}\n\n/**\n * Checks if the summary contains .channels subtree where the children subtrees\n * would be located if exists.\n * @param baseSummary - summary to check\n */\nexport function parseSummaryTreeForSubtrees(summary: ISummaryTree): ISubtreeInfo<SummaryObject> {\n\t// New versions of snapshots have child nodes isolated in .channels subtree\n\tconst channelsSubtree = summary.tree[channelsTreeName];\n\tif (channelsSubtree !== undefined) {\n\t\treturn {\n\t\t\tchildrenTree: channelsSubtree,\n\t\t\tchildrenPathPart: channelsTreeName,\n\t\t};\n\t}\n\treturn {\n\t\tchildrenTree: summary,\n\t\tchildrenPathPart: undefined,\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"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AAK,CAAC,gBAAgB,CAAC,CAAC;IAC5D,IAAI,eAAe,KAAK,SAAS,EAAE;QAClC,OAAO;YACN,YAAY,EAAE,eAAe;YAC7B,gBAAgB,EAAE,gBAAgB;SAClC,CAAC;KACF;IACD,OAAO;QACN,YAAY,EAAE,WAAW;QACzB,gBAAgB,EAAE,SAAS;KAC3B,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAAqB;IAChE,2EAA2E;IAC3E,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACvD,IAAI,eAAe,KAAK,SAAS,EAAE;QAClC,OAAO;YACN,YAAY,EAAE,eAAe;YAC7B,gBAAgB,EAAE,gBAAgB;SAClC,CAAC;KACF;IACD,OAAO;QACN,YAAY,EAAE,OAAO;QACrB,gBAAgB,EAAE,SAAS;KAC3B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, TelemetryDataTag } from \"@fluidframework/telemetry-utils\";\nimport { ISnapshotTree, ISummaryTree, SummaryObject } from \"@fluidframework/protocol-definitions\";\nimport { channelsTreeName, ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\n\nexport interface IRefreshSummaryResult {\n\t/** Tells whether this summary is tracked by this client. */\n\tisSummaryTracked: boolean;\n\t/** Tells whether this summary is newer than the latest one tracked by this client. */\n\tisSummaryNewer: boolean;\n}\n\n/**\n * Return type of validateSummary function. In case of success, the object returned should have success: true.\n * In case of failure, the object returned should have success: false and additional properties to indicate what\n * the failure was, where it was, can it be retried, etc.\n */\nexport type ValidateSummaryResult =\n\t| {\n\t\t\tsuccess: true;\n\t }\n\t| {\n\t\t\tsuccess: false;\n\t\t\t/** The failure reason */\n\t\t\treason: string;\n\t\t\t/** id of the node that failed during validation */\n\t\t\tid: {\n\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\tvalue: string | undefined;\n\t\t\t};\n\t\t\t/** If the error can be retried, time to wait before retrying */\n\t\t\tretryAfterSeconds?: number;\n\t };\n\nexport interface ISummarizerNodeRootContract {\n\tstartSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt): void;\n\tvalidateSummary(): ValidateSummaryResult;\n\tcompleteSummary(proposalHandle: string, validate: boolean): void;\n\tclearSummary(): void;\n\trefreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult>;\n}\n\n/** Path for nodes in a tree with escaped special characters */\nexport class EscapedPath {\n\tprivate constructor(public readonly path: string) {}\n\tpublic static create(path: string): EscapedPath {\n\t\treturn new EscapedPath(encodeURIComponent(path));\n\t}\n\tpublic static createAndConcat(pathParts: string[]): EscapedPath {\n\t\tlet ret = EscapedPath.create(pathParts[0] ?? \"\");\n\t\tfor (let i = 1; i < pathParts.length; i++) {\n\t\t\tret = ret.concat(EscapedPath.create(pathParts[i]));\n\t\t}\n\t\treturn ret;\n\t}\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n\tpublic concat(path: EscapedPath): EscapedPath {\n\t\treturn new EscapedPath(`${this.path}/${path.path}`);\n\t}\n}\n\n/** Information about a summary relevant to a specific node in the tree */\nexport class SummaryNode {\n\t/** Creates an instance that is valid for the root with specific basePath and localPath */\n\tpublic static createForRoot(referenceSequenceNumber: number): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber,\n\t\t\tbasePath: undefined,\n\t\t\tlocalPath: EscapedPath.create(\"\"), // root hard-coded to \"\"\n\t\t});\n\t}\n\n\t/** Summary reference sequence number, i.e. last sequence number seen when it was created */\n\tpublic get referenceSequenceNumber(): number {\n\t\treturn this.summary.referenceSequenceNumber;\n\t}\n\t/** Full path to parent node, or undefined if this is the root */\n\tpublic get basePath(): EscapedPath | undefined {\n\t\treturn this.summary.basePath;\n\t}\n\t/** Relative path to this node from its parent node */\n\tpublic get localPath(): EscapedPath {\n\t\treturn this.summary.localPath;\n\t}\n\t/** Relative path from this node to its node innermost base summary */\n\tpublic get additionalPath(): EscapedPath | undefined {\n\t\treturn this.summary.additionalPath;\n\t}\n\tpublic set additionalPath(additionalPath: EscapedPath | undefined) {\n\t\tthis.summary.additionalPath = additionalPath;\n\t}\n\tconstructor(\n\t\tprivate readonly summary: {\n\t\t\treadonly referenceSequenceNumber: number;\n\t\t\treadonly basePath: EscapedPath | undefined;\n\t\t\treadonly localPath: EscapedPath;\n\t\t\tadditionalPath?: EscapedPath;\n\t\t},\n\t) {}\n\n\t/** Gets the full path to this node, to be used when sending a handle */\n\tpublic get fullPath(): EscapedPath {\n\t\treturn this.basePath?.concat(this.localPath) ?? this.localPath;\n\t}\n\n\t/**\n\t * Gets the full path to this node's innermost base summary.\n\t * The children nodes can use this as their basePath to determine their path.\n\t */\n\tpublic get fullPathForChildren(): EscapedPath {\n\t\treturn this.additionalPath !== undefined\n\t\t\t? this.fullPath.concat(this.additionalPath)\n\t\t\t: this.fullPath;\n\t}\n\n\t/**\n\t * Creates a new node within the same summary for a child of this node.\n\t * @param id - id of the child node\n\t */\n\tpublic createForChild(id: string): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\tbasePath: this.fullPathForChildren,\n\t\t\tlocalPath: EscapedPath.create(id),\n\t\t});\n\t}\n}\n\n/**\n * Information about the initial summary tree found from an attach op.\n */\nexport interface IInitialSummary {\n\tsequenceNumber: number;\n\tid: string;\n\tsummary: ISummaryTreeWithStats | undefined;\n}\n\n/**\n * Represents the details needed to create a child summarizer node.\n */\nexport interface ICreateChildDetails {\n\t/** Summary from attach op if known */\n\tinitialSummary: IInitialSummary | undefined;\n\t/** Latest summary from server node data */\n\tlatestSummary: SummaryNode | undefined;\n\t/** Sequence number of latest known change to the node */\n\tchangeSequenceNumber: number;\n\t/** A unique id of this child to be logged when sending telemetry. */\n\ttelemetryNodeId: string;\n}\n\nexport interface ISubtreeInfo<T extends ISnapshotTree | SummaryObject> {\n\t/** Tree to use to find children subtrees */\n\tchildrenTree: T;\n\t/** Additional path part where children are isolated */\n\tchildrenPathPart: string | undefined;\n}\n\n/**\n * Checks if the summary contains .channels subtree where the children subtrees\n * would be located if exists.\n * @param baseSummary - summary to check\n */\nexport function parseSummaryForSubtrees(baseSummary: ISnapshotTree): ISubtreeInfo<ISnapshotTree> {\n\t// New versions of snapshots have child nodes isolated in .channels subtree\n\tconst channelsSubtree = baseSummary.trees[channelsTreeName];\n\tif (channelsSubtree !== undefined) {\n\t\treturn {\n\t\t\tchildrenTree: channelsSubtree,\n\t\t\tchildrenPathPart: channelsTreeName,\n\t\t};\n\t}\n\treturn {\n\t\tchildrenTree: baseSummary,\n\t\tchildrenPathPart: undefined,\n\t};\n}\n\n/**\n * Checks if the summary contains .channels subtree where the children subtrees\n * would be located if exists.\n * @param baseSummary - summary to check\n */\nexport function parseSummaryTreeForSubtrees(summary: ISummaryTree): ISubtreeInfo<SummaryObject> {\n\t// New versions of snapshots have child nodes isolated in .channels subtree\n\tconst channelsSubtree = summary.tree[channelsTreeName];\n\tif (channelsSubtree !== undefined) {\n\t\treturn {\n\t\t\tchildrenTree: channelsSubtree,\n\t\t\tchildrenPathPart: channelsTreeName,\n\t\t};\n\t}\n\treturn {\n\t\tchildrenTree: summary,\n\t\tchildrenPathPart: undefined,\n\t};\n}\n"]}
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
6
|
-
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
7
6
|
import { CreateChildSummarizerNodeParam, IGarbageCollectionData, IGarbageCollectionDetailsBase, ISummarizeInternalResult, ISummarizeResult, ISummarizerNodeConfigWithGC, ISummarizerNodeWithGC, SummarizeInternalFn, ITelemetryContext, IExperimentalIncrementalSummaryContext } from "@fluidframework/runtime-definitions";
|
|
8
|
-
import {
|
|
7
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
9
8
|
import { SummarizerNode } from "./summarizerNode";
|
|
10
|
-
import { EscapedPath, IInitialSummary, ISummarizerNodeRootContract, SummaryNode } from "./summarizerNodeUtils";
|
|
9
|
+
import { EscapedPath, IInitialSummary, ISummarizerNodeRootContract, SummaryNode, ValidateSummaryResult } from "./summarizerNodeUtils";
|
|
11
10
|
export interface IRootSummarizerNodeWithGC extends ISummarizerNodeWithGC, ISummarizerNodeRootContract {
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
@@ -38,9 +37,9 @@ export declare class SummarizerNodeWithGC extends SummarizerNode implements IRoo
|
|
|
38
37
|
* Do not call constructor directly.
|
|
39
38
|
* Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.
|
|
40
39
|
*/
|
|
41
|
-
constructor(logger:
|
|
40
|
+
constructor(logger: ITelemetryBaseLogger, summarizeFn: (fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext) => Promise<ISummarizeInternalResult>, config: ISummarizerNodeConfigWithGC, changeSequenceNumber: number,
|
|
42
41
|
/** Undefined means created without summary */
|
|
43
|
-
latestSummary?: SummaryNode, initialSummary?: IInitialSummary, wipSummaryLogger?:
|
|
42
|
+
latestSummary?: SummaryNode, initialSummary?: IInitialSummary, wipSummaryLogger?: ITelemetryBaseLogger, getGCDataFn?: ((fullGC?: boolean | undefined) => Promise<IGarbageCollectionData>) | undefined, getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
|
|
44
43
|
/** A unique id of this node to be logged when sending telemetry. */
|
|
45
44
|
telemetryId?: string);
|
|
46
45
|
/**
|
|
@@ -61,11 +60,26 @@ export declare class SummarizerNodeWithGC extends SummarizerNode implements IRoo
|
|
|
61
60
|
* Called during the start of a summary. Updates the work-in-progress used routes.
|
|
62
61
|
*/
|
|
63
62
|
startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt): void;
|
|
63
|
+
/**
|
|
64
|
+
* Validates that the in-progress summary is correct for all nodes, i.e., GC should have run for non-skipped nodes.
|
|
65
|
+
* @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when running GC.
|
|
66
|
+
* In that case, the children will not have work-in-progress state.
|
|
67
|
+
*
|
|
68
|
+
* @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.
|
|
69
|
+
* In case of failure, additional information is returned indicating type of failure and where it was.
|
|
70
|
+
*/
|
|
71
|
+
protected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult;
|
|
72
|
+
private wasGCMissed;
|
|
64
73
|
/**
|
|
65
74
|
* Called after summary has been uploaded to the server. Add the work-in-progress state to the pending
|
|
66
75
|
* summary queue. We track this until we get an ack from the server for this summary.
|
|
76
|
+
* @param proposalHandle - The handle of the summary that was uploaded to the server.
|
|
77
|
+
* @param parentPath - The path of the parent node which is used to build the path of this node.
|
|
78
|
+
* @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
|
|
79
|
+
* In that case, the children will not have work-in-progress state.
|
|
80
|
+
* @param validate - true to validate that the in-progress summary is correct for all nodes.
|
|
67
81
|
*/
|
|
68
|
-
protected completeSummaryCore(proposalHandle: string, parentPath: EscapedPath | undefined, parentSkipRecursion: boolean): void;
|
|
82
|
+
protected completeSummaryCore(proposalHandle: string, parentPath: EscapedPath | undefined, parentSkipRecursion: boolean, validate: boolean): void;
|
|
69
83
|
/**
|
|
70
84
|
* Clears the work-in-progress state.
|
|
71
85
|
*/
|
|
@@ -75,15 +89,6 @@ export declare class SummarizerNodeWithGC extends SummarizerNode implements IRoo
|
|
|
75
89
|
* from the state in the pending summary queue.
|
|
76
90
|
*/
|
|
77
91
|
protected refreshLatestSummaryFromPending(proposalHandle: string, referenceSequenceNumber: number): void;
|
|
78
|
-
/**
|
|
79
|
-
* Called when we need to upload the reference state from the given summary.
|
|
80
|
-
*/
|
|
81
|
-
protected refreshLatestSummaryFromSnapshot(referenceSequenceNumber: number, snapshotTree: ISnapshotTree, basePath: EscapedPath | undefined, localPath: EscapedPath, correlatedSummaryLogger: ITelemetryLoggerExt, readAndParseBlob: ReadAndParseBlob): Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* Updates GC state from the given snapshot if GC is enabled and the snapshot is newer than the one this node
|
|
84
|
-
* is tracking.
|
|
85
|
-
*/
|
|
86
|
-
private refreshGCStateFromSnapshot;
|
|
87
92
|
/**
|
|
88
93
|
* Override the createChild method to return an instance of SummarizerNodeWithGC.
|
|
89
94
|
*/
|
|
@@ -144,5 +149,5 @@ export declare class SummarizerNodeWithGC extends SummarizerNode implements IRoo
|
|
|
144
149
|
* @param getGCDataFn - Function to get the GC data of this node
|
|
145
150
|
* @param baseGCDetailsP - Function to get the initial GC details of this node
|
|
146
151
|
*/
|
|
147
|
-
export declare const createRootSummarizerNodeWithGC: (logger:
|
|
152
|
+
export declare const createRootSummarizerNodeWithGC: (logger: ITelemetryBaseLogger, summarizeInternalFn: SummarizeInternalFn, changeSequenceNumber: number, referenceSequenceNumber: number | undefined, config?: ISummarizerNodeConfigWithGC, getGCDataFn?: ((fullGC?: boolean | undefined) => Promise<IGarbageCollectionData>) | undefined, getBaseGCDetailsFn?: (() => Promise<IGarbageCollectionDetailsBase>) | undefined) => IRootSummarizerNodeWithGC;
|
|
148
153
|
//# sourceMappingURL=summarizerNodeWithGc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerNodeWithGc.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,mBAAmB,
|
|
1
|
+
{"version":3,"file":"summarizerNodeWithGc.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAA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OAAO,KAAK,OAAO,CAAC,sBAAsB,CAAC,EACnE,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,6BAA6B,CAAC,GAC/D,qBAAqB;IAuCxB;;;;;;;;OAQG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,EAAE,EAAE,EAAE,MAAM;IA0BvE;;OAEG;IACI,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACI,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS;IAIvD,YAAY,IAAI,OAAO;IAIvB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE;IAY5C;;OAEG;IACH,SAAS,CAAC,UAAU,IAAI,OAAO;IAI/B;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;CAW3B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B,WAClC,oBAAoB,uBACP,mBAAmB,wBAClB,MAAM,2BACH,MAAM,GAAG,SAAS,WACnC,2BAA2B,mDACC,QAAQ,sBAAsB,CAAC,2CACxC,QAAQ,6BAA6B,CAAC,kBAC/D,yBAcD,CAAC"}
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { LoggingError, TelemetryDataTag, } from "@fluidframework/telemetry-utils";
|
|
6
|
-
import { assert, LazyPromise } from "@fluidframework/
|
|
7
|
-
import { gcTreeKey, } from "@fluidframework/runtime-definitions";
|
|
5
|
+
import { LoggingError, TelemetryDataTag, tagCodeArtifacts, } from "@fluidframework/telemetry-utils";
|
|
6
|
+
import { assert, LazyPromise } from "@fluidframework/core-utils";
|
|
8
7
|
import { unpackChildNodesUsedRoutes } from "@fluidframework/runtime-utils";
|
|
9
|
-
import { cloneGCData,
|
|
8
|
+
import { cloneGCData, unpackChildNodesGCDetails } from "../../gc";
|
|
10
9
|
import { SummarizerNode } from "./summarizerNode";
|
|
11
|
-
import {
|
|
10
|
+
import { SummaryNode, } from "./summarizerNodeUtils";
|
|
12
11
|
// Extend SummaryNode to add used routes tracking to it.
|
|
13
12
|
class SummaryNodeWithGC extends SummaryNode {
|
|
14
13
|
constructor(serializedUsedRoutes, summary) {
|
|
@@ -50,8 +49,7 @@ export class SummarizerNodeWithGC extends SummarizerNode {
|
|
|
50
49
|
this.usedRoutes = [""];
|
|
51
50
|
this.gcDisabled = config.gcDisabled === true;
|
|
52
51
|
this.baseGCDetailsP = new LazyPromise(async () => {
|
|
53
|
-
|
|
54
|
-
return (_a = (await (getBaseGCDetailsFn === null || getBaseGCDetailsFn === void 0 ? void 0 : getBaseGCDetailsFn()))) !== null && _a !== void 0 ? _a : { usedRoutes: [] };
|
|
52
|
+
return (await getBaseGCDetailsFn?.()) ?? { usedRoutes: [] };
|
|
55
53
|
});
|
|
56
54
|
this.childNodesBaseGCDetailsP = new LazyPromise(async () => {
|
|
57
55
|
await this.loadBaseGCDetails();
|
|
@@ -130,39 +128,75 @@ export class SummarizerNodeWithGC extends SummarizerNode {
|
|
|
130
128
|
}
|
|
131
129
|
super.startSummary(referenceSequenceNumber, summaryLogger);
|
|
132
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Validates that the in-progress summary is correct for all nodes, i.e., GC should have run for non-skipped nodes.
|
|
133
|
+
* @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when running GC.
|
|
134
|
+
* In that case, the children will not have work-in-progress state.
|
|
135
|
+
*
|
|
136
|
+
* @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.
|
|
137
|
+
* In case of failure, additional information is returned indicating type of failure and where it was.
|
|
138
|
+
*/
|
|
139
|
+
validateSummaryCore(parentSkipRecursion) {
|
|
140
|
+
if (this.wasGCMissed()) {
|
|
141
|
+
return {
|
|
142
|
+
success: false,
|
|
143
|
+
reason: "NodeDidNotRunGC",
|
|
144
|
+
id: {
|
|
145
|
+
tag: TelemetryDataTag.CodeArtifact,
|
|
146
|
+
value: this.telemetryNodeId,
|
|
147
|
+
},
|
|
148
|
+
// These errors are usually transient and should go away when summarize / GC is retried.
|
|
149
|
+
retryAfterSeconds: 1,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
return super.validateSummaryCore(parentSkipRecursion);
|
|
153
|
+
}
|
|
154
|
+
wasGCMissed() {
|
|
155
|
+
// If GC is disabled, it should not have run so it was not missed.
|
|
156
|
+
// Otherwise, GC should have been called on this node and wipSerializedUsedRoutes must be set.
|
|
157
|
+
if (this.gcDisabled || this.wipSerializedUsedRoutes !== undefined) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The absence of wip used routes indicates that GC was not run on this node. This can happen if:
|
|
162
|
+
* 1. A child node was created after GC was already run on the parent. For example, a data store
|
|
163
|
+
* is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this
|
|
164
|
+
* case, the parent will pass on used routes to the child nodes and it will have wip used routes.
|
|
165
|
+
* 2. A new node was created but GC was never run on it. This can mean that the GC data generated
|
|
166
|
+
* during summarize is incomplete.
|
|
167
|
+
*
|
|
168
|
+
* This happens due to scenarios such as data store created during summarize. Such errors should go away when
|
|
169
|
+
* summarize is attempted again.
|
|
170
|
+
*/
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
133
173
|
/**
|
|
134
174
|
* Called after summary has been uploaded to the server. Add the work-in-progress state to the pending
|
|
135
175
|
* summary queue. We track this until we get an ack from the server for this summary.
|
|
176
|
+
* @param proposalHandle - The handle of the summary that was uploaded to the server.
|
|
177
|
+
* @param parentPath - The path of the parent node which is used to build the path of this node.
|
|
178
|
+
* @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
|
|
179
|
+
* In that case, the children will not have work-in-progress state.
|
|
180
|
+
* @param validate - true to validate that the in-progress summary is correct for all nodes.
|
|
136
181
|
*/
|
|
137
|
-
completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion) {
|
|
182
|
+
completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate) {
|
|
183
|
+
if (validate && this.wasGCMissed()) {
|
|
184
|
+
this.throwUnexpectedError({
|
|
185
|
+
eventName: "NodeDidNotRunGC",
|
|
186
|
+
proposalHandle,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
138
189
|
let wipSerializedUsedRoutes;
|
|
139
190
|
// If GC is disabled, don't set wip used routes.
|
|
140
191
|
if (!this.gcDisabled) {
|
|
141
192
|
wipSerializedUsedRoutes = this.wipSerializedUsedRoutes;
|
|
142
|
-
/**
|
|
143
|
-
* The absence of wip used routes indicates that GC was not run on this node. This can happen if:
|
|
144
|
-
* 1. A child node was created after GC was already run on the parent. For example, a data store
|
|
145
|
-
* is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this
|
|
146
|
-
* case, the used routes of the parent should be passed on the child nodes and it should be fine.
|
|
147
|
-
* 2. A new node was created but GC was never run on it. This can mean that the GC data generated
|
|
148
|
-
* during summarize is complete . We should not continue, log and throw an error. This will help us
|
|
149
|
-
* identify these cases and take appropriate action.
|
|
150
|
-
*/
|
|
151
|
-
if (wipSerializedUsedRoutes === undefined) {
|
|
152
|
-
this.throwUnexpectedError({
|
|
153
|
-
eventName: "NodeDidNotRunGC",
|
|
154
|
-
proposalHandle,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
193
|
}
|
|
158
|
-
super.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion);
|
|
194
|
+
super.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate);
|
|
159
195
|
// If GC is disabled, skip setting pending summary with GC state.
|
|
160
196
|
if (!this.gcDisabled) {
|
|
161
197
|
const summaryNode = this.pendingSummaries.get(proposalHandle);
|
|
162
198
|
if (summaryNode !== undefined) {
|
|
163
|
-
const summaryNodeWithGC = new SummaryNodeWithGC(
|
|
164
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
165
|
-
wipSerializedUsedRoutes, summaryNode);
|
|
199
|
+
const summaryNodeWithGC = new SummaryNodeWithGC(wipSerializedUsedRoutes, summaryNode);
|
|
166
200
|
this.pendingSummaries.set(proposalHandle, summaryNodeWithGC);
|
|
167
201
|
}
|
|
168
202
|
}
|
|
@@ -189,10 +223,9 @@ export class SummarizerNodeWithGC extends SummarizerNode {
|
|
|
189
223
|
const error = new LoggingError("MissingGCStateInPendingSummary", {
|
|
190
224
|
proposalHandle,
|
|
191
225
|
referenceSequenceNumber,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
},
|
|
226
|
+
...tagCodeArtifacts({
|
|
227
|
+
id: this.telemetryNodeId,
|
|
228
|
+
}),
|
|
196
229
|
});
|
|
197
230
|
this.logger.sendErrorEvent({
|
|
198
231
|
eventName: error.message,
|
|
@@ -204,87 +237,6 @@ export class SummarizerNodeWithGC extends SummarizerNode {
|
|
|
204
237
|
}
|
|
205
238
|
return super.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);
|
|
206
239
|
}
|
|
207
|
-
/**
|
|
208
|
-
* Called when we need to upload the reference state from the given summary.
|
|
209
|
-
*/
|
|
210
|
-
async refreshLatestSummaryFromSnapshot(referenceSequenceNumber, snapshotTree, basePath, localPath, correlatedSummaryLogger, readAndParseBlob) {
|
|
211
|
-
await this.refreshGCStateFromSnapshot(referenceSequenceNumber, snapshotTree, readAndParseBlob);
|
|
212
|
-
return super.refreshLatestSummaryFromSnapshot(referenceSequenceNumber, snapshotTree, basePath, localPath, correlatedSummaryLogger, readAndParseBlob);
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Updates GC state from the given snapshot if GC is enabled and the snapshot is newer than the one this node
|
|
216
|
-
* is tracking.
|
|
217
|
-
*/
|
|
218
|
-
async refreshGCStateFromSnapshot(referenceSequenceNumber, snapshotTree, readAndParseBlob) {
|
|
219
|
-
// If GC is disabled or we have seen a newer summary, skip updating GC state.
|
|
220
|
-
if (this.gcDisabled || this.referenceSequenceNumber >= referenceSequenceNumber) {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
// Load the base GC details before proceeding because if that happens later it can overwrite the GC details
|
|
224
|
-
// written by the following code.
|
|
225
|
-
await this.loadBaseGCDetails();
|
|
226
|
-
// Possible re-entrancy. We may already have processed this while loading base GC details.
|
|
227
|
-
if (this.referenceSequenceNumber >= referenceSequenceNumber) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* GC data is written at root of the snapshot tree under "gc" sub-tree. This data needs to be propagated to
|
|
232
|
-
* all the nodes in the container.
|
|
233
|
-
* The root summarizer node reads the GC data from the "gc" sub-tree, runs GC on it to get used routes in
|
|
234
|
-
* the container and updates its GC data and referenced used routes. It then gets the GC data and used
|
|
235
|
-
* routes of all its children and adds it to their snapshot tree.
|
|
236
|
-
* All the other nodes gets the GC data and used routes from their snapshot tree and updates their state.
|
|
237
|
-
* They get the GC data and used routes of their children and add it to their snapshot tree and so on.
|
|
238
|
-
*
|
|
239
|
-
* Note that if the snapshot does not have GC tree, GC data will be set to undefined and used routes will be
|
|
240
|
-
* set to self-route (meaning referenced) for all nodes. This is important because the GC data needs to be
|
|
241
|
-
* regenerated in the next summary.
|
|
242
|
-
*/
|
|
243
|
-
let gcDetails;
|
|
244
|
-
const gcSnapshotTree = snapshotTree.trees[gcTreeKey];
|
|
245
|
-
if (gcSnapshotTree !== undefined) {
|
|
246
|
-
// If there is a GC tree in the snapshot, this is the root summarizer node. Read GC data from the tree
|
|
247
|
-
// process it as explained above.
|
|
248
|
-
const gcSnapshotData = await getGCDataFromSnapshot(gcSnapshotTree, readAndParseBlob);
|
|
249
|
-
if (gcSnapshotData.gcState !== undefined) {
|
|
250
|
-
const gcNodes = {};
|
|
251
|
-
for (const [nodeId, nodeData] of Object.entries(gcSnapshotData.gcState.gcNodes)) {
|
|
252
|
-
gcNodes[nodeId] = Array.from(nodeData.outboundRoutes);
|
|
253
|
-
}
|
|
254
|
-
// Run GC on the nodes in the snapshot to get the used routes for each node in the container.
|
|
255
|
-
const usedRoutes = runGarbageCollection(gcNodes, ["/"]).referencedNodeIds;
|
|
256
|
-
gcDetails = { gcData: { gcNodes }, usedRoutes };
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
// If there is a GC blob in the snapshot, it's a non-root summarizer nodes - The root summarizer node
|
|
261
|
-
// writes GC blob in the snapshot of child nodes. Get GC data and used routes from the blob.
|
|
262
|
-
const gcDetailsBlob = snapshotTree.blobs[gcTreeKey];
|
|
263
|
-
if (gcDetailsBlob !== undefined) {
|
|
264
|
-
gcDetails = JSON.parse(gcDetailsBlob);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
// Update this node to the same GC state it was when the ack corresponding to this summary was processed.
|
|
268
|
-
this.gcData = (gcDetails === null || gcDetails === void 0 ? void 0 : gcDetails.gcData) !== undefined ? cloneGCData(gcDetails.gcData) : undefined;
|
|
269
|
-
this.referenceUsedRoutes =
|
|
270
|
-
(gcDetails === null || gcDetails === void 0 ? void 0 : gcDetails.usedRoutes) !== undefined ? Array.from(gcDetails.usedRoutes) : undefined;
|
|
271
|
-
// If there are no used routes in the GC details, set it to have self route which will make the node
|
|
272
|
-
// referenced. This scenario can only happen if the snapshot is from a client where GC was not run or
|
|
273
|
-
// disabled. In both the cases, the node should be referenced.
|
|
274
|
-
this.usedRoutes =
|
|
275
|
-
(gcDetails === null || gcDetails === void 0 ? void 0 : gcDetails.usedRoutes) !== undefined ? Array.from(gcDetails.usedRoutes) : [""];
|
|
276
|
-
if (gcDetails === undefined) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
// Generate the GC data and used routes of children GC nodes and add it to their snapshot tree.
|
|
280
|
-
const gcDetailsMap = unpackChildNodesGCDetails(gcDetails);
|
|
281
|
-
const { childrenTree } = parseSummaryForSubtrees(snapshotTree);
|
|
282
|
-
gcDetailsMap.forEach((childGCDetails, childId) => {
|
|
283
|
-
if (childrenTree.trees[childId] !== undefined) {
|
|
284
|
-
childrenTree.trees[childId].blobs[gcTreeKey] = JSON.stringify(childGCDetails);
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
240
|
/**
|
|
289
241
|
* Override the createChild method to return an instance of SummarizerNodeWithGC.
|
|
290
242
|
*/
|
|
@@ -299,7 +251,6 @@ export class SummarizerNodeWithGC extends SummarizerNode {
|
|
|
299
251
|
* Attach information if it is created from an attach op.
|
|
300
252
|
*/
|
|
301
253
|
createParam, config = {}, getGCDataFn, getBaseGCDetailsFn) {
|
|
302
|
-
var _a;
|
|
303
254
|
assert(!this.children.has(id), 0x1b6 /* "Create SummarizerNode child already exists" */);
|
|
304
255
|
/**
|
|
305
256
|
* Update the child node's base GC details from this node's current GC details instead of updating from the base
|
|
@@ -308,14 +259,15 @@ export class SummarizerNodeWithGC extends SummarizerNode {
|
|
|
308
259
|
* the one from the downloaded snapshot and not the base GC details.
|
|
309
260
|
*/
|
|
310
261
|
const getChildBaseGCDetailsFn = async () => {
|
|
311
|
-
var _a;
|
|
312
262
|
const childNodesBaseGCDetails = await this.childNodesBaseGCDetailsP;
|
|
313
|
-
return
|
|
263
|
+
return childNodesBaseGCDetails.get(id) ?? {};
|
|
314
264
|
};
|
|
315
265
|
const createDetails = this.getCreateDetailsForChild(id, createParam);
|
|
316
|
-
const child = new SummarizerNodeWithGC(this.logger, summarizeInternalFn,
|
|
266
|
+
const child = new SummarizerNodeWithGC(this.logger, summarizeInternalFn, {
|
|
267
|
+
...config,
|
|
317
268
|
// Propagate our gcDisabled state to the child if its not explicity specified in child's config.
|
|
318
|
-
gcDisabled:
|
|
269
|
+
gcDisabled: config.gcDisabled ?? this.gcDisabled,
|
|
270
|
+
}, createDetails.changeSequenceNumber, createDetails.latestSummary, createDetails.initialSummary, this.wipSummaryLogger, getGCDataFn, getChildBaseGCDetailsFn, createDetails.telemetryNodeId);
|
|
319
271
|
// There may be additional state that has to be updated in this child. For example, if a summary is being
|
|
320
272
|
// tracked, the child's summary tracking state needs to be updated too.
|
|
321
273
|
this.maybeUpdateChildState(child, id);
|
|
@@ -332,7 +284,6 @@ export class SummarizerNodeWithGC extends SummarizerNode {
|
|
|
332
284
|
* @param id - Initial id or path part of this node
|
|
333
285
|
*/
|
|
334
286
|
maybeUpdateChildState(child, id) {
|
|
335
|
-
var _a;
|
|
336
287
|
super.maybeUpdateChildState(child, id);
|
|
337
288
|
// In case we have pending summaries on the parent, let's initialize it on the child.
|
|
338
289
|
if (child.latestSummary !== undefined) {
|
|
@@ -340,7 +291,7 @@ export class SummarizerNodeWithGC extends SummarizerNode {
|
|
|
340
291
|
const summaryNodeWithGC = value;
|
|
341
292
|
if (summaryNodeWithGC.serializedUsedRoutes !== undefined) {
|
|
342
293
|
const childNodeUsedRoutes = unpackChildNodesUsedRoutes(JSON.parse(summaryNodeWithGC.serializedUsedRoutes));
|
|
343
|
-
const newSerializedRoutes =
|
|
294
|
+
const newSerializedRoutes = childNodeUsedRoutes.get(id) ?? [""];
|
|
344
295
|
const newLatestSummaryNode = new SummaryNodeWithGC(JSON.stringify(newSerializedRoutes), {
|
|
345
296
|
referenceSequenceNumber: value.referenceSequenceNumber,
|
|
346
297
|
basePath: child.latestSummary.basePath,
|