@fluidframework/container-runtime 2.0.0-dev-rc.3.0.0.254866 → 2.0.0-dev-rc.5.0.0.263932
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 +69 -0
- package/api-report/container-runtime.api.md +93 -39
- package/dist/batchTracker.d.ts +1 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +7 -7
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +2 -4
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +10 -6
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +85 -22
- 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 +54 -5
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +22 -35
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +232 -174
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +9 -6
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +19 -5
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +2 -0
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -0
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/deltaManagerProxies.d.ts +81 -0
- package/dist/deltaManagerProxies.d.ts.map +1 -0
- package/dist/{deltaManagerSummarizerProxy.js → deltaManagerProxies.js} +75 -20
- package/dist/deltaManagerProxies.js.map +1 -0
- package/dist/deltaScheduler.d.ts +2 -2
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +5 -12
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +45 -29
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +27 -6
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +5 -4
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +14 -2
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +14 -4
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +24 -21
- package/dist/gc/gcTelemetry.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 +2 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{alpha.d.ts → legacy.d.ts} +8 -1
- package/dist/messageTypes.d.ts +5 -2
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/metadata.d.ts +2 -2
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +4 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +0 -10
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +6 -6
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +2 -2
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js +1 -1
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +0 -4
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +7 -38
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +9 -2
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +26 -10
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/public.d.ts +3 -0
- package/dist/scheduleManager.d.ts +2 -2
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +3 -1
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +34 -16
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/index.d.ts +1 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +2 -2
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runningSummarizer.js +10 -10
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -2
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +4 -3
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +4 -10
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -3
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +2 -9
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +3 -5
- 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.map +1 -1
- package/dist/summary/summaryFormat.d.ts +25 -5
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +1 -2
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +12 -11
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +5 -5
- package/dist/summary/summaryManager.js.map +1 -1
- package/{lib/beta.d.ts → internal.d.ts} +2 -0
- package/{dist/beta.d.ts → legacy.d.ts} +2 -0
- package/lib/batchTracker.d.ts +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +7 -7
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +3 -5
- package/lib/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +10 -6
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +88 -25
- 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 +49 -0
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +22 -35
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +232 -174
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +1 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +9 -6
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +21 -7
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +2 -0
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -0
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/deltaManagerProxies.d.ts +81 -0
- package/lib/deltaManagerProxies.d.ts.map +1 -0
- package/lib/{deltaManagerSummarizerProxy.js → deltaManagerProxies.js} +72 -19
- package/lib/deltaManagerProxies.js.map +1 -0
- package/lib/deltaScheduler.d.ts +2 -2
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +5 -12
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +47 -31
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +27 -6
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +5 -4
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +12 -1
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +14 -4
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +24 -21
- package/lib/gc/gcTelemetry.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 +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/{alpha.d.ts → legacy.d.ts} +8 -1
- package/lib/messageTypes.d.ts +5 -2
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/metadata.d.ts +2 -2
- package/lib/metadata.d.ts.map +1 -1
- package/lib/metadata.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +4 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +0 -10
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +6 -6
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +2 -2
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +0 -4
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -38
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +9 -2
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +27 -11
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/public.d.ts +3 -0
- package/lib/scheduleManager.d.ts +2 -2
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +3 -1
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +34 -16
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/index.d.ts +1 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +2 -2
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runningSummarizer.js +1 -1
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -2
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +4 -3
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +4 -10
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -3
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +2 -9
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +3 -5
- 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.map +1 -1
- package/lib/summary/summaryFormat.d.ts +25 -5
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +1 -2
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +5 -4
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +2 -2
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +37 -59
- package/src/batchTracker.ts +1 -2
- package/src/blobManager.ts +11 -10
- package/src/channelCollection.ts +115 -47
- package/src/connectionTelemetry.ts +59 -4
- package/src/containerRuntime.ts +302 -270
- package/src/dataStore.ts +7 -4
- package/src/dataStoreContext.ts +57 -16
- package/src/dataStoreContexts.ts +13 -2
- package/src/{deltaManagerSummarizerProxy.ts → deltaManagerProxies.ts} +98 -24
- package/src/deltaScheduler.ts +2 -3
- package/src/gc/garbageCollection.ts +64 -42
- package/src/gc/gcDefinitions.ts +22 -10
- package/src/gc/gcHelpers.ts +14 -1
- package/src/gc/gcTelemetry.ts +57 -50
- package/src/gc/index.ts +2 -1
- package/src/index.ts +7 -0
- package/src/messageTypes.ts +4 -2
- package/src/metadata.ts +2 -2
- package/src/opLifecycle/README.md +4 -4
- package/src/opLifecycle/batchManager.ts +5 -14
- package/src/opLifecycle/opDecompressor.ts +12 -6
- package/src/opLifecycle/opGroupingManager.ts +2 -2
- package/src/opLifecycle/opSplitter.ts +1 -1
- package/src/opLifecycle/outbox.ts +7 -53
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +38 -15
- package/src/scheduleManager.ts +2 -2
- package/src/summary/documentSchema.ts +52 -18
- package/src/summary/index.ts +4 -0
- package/src/summary/orderedClientElection.ts +6 -3
- package/src/summary/runningSummarizer.ts +1 -1
- package/src/summary/summarizer.ts +1 -1
- package/src/summary/summarizerClientElection.ts +1 -1
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/summarizerNode.ts +3 -12
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +2 -3
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +1 -10
- package/src/summary/summarizerTypes.ts +6 -5
- package/src/summary/summaryCollection.ts +2 -2
- package/src/summary/summaryFormat.ts +30 -4
- package/src/summary/summaryGenerator.ts +20 -9
- package/src/summary/summaryManager.ts +6 -3
- package/dist/deltaManagerSummarizerProxy.d.ts +0 -44
- package/dist/deltaManagerSummarizerProxy.d.ts.map +0 -1
- package/dist/deltaManagerSummarizerProxy.js.map +0 -1
- package/lib/deltaManagerSummarizerProxy.d.ts +0 -44
- package/lib/deltaManagerSummarizerProxy.d.ts.map +0 -1
- package/lib/deltaManagerSummarizerProxy.js.map +0 -1
package/lib/channelCollection.js
CHANGED
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
6
6
|
import { assert, Lazy, LazyPromise } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { FluidObjectHandle } from "@fluidframework/datastore/internal";
|
|
8
|
-
import { buildSnapshotTree } from "@fluidframework/driver-utils/internal";
|
|
8
|
+
import { buildSnapshotTree, getSnapshotTree, isInstanceOfISnapshot, } from "@fluidframework/driver-utils/internal";
|
|
9
9
|
import { CreateSummarizerNodeSource, channelsTreeName, } from "@fluidframework/runtime-definitions/internal";
|
|
10
10
|
import { GCDataBuilder, RequestParser, SummaryTreeBuilder, 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
|
-
import { defaultRuntimeHeaderData } from "./containerRuntime.js";
|
|
12
|
+
import { DeletedResponseHeaderKey, defaultRuntimeHeaderData, } from "./containerRuntime.js";
|
|
13
13
|
import { channelToDataStore, isDataStoreAliasMessage, } from "./dataStore.js";
|
|
14
14
|
import { LocalDetachedFluidDataStoreContext, LocalFluidDataStoreContext, RemoteFluidDataStoreContext, createAttributesBlob, } from "./dataStoreContext.js";
|
|
15
15
|
import { DataStoreContexts } from "./dataStoreContexts.js";
|
|
16
16
|
import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
17
|
-
import { GCNodeType, detectOutboundRoutesViaDDSKey,
|
|
17
|
+
import { GCNodeType, detectOutboundRoutesViaDDSKey, urlToGCNodePath, } from "./gc/index.js";
|
|
18
18
|
import { ContainerMessageType } from "./messageTypes.js";
|
|
19
19
|
import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs.js";
|
|
20
20
|
import { nonDataStorePaths, rootHasIsolatedChannels, } from "./summary/index.js";
|
|
@@ -80,6 +80,7 @@ export function wrapContext(context) {
|
|
|
80
80
|
getAudience: (...args) => {
|
|
81
81
|
return context.getAudience(...args);
|
|
82
82
|
},
|
|
83
|
+
// back-compat, to be removed in 2.0
|
|
83
84
|
ensureNoDataModelChanges: (...args) => {
|
|
84
85
|
return context.ensureNoDataModelChanges(...args);
|
|
85
86
|
},
|
|
@@ -171,7 +172,8 @@ export class ChannelCollection {
|
|
|
171
172
|
// Extract stores stored inside the snapshot
|
|
172
173
|
const fluidDataStores = new Map();
|
|
173
174
|
if (baseSnapshot) {
|
|
174
|
-
|
|
175
|
+
const baseSnapshotTree = getSnapshotTree(baseSnapshot);
|
|
176
|
+
for (const [key, value] of Object.entries(baseSnapshotTree.trees)) {
|
|
175
177
|
fluidDataStores.set(key, value);
|
|
176
178
|
}
|
|
177
179
|
}
|
|
@@ -185,9 +187,16 @@ export class ChannelCollection {
|
|
|
185
187
|
}
|
|
186
188
|
// If we have a detached container, then create local data store contexts.
|
|
187
189
|
if (this.parentContext.attachState !== AttachState.Detached) {
|
|
190
|
+
let snapshotForRemoteFluidDatastoreContext = value;
|
|
191
|
+
if (isInstanceOfISnapshot(baseSnapshot)) {
|
|
192
|
+
snapshotForRemoteFluidDatastoreContext = {
|
|
193
|
+
...baseSnapshot,
|
|
194
|
+
snapshotTree: value,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
188
197
|
dataStoreContext = new RemoteFluidDataStoreContext({
|
|
189
198
|
id: key,
|
|
190
|
-
|
|
199
|
+
snapshot: snapshotForRemoteFluidDatastoreContext,
|
|
191
200
|
parentContext: this.wrapContextForInnerChannel(key),
|
|
192
201
|
storage: this.parentContext.storage,
|
|
193
202
|
scope: this.parentContext.scope,
|
|
@@ -286,16 +295,19 @@ export class ChannelCollection {
|
|
|
286
295
|
throw error;
|
|
287
296
|
}
|
|
288
297
|
const flatAttachBlobs = new Map();
|
|
289
|
-
let
|
|
298
|
+
let snapshot;
|
|
290
299
|
if (attachMessage.snapshot) {
|
|
291
|
-
|
|
300
|
+
snapshot = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);
|
|
301
|
+
if (isInstanceOfISnapshot(this.baseSnapshot)) {
|
|
302
|
+
snapshot = { ...this.baseSnapshot, snapshotTree: snapshot };
|
|
303
|
+
}
|
|
292
304
|
}
|
|
293
305
|
// Include the type of attach message which is the pkg of the store to be
|
|
294
306
|
// used by RemoteFluidDataStoreContext in case it is not in the snapshot.
|
|
295
307
|
const pkg = [attachMessage.type];
|
|
296
308
|
const remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({
|
|
297
309
|
id: attachMessage.id,
|
|
298
|
-
|
|
310
|
+
snapshot,
|
|
299
311
|
parentContext: this.wrapContextForInnerChannel(attachMessage.id),
|
|
300
312
|
storage: new StorageServiceWithAttachBlobs(this.parentContext.storage, flatAttachBlobs),
|
|
301
313
|
scope: this.parentContext.scope,
|
|
@@ -377,8 +389,8 @@ export class ChannelCollection {
|
|
|
377
389
|
* If the container is detached, this data store will be part of the summary that makes the container attached.
|
|
378
390
|
*/
|
|
379
391
|
if (this.parentContext.attachState !== AttachState.Detached) {
|
|
380
|
-
localContext.setAttachState(AttachState.Attaching);
|
|
381
392
|
this.submitAttachChannelOp(localContext);
|
|
393
|
+
localContext.setAttachState(AttachState.Attaching);
|
|
382
394
|
}
|
|
383
395
|
this.contexts.bind(id);
|
|
384
396
|
}
|
|
@@ -428,6 +440,7 @@ export class ChannelCollection {
|
|
|
428
440
|
return this.createContext(this.createDataStoreId(), pkg, LocalFluidDataStoreContext, props, loadingGroupId);
|
|
429
441
|
}
|
|
430
442
|
createContext(id, pkg, contextCtor, createProps, loadingGroupId) {
|
|
443
|
+
assert(loadingGroupId !== "", 0x974 /* loadingGroupId should not be the empty string */);
|
|
431
444
|
const context = new contextCtor({
|
|
432
445
|
id,
|
|
433
446
|
pkg,
|
|
@@ -604,14 +617,20 @@ export class ChannelCollection {
|
|
|
604
617
|
context.process(message, local, localMessageMetadata);
|
|
605
618
|
// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is
|
|
606
619
|
// being used.
|
|
607
|
-
this.gcNodeUpdated(
|
|
620
|
+
this.gcNodeUpdated({
|
|
621
|
+
node: { type: "DataStore", path: `/${address}` },
|
|
622
|
+
reason: "Changed",
|
|
623
|
+
timestampMs: message.timestamp,
|
|
624
|
+
packagePath: context.isLoaded ? context.packagePath : undefined,
|
|
625
|
+
});
|
|
608
626
|
}
|
|
609
|
-
async getDataStore(id, requestHeaderData) {
|
|
627
|
+
async getDataStore(id, requestHeaderData, originalRequest) {
|
|
610
628
|
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
|
|
611
|
-
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData)) {
|
|
629
|
+
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData, originalRequest)) {
|
|
612
630
|
// The requested data store has been deleted by gc. Create a 404 response exception.
|
|
613
|
-
|
|
614
|
-
|
|
631
|
+
throw responseToException(createResponseError(404, "DataStore was deleted", originalRequest, {
|
|
632
|
+
[DeletedResponseHeaderKey]: true,
|
|
633
|
+
}), originalRequest);
|
|
615
634
|
}
|
|
616
635
|
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
|
|
617
636
|
if (context === undefined) {
|
|
@@ -640,21 +659,52 @@ export class ChannelCollection {
|
|
|
640
659
|
* Checks if the data store has been deleted by GC. If so, log an error.
|
|
641
660
|
* @param id - The data store's id.
|
|
642
661
|
* @param context - The data store context.
|
|
662
|
+
* @param deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)
|
|
643
663
|
* @param callSite - The function name this is called from.
|
|
644
664
|
* @param requestHeaderData - The request header information to log if the data store is deleted.
|
|
665
|
+
* @param originalRequest - The original request (could be for a child of the DataStore)
|
|
645
666
|
* @returns true if the data store is deleted. Otherwise, returns false.
|
|
646
667
|
*/
|
|
647
|
-
checkAndLogIfDeleted(id, context, deletedLogSuffix, callSite, requestHeaderData) {
|
|
668
|
+
checkAndLogIfDeleted(id, context, deletedLogSuffix, callSite, requestHeaderData, originalRequest) {
|
|
648
669
|
const dataStoreNodePath = `/${id}`;
|
|
649
670
|
if (!this.isDataStoreDeleted(dataStoreNodePath)) {
|
|
650
671
|
return false;
|
|
651
672
|
}
|
|
673
|
+
const idToLog = originalRequest !== undefined
|
|
674
|
+
? urlToGCNodePath(originalRequest.url)
|
|
675
|
+
: dataStoreNodePath;
|
|
676
|
+
// Log the package details asynchronously since getInitialSnapshotDetails is async
|
|
677
|
+
const recentelyDeletedContext = this.contexts.getRecentlyDeletedContext(id);
|
|
678
|
+
if (recentelyDeletedContext !== undefined) {
|
|
679
|
+
recentelyDeletedContext
|
|
680
|
+
.getInitialSnapshotDetails()
|
|
681
|
+
.then((details) => {
|
|
682
|
+
return details.pkg.join("/");
|
|
683
|
+
})
|
|
684
|
+
.then((pkg) => ({ pkg, error: undefined }), (error) => ({ pkg: undefined, error }))
|
|
685
|
+
.then(({ pkg, error }) => {
|
|
686
|
+
this.mc.logger.sendTelemetryEvent({
|
|
687
|
+
eventName: `GC_DeletedDataStore_PathInfo`,
|
|
688
|
+
...tagCodeArtifacts({
|
|
689
|
+
id: idToLog,
|
|
690
|
+
pkg,
|
|
691
|
+
}),
|
|
692
|
+
callSite,
|
|
693
|
+
}, error);
|
|
694
|
+
})
|
|
695
|
+
.catch(() => { });
|
|
696
|
+
}
|
|
652
697
|
this.mc.logger.sendErrorEvent({
|
|
653
698
|
eventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,
|
|
654
|
-
...tagCodeArtifacts({ id }),
|
|
699
|
+
...tagCodeArtifacts({ id: idToLog }),
|
|
655
700
|
callSite,
|
|
656
701
|
headers: JSON.stringify(requestHeaderData),
|
|
657
702
|
exists: context !== undefined,
|
|
703
|
+
details: {
|
|
704
|
+
url: originalRequest?.url,
|
|
705
|
+
headers: JSON.stringify(originalRequest?.headers),
|
|
706
|
+
aliased: this.aliasedDataStores.has(id),
|
|
707
|
+
},
|
|
658
708
|
});
|
|
659
709
|
return true;
|
|
660
710
|
}
|
|
@@ -763,7 +813,7 @@ export class ChannelCollection {
|
|
|
763
813
|
// If this data store is not yet loaded, then there should be no changes in the snapshot from
|
|
764
814
|
// which it was created as it is detached container. So just use the previous snapshot.
|
|
765
815
|
assert(!!this.baseSnapshot, 0x166 /* "BaseSnapshot should be there as detached container loaded from snapshot" */);
|
|
766
|
-
dataStoreSummary = convertSnapshotTreeToSummaryTree(this.baseSnapshot.trees[key]);
|
|
816
|
+
dataStoreSummary = convertSnapshotTreeToSummaryTree(getSnapshotTree(this.baseSnapshot).trees[key]);
|
|
767
817
|
}
|
|
768
818
|
builder.addWithStats(key, dataStoreSummary);
|
|
769
819
|
});
|
|
@@ -844,6 +894,15 @@ export class ChannelCollection {
|
|
|
844
894
|
deleteChild(dataStoreId) {
|
|
845
895
|
const dataStoreContext = this.contexts.get(dataStoreId);
|
|
846
896
|
assert(dataStoreContext !== undefined, 0x2d7 /* No data store with specified id */);
|
|
897
|
+
if (dataStoreContext.isLoaded) {
|
|
898
|
+
this.mc.logger.sendTelemetryEvent({
|
|
899
|
+
eventName: "GC_DeletingLoadedDataStore",
|
|
900
|
+
...tagCodeArtifacts({
|
|
901
|
+
id: dataStoreId,
|
|
902
|
+
pkg: dataStoreContext.packagePath.join("/"),
|
|
903
|
+
}),
|
|
904
|
+
});
|
|
905
|
+
}
|
|
847
906
|
dataStoreContext.delete();
|
|
848
907
|
// Delete the contexts of unused data stores.
|
|
849
908
|
this.contexts.delete(dataStoreId);
|
|
@@ -970,21 +1029,25 @@ export class ChannelCollection {
|
|
|
970
1029
|
if (typeof request.headers?.[AllowInactiveRequestHeaderKey] === "boolean") {
|
|
971
1030
|
headerData.allowInactive = request.headers[AllowInactiveRequestHeaderKey];
|
|
972
1031
|
}
|
|
973
|
-
// We allow Tombstone requests for sub-DataStore objects
|
|
1032
|
+
// We allow Tombstone/Inactive requests for sub-DataStore objects
|
|
974
1033
|
if (requestForChild) {
|
|
975
1034
|
headerData.allowTombstone = true;
|
|
1035
|
+
headerData.allowInactive = true;
|
|
976
1036
|
}
|
|
977
1037
|
await this.waitIfPendingAlias(id);
|
|
978
1038
|
const internalId = this.internalId(id);
|
|
979
|
-
const dataStoreContext = await this.getDataStore(internalId, headerData);
|
|
980
|
-
// Remove query params, leading and trailing slashes from the url. This is done to make sure the format is
|
|
981
|
-
// the same as GC nodes id.
|
|
982
|
-
const urlWithoutQuery = trimLeadingAndTrailingSlashes(request.url.split("?")[0]);
|
|
1039
|
+
const dataStoreContext = await this.getDataStore(internalId, headerData, request);
|
|
983
1040
|
// Get the initial snapshot details which contain the data store package path.
|
|
984
1041
|
const details = await dataStoreContext.getInitialSnapshotDetails();
|
|
985
|
-
//
|
|
986
|
-
// is
|
|
987
|
-
this.gcNodeUpdated(
|
|
1042
|
+
// When notifying GC of this node being loaded, we only indicate the DataStore itself, not the full subDataStore url if applicable.
|
|
1043
|
+
// This is in case the url is to a route that Fluid doesn't understand or track for GC (e.g. if suited for a custom request handler)
|
|
1044
|
+
this.gcNodeUpdated({
|
|
1045
|
+
node: { type: "DataStore", path: `/${id}` },
|
|
1046
|
+
reason: "Loaded",
|
|
1047
|
+
packagePath: details.pkg,
|
|
1048
|
+
request,
|
|
1049
|
+
headerData,
|
|
1050
|
+
});
|
|
988
1051
|
const dataStore = await dataStoreContext.realize();
|
|
989
1052
|
const subRequest = requestParser.createSubRequest(1);
|
|
990
1053
|
// We always expect createSubRequest to include a leading slash, but asserting here to protect against
|