@fluidframework/container-runtime 2.20.0 → 2.21.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/.eslintrc.cjs +36 -6
- package/CHANGELOG.md +38 -0
- package/api-report/container-runtime.legacy.alpha.api.md +31 -31
- package/dist/batchTracker.d.ts +1 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +14 -11
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.d.ts +1 -0
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.js +7 -5
- package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +63 -41
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +2 -2
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +4 -4
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +14 -30
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +264 -194
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +6 -3
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +16 -11
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +1 -0
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +5 -5
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +36 -14
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +2 -0
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +8 -0
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +1 -0
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +8 -5
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +2 -1
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +29 -15
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/inboundBatchAggregator.js +3 -3
- package/dist/inboundBatchAggregator.js.map +1 -1
- package/dist/layerCompatState.d.ts +19 -0
- package/dist/layerCompatState.d.ts.map +1 -0
- package/dist/layerCompatState.js +64 -0
- package/dist/layerCompatState.js.map +1 -0
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/duplicateBatchDetector.js +2 -2
- package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +3 -2
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +13 -19
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +3 -0
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +4 -1
- 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 +5 -3
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +13 -10
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +14 -11
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +3 -3
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +11 -15
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +3 -1
- 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 +3 -4
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +11 -10
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +7 -0
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +6 -4
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -0
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +13 -11
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +7 -2
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +2 -2
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +38 -17
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +18 -9
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +1 -0
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +1 -1
- package/dist/summary/summarizerHeuristics.js.map +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.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +30 -31
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +7 -0
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +3 -4
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +9 -6
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +4 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +3 -2
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +19 -8
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +12 -9
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +14 -11
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.d.ts +1 -0
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.js +7 -5
- package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +66 -42
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +2 -2
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +5 -5
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +14 -30
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +271 -196
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +6 -3
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +16 -11
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +1 -0
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +6 -6
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +39 -15
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +2 -0
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +8 -0
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +1 -0
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +8 -5
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +2 -1
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +32 -16
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/inboundBatchAggregator.js +4 -4
- package/lib/inboundBatchAggregator.js.map +1 -1
- package/lib/layerCompatState.d.ts +19 -0
- package/lib/layerCompatState.d.ts.map +1 -0
- package/lib/layerCompatState.js +60 -0
- package/lib/layerCompatState.js.map +1 -0
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/duplicateBatchDetector.js +2 -2
- package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts +3 -2
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +13 -19
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +3 -0
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +4 -1
- 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 +5 -3
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +13 -10
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +14 -11
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +3 -3
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +11 -15
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +3 -1
- 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 +3 -4
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +12 -11
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +7 -0
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +6 -4
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -0
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +13 -11
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +7 -2
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +2 -2
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +38 -17
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +18 -9
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +1 -0
- 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.map +1 -1
- package/lib/summary/summarizerNode/index.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +30 -31
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +7 -0
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +3 -4
- 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 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +2 -2
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +19 -8
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +12 -9
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +21 -43
- package/src/batchTracker.ts +3 -3
- package/src/blobManager/blobManager.ts +16 -14
- package/src/blobManager/blobManagerSnapSum.ts +8 -8
- package/src/channelCollection.ts +63 -44
- package/src/connectionTelemetry.ts +12 -6
- package/src/containerRuntime.ts +306 -235
- package/src/dataStore.ts +6 -3
- package/src/dataStoreContext.ts +16 -16
- package/src/dataStoreContexts.ts +1 -0
- package/src/deltaScheduler.ts +6 -6
- package/src/gc/garbageCollection.ts +47 -20
- package/src/gc/gcConfigs.ts +9 -1
- package/src/gc/gcDefinitions.ts +12 -0
- package/src/gc/gcHelpers.ts +9 -4
- package/src/gc/gcSummaryStateTracker.ts +3 -1
- package/src/gc/gcTelemetry.ts +26 -11
- package/src/inboundBatchAggregator.ts +4 -4
- package/src/layerCompatState.ts +75 -0
- package/src/messageTypes.ts +2 -0
- package/src/opLifecycle/README.md +43 -34
- package/src/opLifecycle/duplicateBatchDetector.ts +2 -2
- package/src/opLifecycle/opCompressor.ts +16 -23
- package/src/opLifecycle/opDecompressor.ts +4 -1
- package/src/opLifecycle/opGroupingManager.ts +5 -4
- package/src/opLifecycle/opSplitter.ts +14 -11
- package/src/opLifecycle/outbox.ts +13 -20
- package/src/opLifecycle/remoteMessageProcessor.ts +3 -1
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +15 -10
- package/src/summary/documentSchema.ts +11 -4
- package/src/summary/orderedClientElection.ts +14 -11
- package/src/summary/runWhileConnectedCoordinator.ts +6 -0
- package/src/summary/runningSummarizer.ts +43 -19
- package/src/summary/summarizer.ts +24 -11
- package/src/summary/summarizerClientElection.ts +2 -0
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/index.ts +1 -0
- package/src/summary/summarizerNode/summarizerNode.ts +32 -31
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +4 -4
- package/src/summary/summarizerTypes.ts +7 -0
- package/src/summary/summaryCollection.ts +19 -8
- package/src/summary/summaryFormat.ts +10 -5
- package/src/summary/summaryGenerator.ts +25 -10
- package/src/summary/summaryManager.ts +14 -12
- package/container-runtime.test-files.tar +0 -0
package/lib/channelCollection.js
CHANGED
|
@@ -10,11 +10,14 @@ import { CreateSummarizerNodeSource, channelsTreeName, gcDataBlobKey, } from "@f
|
|
|
10
10
|
import { GCDataBuilder, RequestParser, SummaryTreeBuilder, addBlobToSummary, convertSnapshotTreeToSummaryTree, convertSummaryTreeToITree, create404Response, createResponseError, encodeCompactIdToString, isSerializedHandle, processAttachMessageGCData, responseToException, unpackChildNodesUsedRoutes, } from "@fluidframework/runtime-utils/internal";
|
|
11
11
|
import { DataCorruptionError, DataProcessingError, LoggingError, createChildLogger, createChildMonitoringContext, extractSafePropertiesFromMessage, tagCodeArtifacts, } from "@fluidframework/telemetry-utils/internal";
|
|
12
12
|
import { v4 as uuid } from "uuid";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
// eslint-disable-next-line import/no-deprecated
|
|
15
|
+
DeletedResponseHeaderKey, defaultRuntimeHeaderData, } from "./containerRuntime.js";
|
|
14
16
|
import { channelToDataStore, isDataStoreAliasMessage, } from "./dataStore.js";
|
|
15
17
|
import { LocalDetachedFluidDataStoreContext, LocalFluidDataStoreContext, RemoteFluidDataStoreContext, createAttributesBlob, } from "./dataStoreContext.js";
|
|
16
18
|
import { DataStoreContexts } from "./dataStoreContexts.js";
|
|
17
19
|
import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
20
|
+
// eslint-disable-next-line import/no-deprecated
|
|
18
21
|
import { GCNodeType, urlToGCNodePath } from "./gc/index.js";
|
|
19
22
|
import { ContainerMessageType } from "./messageTypes.js";
|
|
20
23
|
import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs.js";
|
|
@@ -160,6 +163,7 @@ export class ChannelCollection {
|
|
|
160
163
|
this.pendingAttach = new Map();
|
|
161
164
|
// 0.24 back-compat attachingBeforeSummary
|
|
162
165
|
this.attachOpFiredForDataStore = new Set();
|
|
166
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
|
|
163
167
|
this.disposeOnce = new Lazy(() => this.contexts.dispose());
|
|
164
168
|
this.pendingAliasMap = new Map();
|
|
165
169
|
/**
|
|
@@ -188,42 +192,42 @@ export class ChannelCollection {
|
|
|
188
192
|
unreferencedDataStoreCount++;
|
|
189
193
|
}
|
|
190
194
|
// If we have a detached container, then create local data store contexts.
|
|
191
|
-
if (this.parentContext.attachState
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
snapshotForRemoteFluidDatastoreContext = {
|
|
195
|
-
...baseSnapshot,
|
|
196
|
-
snapshotTree: value,
|
|
197
|
-
};
|
|
195
|
+
if (this.parentContext.attachState === AttachState.Detached) {
|
|
196
|
+
if (typeof value !== "object") {
|
|
197
|
+
throw new LoggingError("Snapshot should be there to load from!!");
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
const snapshotTree = value;
|
|
200
|
+
dataStoreContext = new LocalFluidDataStoreContext({
|
|
200
201
|
id: key,
|
|
201
|
-
|
|
202
|
+
pkg: undefined,
|
|
202
203
|
parentContext: this.wrapContextForInnerChannel(key),
|
|
203
204
|
storage: this.parentContext.storage,
|
|
204
205
|
scope: this.parentContext.scope,
|
|
205
206
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
|
|
206
207
|
type: CreateSummarizerNodeSource.FromSummary,
|
|
207
208
|
}),
|
|
208
|
-
|
|
209
|
+
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),
|
|
210
|
+
snapshotTree,
|
|
209
211
|
});
|
|
210
212
|
}
|
|
211
213
|
else {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
let snapshotForRemoteFluidDatastoreContext = value;
|
|
215
|
+
if (isInstanceOfISnapshot(baseSnapshot)) {
|
|
216
|
+
snapshotForRemoteFluidDatastoreContext = {
|
|
217
|
+
...baseSnapshot,
|
|
218
|
+
snapshotTree: value,
|
|
219
|
+
};
|
|
214
220
|
}
|
|
215
|
-
|
|
216
|
-
dataStoreContext = new LocalFluidDataStoreContext({
|
|
221
|
+
dataStoreContext = new RemoteFluidDataStoreContext({
|
|
217
222
|
id: key,
|
|
218
|
-
|
|
223
|
+
snapshot: snapshotForRemoteFluidDatastoreContext,
|
|
219
224
|
parentContext: this.wrapContextForInnerChannel(key),
|
|
220
225
|
storage: this.parentContext.storage,
|
|
221
226
|
scope: this.parentContext.scope,
|
|
222
227
|
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
|
|
223
228
|
type: CreateSummarizerNodeSource.FromSummary,
|
|
224
229
|
}),
|
|
225
|
-
|
|
226
|
-
snapshotTree,
|
|
230
|
+
loadingGroupId: value.groupId,
|
|
227
231
|
});
|
|
228
232
|
}
|
|
229
233
|
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
@@ -486,13 +490,16 @@ export class ChannelCollection {
|
|
|
486
490
|
reSubmit(type, content, localOpMetadata) {
|
|
487
491
|
switch (type) {
|
|
488
492
|
case ContainerMessageType.Attach:
|
|
489
|
-
case ContainerMessageType.Alias:
|
|
493
|
+
case ContainerMessageType.Alias: {
|
|
490
494
|
this.parentContext.submitMessage(type, content, localOpMetadata);
|
|
491
495
|
return;
|
|
492
|
-
|
|
496
|
+
}
|
|
497
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
493
498
|
return this.reSubmitChannelOp(type, content, localOpMetadata);
|
|
494
|
-
|
|
499
|
+
}
|
|
500
|
+
default: {
|
|
495
501
|
assert(false, 0x907 /* unknown op type */);
|
|
502
|
+
}
|
|
496
503
|
}
|
|
497
504
|
}
|
|
498
505
|
reSubmitChannelOp(type, content, localOpMetadata) {
|
|
@@ -529,14 +536,18 @@ export class ChannelCollection {
|
|
|
529
536
|
async applyStashedOp(content) {
|
|
530
537
|
const opContents = content;
|
|
531
538
|
switch (opContents.type) {
|
|
532
|
-
case ContainerMessageType.Attach:
|
|
539
|
+
case ContainerMessageType.Attach: {
|
|
533
540
|
return this.applyStashedAttachOp(opContents.contents);
|
|
534
|
-
|
|
541
|
+
}
|
|
542
|
+
case ContainerMessageType.Alias: {
|
|
535
543
|
return;
|
|
536
|
-
|
|
544
|
+
}
|
|
545
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
537
546
|
return this.applyStashedChannelChannelOp(opContents.contents);
|
|
538
|
-
|
|
547
|
+
}
|
|
548
|
+
default: {
|
|
539
549
|
assert(false, 0x908 /* unknon type of op */);
|
|
550
|
+
}
|
|
540
551
|
}
|
|
541
552
|
}
|
|
542
553
|
async applyStashedChannelChannelOp(envelope) {
|
|
@@ -584,7 +595,7 @@ export class ChannelCollection {
|
|
|
584
595
|
// if the client is not detached put in the pending attach list
|
|
585
596
|
// so that on ack of the stashed op, the context is found.
|
|
586
597
|
// detached client don't send ops, so should not expect and ack.
|
|
587
|
-
this.pendingAttach.set(
|
|
598
|
+
this.pendingAttach.set(id, message);
|
|
588
599
|
}
|
|
589
600
|
}
|
|
590
601
|
/**
|
|
@@ -593,17 +604,21 @@ export class ChannelCollection {
|
|
|
593
604
|
*/
|
|
594
605
|
processMessages(messageCollection) {
|
|
595
606
|
switch (messageCollection.envelope.type) {
|
|
596
|
-
case ContainerMessageType.FluidDataStoreOp:
|
|
607
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
597
608
|
this.processChannelMessages(messageCollection);
|
|
598
609
|
break;
|
|
599
|
-
|
|
610
|
+
}
|
|
611
|
+
case ContainerMessageType.Attach: {
|
|
600
612
|
this.processAttachMessages(messageCollection);
|
|
601
613
|
break;
|
|
602
|
-
|
|
614
|
+
}
|
|
615
|
+
case ContainerMessageType.Alias: {
|
|
603
616
|
this.processAliasMessages(messageCollection);
|
|
604
617
|
break;
|
|
605
|
-
|
|
618
|
+
}
|
|
619
|
+
default: {
|
|
606
620
|
assert(false, 0x8e9 /* unreached */);
|
|
621
|
+
}
|
|
607
622
|
}
|
|
608
623
|
}
|
|
609
624
|
/**
|
|
@@ -630,7 +645,7 @@ export class ChannelCollection {
|
|
|
630
645
|
* @param messageCollection - The collection of messages to process.
|
|
631
646
|
*/
|
|
632
647
|
processChannelMessages(messageCollection) {
|
|
633
|
-
const { messagesContent, local } = messageCollection;
|
|
648
|
+
const { envelope, messagesContent, local } = messageCollection;
|
|
634
649
|
let currentMessageState;
|
|
635
650
|
let currentMessagesContent = [];
|
|
636
651
|
// Helper that sends the current bunch of messages to the data store. It validates that the data stores exists.
|
|
@@ -642,7 +657,7 @@ export class ChannelCollection {
|
|
|
642
657
|
const currentContext = this.contexts.get(currentMessageState.address);
|
|
643
658
|
assert(!!currentContext, 0xa66 /* Context not found */);
|
|
644
659
|
currentContext.processMessages({
|
|
645
|
-
envelope: { ...
|
|
660
|
+
envelope: { ...envelope, type: currentMessageState.type },
|
|
646
661
|
messagesContent: currentMessagesContent,
|
|
647
662
|
local,
|
|
648
663
|
});
|
|
@@ -664,10 +679,10 @@ export class ChannelCollection {
|
|
|
664
679
|
}
|
|
665
680
|
if (context === undefined) {
|
|
666
681
|
// Former assert 0x162
|
|
667
|
-
throw DataProcessingError.create("No context for op", "processFluidDataStoreOp",
|
|
682
|
+
throw DataProcessingError.create("No context for op", "processFluidDataStoreOp", envelope, {
|
|
668
683
|
local,
|
|
669
684
|
messageDetails: JSON.stringify({
|
|
670
|
-
type:
|
|
685
|
+
type: envelope.type,
|
|
671
686
|
contentType: typeof contents,
|
|
672
687
|
}),
|
|
673
688
|
...tagCodeArtifacts({ address }),
|
|
@@ -689,10 +704,10 @@ export class ChannelCollection {
|
|
|
689
704
|
this.gcNodeUpdated({
|
|
690
705
|
node: { type: "DataStore", path: `/${address}` },
|
|
691
706
|
reason: "Changed",
|
|
692
|
-
timestampMs:
|
|
707
|
+
timestampMs: envelope.timestamp,
|
|
693
708
|
packagePath: context.isLoaded ? context.packagePath : undefined,
|
|
694
709
|
});
|
|
695
|
-
detectOutboundReferences(address, contextContents, (fromPath, toPath) => this.parentContext.addedGCOutboundRoute(fromPath, toPath,
|
|
710
|
+
detectOutboundReferences(address, contextContents, (fromPath, toPath) => this.parentContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp));
|
|
696
711
|
}
|
|
697
712
|
// Process the last bunch of messages, if any. Note that there may not be any messages in case all of them are
|
|
698
713
|
// ignored because the data store is deleted.
|
|
@@ -703,6 +718,7 @@ export class ChannelCollection {
|
|
|
703
718
|
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData, originalRequest)) {
|
|
704
719
|
// The requested data store has been deleted by gc. Create a 404 response exception.
|
|
705
720
|
throw responseToException(createResponseError(404, "DataStore was deleted", originalRequest, {
|
|
721
|
+
// eslint-disable-next-line import/no-deprecated
|
|
706
722
|
[DeletedResponseHeaderKey]: true,
|
|
707
723
|
}), originalRequest);
|
|
708
724
|
}
|
|
@@ -744,7 +760,7 @@ export class ChannelCollection {
|
|
|
744
760
|
if (!this.isDataStoreDeleted(dataStoreNodePath)) {
|
|
745
761
|
return false;
|
|
746
762
|
}
|
|
747
|
-
const idToLog = originalRequest
|
|
763
|
+
const idToLog = originalRequest === undefined ? dataStoreNodePath : urlToGCNodePath(originalRequest.url);
|
|
748
764
|
// Log the package details asynchronously since getInitialSnapshotDetails is async
|
|
749
765
|
const recentlyDeletedContext = this.contexts.getRecentlyDeletedContext(id);
|
|
750
766
|
if (recentlyDeletedContext !== undefined) {
|
|
@@ -867,7 +883,7 @@ export class ChannelCollection {
|
|
|
867
883
|
builder.prefixAndAddNodes(contextId, contextGCData.gcNodes);
|
|
868
884
|
});
|
|
869
885
|
// Get the outbound routes (aliased data stores) and add a GC node for this channel.
|
|
870
|
-
builder.addNode("/",
|
|
886
|
+
builder.addNode("/", [...this.aliasedDataStores]);
|
|
871
887
|
return builder.getGCData();
|
|
872
888
|
}
|
|
873
889
|
/**
|
|
@@ -1032,7 +1048,7 @@ export class ChannelCollection {
|
|
|
1032
1048
|
}
|
|
1033
1049
|
this.deleteChild(dataStoreId);
|
|
1034
1050
|
}
|
|
1035
|
-
return
|
|
1051
|
+
return [...sweepReadyDataStoreRoutes];
|
|
1036
1052
|
}
|
|
1037
1053
|
/**
|
|
1038
1054
|
* This is called to update objects whose routes are tombstones.
|
|
@@ -1081,12 +1097,14 @@ export class ChannelCollection {
|
|
|
1081
1097
|
// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the
|
|
1082
1098
|
// data store that contains it.
|
|
1083
1099
|
const context = this.contexts.get(nodePath.split("/")[1]);
|
|
1084
|
-
|
|
1100
|
+
const initialSnapshotDetails = await context?.getInitialSnapshotDetails();
|
|
1101
|
+
return initialSnapshotDetails?.pkg;
|
|
1085
1102
|
}
|
|
1086
1103
|
/**
|
|
1087
1104
|
* Called by GC to determine if a node is for a data store or for an object within a data store (for e.g. DDS).
|
|
1088
1105
|
* @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.
|
|
1089
1106
|
*/
|
|
1107
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1090
1108
|
getGCNodeType(nodePath) {
|
|
1091
1109
|
const pathParts = nodePath.split("/");
|
|
1092
1110
|
if (!this.contexts.has(pathParts[1])) {
|
|
@@ -1095,8 +1113,10 @@ export class ChannelCollection {
|
|
|
1095
1113
|
// Data stores paths are of the format "/dataStoreId".
|
|
1096
1114
|
// Sub data store paths are of the format "/dataStoreId/subPath/...".
|
|
1097
1115
|
if (pathParts.length === 2) {
|
|
1116
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1098
1117
|
return GCNodeType.DataStore;
|
|
1099
1118
|
}
|
|
1119
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1100
1120
|
return GCNodeType.SubDataStore;
|
|
1101
1121
|
}
|
|
1102
1122
|
internalId(maybeAlias) {
|
|
@@ -1144,7 +1164,9 @@ export class ChannelCollection {
|
|
|
1144
1164
|
return dataStore.request(subRequest);
|
|
1145
1165
|
}
|
|
1146
1166
|
}
|
|
1147
|
-
export function getSummaryForDatastores(snapshot,
|
|
1167
|
+
export function getSummaryForDatastores(snapshot,
|
|
1168
|
+
// eslint-disable-next-line import/no-deprecated
|
|
1169
|
+
metadata) {
|
|
1148
1170
|
if (!snapshot) {
|
|
1149
1171
|
return undefined;
|
|
1150
1172
|
}
|
|
@@ -1197,7 +1219,9 @@ export function detectOutboundReferences(address, contents, addedOutboundReferen
|
|
|
1197
1219
|
// GC node paths are all absolute paths, hence the "" prefix.
|
|
1198
1220
|
// e.g. this will yield "/dataStoreId/ddsId"
|
|
1199
1221
|
const fromPath = ["", address, ddsAddress].join("/");
|
|
1200
|
-
|
|
1222
|
+
for (const toPath of outboundPaths) {
|
|
1223
|
+
addedOutboundReference(fromPath, toPath);
|
|
1224
|
+
}
|
|
1201
1225
|
}
|
|
1202
1226
|
/**
|
|
1203
1227
|
* @internal
|