@fluidframework/container-runtime 2.0.0-internal.3.0.5 → 2.0.0-internal.3.1.1
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.js +19 -19
- package/.mocharc.js +2 -2
- package/api-extractor.json +2 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +2 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +9 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +80 -33
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +11 -9
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +3 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +11 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +116 -72
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +11 -9
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +18 -13
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +68 -55
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -3
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +3 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +26 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +103 -18
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +8 -3
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/garbageCollection.d.ts +33 -14
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +178 -92
- package/dist/garbageCollection.js.map +1 -1
- package/dist/garbageCollectionConstants.d.ts +1 -0
- package/dist/garbageCollectionConstants.d.ts.map +1 -1
- package/dist/garbageCollectionConstants.js +4 -1
- package/dist/garbageCollectionConstants.js.map +1 -1
- package/dist/garbageCollectionHelpers.d.ts +26 -0
- package/dist/garbageCollectionHelpers.d.ts.map +1 -0
- package/dist/garbageCollectionHelpers.js +45 -0
- package/dist/garbageCollectionHelpers.js.map +1 -0
- package/dist/gcSweepReadyUsageDetection.d.ts +5 -5
- package/dist/gcSweepReadyUsageDetection.d.ts.map +1 -1
- package/dist/gcSweepReadyUsageDetection.js +14 -10
- package/dist/gcSweepReadyUsageDetection.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +5 -5
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +19 -12
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +0 -4
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +7 -43
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +4 -1
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +20 -19
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.d.ts.map +1 -1
- package/dist/opProperties.js +1 -3
- package/dist/opProperties.js.map +1 -1
- package/dist/orderedClientElection.d.ts.map +1 -1
- package/dist/orderedClientElection.js +10 -4
- package/dist/orderedClientElection.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 +7 -0
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +7 -4
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/runningSummarizer.d.ts.map +1 -1
- package/dist/runningSummarizer.js +34 -21
- package/dist/runningSummarizer.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +3 -2
- package/dist/scheduleManager.js.map +1 -1
- package/dist/serializedSnapshotStorage.d.ts +2 -2
- package/dist/serializedSnapshotStorage.d.ts.map +1 -1
- package/dist/serializedSnapshotStorage.js +5 -3
- package/dist/serializedSnapshotStorage.js.map +1 -1
- package/dist/summarizer.d.ts +2 -2
- package/dist/summarizer.d.ts.map +1 -1
- package/dist/summarizer.js +37 -17
- package/dist/summarizer.js.map +1 -1
- package/dist/summarizerClientElection.d.ts.map +1 -1
- package/dist/summarizerClientElection.js.map +1 -1
- package/dist/summarizerHandle.d.ts.map +1 -1
- package/dist/summarizerHandle.js.map +1 -1
- package/dist/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summarizerHeuristics.js +6 -9
- package/dist/summarizerHeuristics.js.map +1 -1
- package/dist/summarizerTypes.d.ts +21 -21
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryCollection.d.ts.map +1 -1
- package/dist/summaryCollection.js +18 -8
- package/dist/summaryCollection.js.map +1 -1
- package/dist/summaryFormat.d.ts +5 -2
- package/dist/summaryFormat.d.ts.map +1 -1
- package/dist/summaryFormat.js +18 -10
- package/dist/summaryFormat.js.map +1 -1
- package/dist/summaryGenerator.d.ts.map +1 -1
- package/dist/summaryGenerator.js +35 -16
- package/dist/summaryGenerator.js.map +1 -1
- package/dist/summaryManager.d.ts.map +1 -1
- package/dist/summaryManager.js +21 -9
- package/dist/summaryManager.js.map +1 -1
- package/dist/throttler.d.ts +2 -2
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +4 -4
- package/dist/throttler.js.map +1 -1
- package/garbageCollection.md +15 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +9 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +82 -35
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +11 -9
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +3 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +11 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +122 -78
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +11 -9
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +18 -13
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +71 -58
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -3
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +3 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +26 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +109 -24
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +9 -4
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/garbageCollection.d.ts +33 -14
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +180 -94
- package/lib/garbageCollection.js.map +1 -1
- package/lib/garbageCollectionConstants.d.ts +1 -0
- package/lib/garbageCollectionConstants.d.ts.map +1 -1
- package/lib/garbageCollectionConstants.js +3 -0
- package/lib/garbageCollectionConstants.js.map +1 -1
- package/lib/garbageCollectionHelpers.d.ts +26 -0
- package/lib/garbageCollectionHelpers.d.ts.map +1 -0
- package/lib/garbageCollectionHelpers.js +40 -0
- package/lib/garbageCollectionHelpers.js.map +1 -0
- package/lib/gcSweepReadyUsageDetection.d.ts +5 -5
- package/lib/gcSweepReadyUsageDetection.d.ts.map +1 -1
- package/lib/gcSweepReadyUsageDetection.js +14 -10
- package/lib/gcSweepReadyUsageDetection.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +5 -5
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +19 -12
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +0 -4
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +7 -43
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +5 -2
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +20 -19
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.d.ts.map +1 -1
- package/lib/opProperties.js +1 -3
- package/lib/opProperties.js.map +1 -1
- package/lib/orderedClientElection.d.ts.map +1 -1
- package/lib/orderedClientElection.js +10 -4
- package/lib/orderedClientElection.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 +7 -0
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +7 -4
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/runningSummarizer.d.ts.map +1 -1
- package/lib/runningSummarizer.js +35 -22
- package/lib/runningSummarizer.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +3 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/serializedSnapshotStorage.d.ts +2 -2
- package/lib/serializedSnapshotStorage.d.ts.map +1 -1
- package/lib/serializedSnapshotStorage.js +5 -3
- package/lib/serializedSnapshotStorage.js.map +1 -1
- package/lib/summarizer.d.ts +2 -2
- package/lib/summarizer.d.ts.map +1 -1
- package/lib/summarizer.js +37 -17
- package/lib/summarizer.js.map +1 -1
- package/lib/summarizerClientElection.d.ts.map +1 -1
- package/lib/summarizerClientElection.js.map +1 -1
- package/lib/summarizerHandle.d.ts.map +1 -1
- package/lib/summarizerHandle.js.map +1 -1
- package/lib/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summarizerHeuristics.js +6 -9
- package/lib/summarizerHeuristics.js.map +1 -1
- package/lib/summarizerTypes.d.ts +21 -21
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryCollection.d.ts.map +1 -1
- package/lib/summaryCollection.js +18 -8
- package/lib/summaryCollection.js.map +1 -1
- package/lib/summaryFormat.d.ts +5 -2
- package/lib/summaryFormat.d.ts.map +1 -1
- package/lib/summaryFormat.js +20 -12
- package/lib/summaryFormat.js.map +1 -1
- package/lib/summaryGenerator.d.ts.map +1 -1
- package/lib/summaryGenerator.js +35 -16
- package/lib/summaryGenerator.js.map +1 -1
- package/lib/summaryManager.d.ts.map +1 -1
- package/lib/summaryManager.js +21 -9
- package/lib/summaryManager.js.map +1 -1
- package/lib/throttler.d.ts +2 -2
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +4 -4
- package/lib/throttler.js.map +1 -1
- package/package.json +121 -115
- package/prettier.config.cjs +1 -1
- package/src/batchTracker.ts +54 -49
- package/src/blobManager.ts +793 -672
- package/src/connectionTelemetry.ts +280 -249
- package/src/containerHandleContext.ts +27 -29
- package/src/containerRuntime.ts +3168 -2988
- package/src/dataStore.ts +172 -159
- package/src/dataStoreContext.ts +1098 -1055
- package/src/dataStoreContexts.ts +178 -161
- package/src/dataStoreRegistry.ts +25 -20
- package/src/dataStores.ts +884 -728
- package/src/deltaScheduler.ts +158 -150
- package/src/garbageCollection.ts +1860 -1688
- package/src/garbageCollectionConstants.ts +3 -0
- package/src/garbageCollectionHelpers.ts +61 -0
- package/src/gcSweepReadyUsageDetection.ts +89 -83
- package/src/index.ts +67 -66
- package/src/opLifecycle/README.md +152 -0
- package/src/opLifecycle/batchManager.ts +145 -141
- package/src/opLifecycle/definitions.ts +29 -29
- package/src/opLifecycle/index.ts +5 -5
- package/src/opLifecycle/opCompressor.ts +54 -53
- package/src/opLifecycle/opDecompressor.ts +100 -128
- package/src/opLifecycle/opSplitter.ts +214 -188
- package/src/opLifecycle/outbox.ts +204 -195
- package/src/opLifecycle/remoteMessageProcessor.ts +62 -62
- package/src/opProperties.ts +11 -9
- package/src/orderedClientElection.ts +489 -457
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +384 -338
- package/src/runWhileConnectedCoordinator.ts +78 -71
- package/src/runningSummarizer.ts +619 -581
- package/src/scheduleManager.ts +299 -269
- package/src/serializedSnapshotStorage.ts +126 -112
- package/src/summarizer.ts +417 -381
- package/src/summarizerClientElection.ts +107 -100
- package/src/summarizerHandle.ts +11 -9
- package/src/summarizerHeuristics.ts +183 -186
- package/src/summarizerTypes.ts +344 -330
- package/src/summaryCollection.ts +378 -349
- package/src/summaryFormat.ts +165 -143
- package/src/summaryGenerator.ts +465 -410
- package/src/summaryManager.ts +377 -348
- package/src/throttler.ts +131 -122
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
- package/dist/garbageCollectionTombstoneUtils.d.ts +0 -14
- package/dist/garbageCollectionTombstoneUtils.d.ts.map +0 -1
- package/dist/garbageCollectionTombstoneUtils.js +0 -23
- package/dist/garbageCollectionTombstoneUtils.js.map +0 -1
- package/lib/garbageCollectionTombstoneUtils.d.ts +0 -14
- package/lib/garbageCollectionTombstoneUtils.d.ts.map +0 -1
- package/lib/garbageCollectionTombstoneUtils.js +0 -19
- package/lib/garbageCollectionTombstoneUtils.js.map +0 -1
- package/src/garbageCollectionTombstoneUtils.ts +0 -28
package/dist/containerRuntime.js
CHANGED
|
@@ -33,6 +33,8 @@ const batchTracker_1 = require("./batchTracker");
|
|
|
33
33
|
const serializedSnapshotStorage_1 = require("./serializedSnapshotStorage");
|
|
34
34
|
const scheduleManager_1 = require("./scheduleManager");
|
|
35
35
|
const opLifecycle_1 = require("./opLifecycle");
|
|
36
|
+
const garbageCollectionHelpers_1 = require("./garbageCollectionHelpers");
|
|
37
|
+
const garbageCollectionConstants_1 = require("./garbageCollectionConstants");
|
|
36
38
|
var ContainerMessageType;
|
|
37
39
|
(function (ContainerMessageType) {
|
|
38
40
|
// An op to be delivered to store
|
|
@@ -138,8 +140,7 @@ function getDeviceSpec() {
|
|
|
138
140
|
};
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
catch (_a) {
|
|
142
|
-
}
|
|
143
|
+
catch (_a) { }
|
|
143
144
|
return {};
|
|
144
145
|
}
|
|
145
146
|
exports.getDeviceSpec = getDeviceSpec;
|
|
@@ -152,7 +153,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
152
153
|
* @internal
|
|
153
154
|
*/
|
|
154
155
|
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, requestHandler, summaryConfiguration) {
|
|
155
|
-
var _a, _b, _c, _d, _e, _f;
|
|
156
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
156
157
|
if (summaryConfiguration === void 0) { summaryConfiguration = Object.assign(Object.assign({}, exports.DefaultSummaryConfiguration), (_a = runtimeOptions.summaryOptions) === null || _a === void 0 ? void 0 : _a.summaryConfigOverrides); }
|
|
157
158
|
super();
|
|
158
159
|
this.context = context;
|
|
@@ -235,28 +236,39 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
235
236
|
this.nextSummaryNumber = loadSummaryNumber + 1;
|
|
236
237
|
this.messageAtLastSummary = metadata === null || metadata === void 0 ? void 0 : metadata.message;
|
|
237
238
|
this._connected = this.context.connected;
|
|
239
|
+
this.gcTombstoneEnforcementAllowed = (0, garbageCollectionHelpers_1.shouldAllowGcTombstoneEnforcement)((_c = metadata === null || metadata === void 0 ? void 0 : metadata.gcFeatureMatrix) === null || _c === void 0 ? void 0 : _c.tombstoneGeneration /* persisted */, this.runtimeOptions.gcOptions[garbageCollectionConstants_1.gcTombstoneGenerationOptionName] /* current */);
|
|
238
240
|
this.mc = (0, telemetry_utils_1.loggerToMonitoringContext)(telemetry_utils_1.ChildLogger.create(this.logger, "ContainerRuntime"));
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
this.mc.logger.sendTelemetryEvent({
|
|
242
|
+
eventName: "GCFeatureMatrix",
|
|
243
|
+
metadataValue: JSON.stringify(metadata === null || metadata === void 0 ? void 0 : metadata.gcFeatureMatrix),
|
|
244
|
+
inputs: JSON.stringify({
|
|
245
|
+
gcOptions_gcTombstoneGeneration: this.runtimeOptions.gcOptions[garbageCollectionConstants_1.gcTombstoneGenerationOptionName],
|
|
246
|
+
}),
|
|
247
|
+
});
|
|
248
|
+
const opSplitter = new opLifecycle_1.OpSplitter(chunks, this.context.submitBatchFn, this.mc.config.getBoolean("Fluid.ContainerRuntime.DisableCompressionChunking") === true
|
|
249
|
+
? Number.POSITIVE_INFINITY
|
|
250
|
+
: runtimeOptions.chunkSizeInBytes, runtimeOptions.maxBatchSizeInBytes, this.mc.logger);
|
|
251
|
+
this.remoteMessageProcessor = new opLifecycle_1.RemoteMessageProcessor(opSplitter, new opLifecycle_1.OpDecompressor());
|
|
242
252
|
this.handleContext = new containerHandleContext_1.ContainerFluidHandleContext("", this);
|
|
243
253
|
if (this.summaryConfiguration.state === "enabled") {
|
|
244
254
|
this.validateSummaryHeuristicConfiguration(this.summaryConfiguration);
|
|
245
255
|
}
|
|
246
|
-
this.enableOpReentryCheck =
|
|
247
|
-
|
|
248
|
-
|
|
256
|
+
this.enableOpReentryCheck =
|
|
257
|
+
runtimeOptions.enableOpReentryCheck === true &&
|
|
258
|
+
// Allow for a break-glass config to override the options
|
|
259
|
+
this.mc.config.getBoolean("Fluid.ContainerRuntime.DisableOpReentryCheck") !== true;
|
|
249
260
|
this.summariesDisabled = this.isSummariesDisabled();
|
|
250
261
|
this.heuristicsDisabled = this.isHeuristicsDisabled();
|
|
251
262
|
this.maxOpsSinceLastSummary = this.getMaxOpsSinceLastSummary();
|
|
252
263
|
this.initialSummarizerDelayMs = this.getInitialSummarizerDelayMs();
|
|
253
264
|
this.maxConsecutiveReconnects =
|
|
254
|
-
(
|
|
265
|
+
(_d = this.mc.config.getNumber(maxConsecutiveReconnectsKey)) !== null && _d !== void 0 ? _d : this.defaultMaxConsecutiveReconnects;
|
|
255
266
|
this._flushMode = runtimeOptions.flushMode;
|
|
256
267
|
const pendingRuntimeState = context.pendingLocalState;
|
|
257
|
-
const baseSnapshot = (
|
|
258
|
-
const maxSnapshotCacheDurationMs = (
|
|
259
|
-
if (maxSnapshotCacheDurationMs !== undefined &&
|
|
268
|
+
const baseSnapshot = (_e = pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.baseSnapshot) !== null && _e !== void 0 ? _e : context.baseSnapshot;
|
|
269
|
+
const maxSnapshotCacheDurationMs = (_g = (_f = this._storage) === null || _f === void 0 ? void 0 : _f.policies) === null || _g === void 0 ? void 0 : _g.maximumCacheDurationMs;
|
|
270
|
+
if (maxSnapshotCacheDurationMs !== undefined &&
|
|
271
|
+
maxSnapshotCacheDurationMs > 5 * 24 * 60 * 60 * 1000) {
|
|
260
272
|
// This is a runtime enforcement of what's already explicit in the policy's type itself,
|
|
261
273
|
// which dictates the value is either undefined or exactly 5 days in ms.
|
|
262
274
|
// As long as the actual value is less than 5 days, the assumptions GC makes here are valid.
|
|
@@ -301,12 +313,15 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
301
313
|
if (baseSnapshot) {
|
|
302
314
|
this.summarizerNode.updateBaseSummaryState(baseSnapshot);
|
|
303
315
|
}
|
|
304
|
-
this.dataStores = new dataStores_1.DataStores((0, dataStores_1.getSummaryForDatastores)(baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn, getBaseGCDetailsFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn, getBaseGCDetailsFn), (id) => this.summarizerNode.deleteChild(id), this.mc.logger, async () => this.garbageCollector.getBaseGCDetails(), (path, timestampMs, packagePath) => this.garbageCollector.nodeUpdated(path, "Changed", timestampMs, packagePath), new Map(dataStoreAliasMap));
|
|
316
|
+
this.dataStores = new dataStores_1.DataStores((0, dataStores_1.getSummaryForDatastores)(baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn, getBaseGCDetailsFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn, getBaseGCDetailsFn), (id) => this.summarizerNode.deleteChild(id), this.mc.logger, async () => this.garbageCollector.getBaseGCDetails(), (path, timestampMs, packagePath) => this.garbageCollector.nodeUpdated(path, "Changed", timestampMs, packagePath), (path) => this.garbageCollector.isNodeDeleted(path), new Map(dataStoreAliasMap));
|
|
305
317
|
this.blobManager = new blobManager_1.BlobManager(this.handleContext, blobManagerSnapshot, () => this.storage, (localId, blobId) => {
|
|
306
318
|
if (!this.disposed) {
|
|
307
|
-
this.submit(ContainerMessageType.BlobAttach, undefined, undefined, {
|
|
319
|
+
this.submit(ContainerMessageType.BlobAttach, undefined, undefined, {
|
|
320
|
+
localId,
|
|
321
|
+
blobId,
|
|
322
|
+
});
|
|
308
323
|
}
|
|
309
|
-
}, (blobPath) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"), (fromPath, toPath) => this.garbageCollector.addedOutboundReference(fromPath, toPath), this, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pendingAttachmentBlobs, () => this.getCurrentReferenceTimestampMs());
|
|
324
|
+
}, (blobPath) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"), (fromPath, toPath) => this.garbageCollector.addedOutboundReference(fromPath, toPath), (blobPath) => this.garbageCollector.isNodeDeleted(blobPath), this, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pendingAttachmentBlobs, () => this.getCurrentReferenceTimestampMs());
|
|
310
325
|
this.scheduleManager = new scheduleManager_1.ScheduleManager(context.deltaManager, this, () => this.clientId, telemetry_utils_1.ChildLogger.create(this.logger, "ScheduleManager"));
|
|
311
326
|
this.pendingStateManager = new pendingStateManager_1.PendingStateManager({
|
|
312
327
|
applyStashedOp: this.applyStashedOp.bind(this),
|
|
@@ -317,11 +332,12 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
317
332
|
rollback: this.rollback.bind(this),
|
|
318
333
|
orderSequentially: this.orderSequentially.bind(this),
|
|
319
334
|
}, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pending);
|
|
320
|
-
const compressionOptions = this.mc.config.getBoolean("Fluid.ContainerRuntime.DisableCompression") === true
|
|
321
|
-
{
|
|
335
|
+
const compressionOptions = this.mc.config.getBoolean("Fluid.ContainerRuntime.DisableCompression") === true
|
|
336
|
+
? {
|
|
322
337
|
minimumBatchSizeInBytes: Number.POSITIVE_INFINITY,
|
|
323
|
-
compressionAlgorithm: CompressionAlgorithms.lz4
|
|
324
|
-
}
|
|
338
|
+
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
339
|
+
}
|
|
340
|
+
: runtimeOptions.compressionOptions;
|
|
325
341
|
this.outbox = new opLifecycle_1.Outbox({
|
|
326
342
|
shouldSend: () => this.canSendOps(),
|
|
327
343
|
pendingStateManager: this.pendingStateManager,
|
|
@@ -339,8 +355,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
339
355
|
this.remoteMessageProcessor.clearPartialMessagesFor(clientId);
|
|
340
356
|
});
|
|
341
357
|
this.summaryCollection = new summaryCollection_1.SummaryCollection(this.deltaManager, this.logger);
|
|
342
|
-
this.dirtyContainer =
|
|
343
|
-
|
|
358
|
+
this.dirtyContainer =
|
|
359
|
+
this.context.attachState !== container_definitions_1.AttachState.Attached ||
|
|
360
|
+
this.pendingStateManager.hasPendingMessages();
|
|
344
361
|
this.context.updateDirtyContainerState(this.dirtyContainer);
|
|
345
362
|
if (this.summariesDisabled) {
|
|
346
363
|
this.mc.logger.sendTelemetryEvent({ eventName: "SummariesDisabled" });
|
|
@@ -408,8 +425,12 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
408
425
|
(0, connectionTelemetry_1.ReportOpPerfTelemetry)(this.context.clientId, this.deltaManager, this.logger);
|
|
409
426
|
(0, batchTracker_1.BindBatchTracker)(this, this.logger);
|
|
410
427
|
}
|
|
411
|
-
get IContainerRuntime() {
|
|
412
|
-
|
|
428
|
+
get IContainerRuntime() {
|
|
429
|
+
return this;
|
|
430
|
+
}
|
|
431
|
+
get IFluidRouter() {
|
|
432
|
+
return this;
|
|
433
|
+
}
|
|
413
434
|
/**
|
|
414
435
|
* @deprecated - use loadRuntime instead.
|
|
415
436
|
* Load the stores from a snapshot and returns the runtime.
|
|
@@ -450,7 +471,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
450
471
|
*/
|
|
451
472
|
static async loadRuntime(params) {
|
|
452
473
|
var _a, _b, _c, _d;
|
|
453
|
-
const { context, registryEntries, existing, requestHandler, runtimeOptions = {}, containerScope = {}, containerRuntimeCtor = ContainerRuntime } = params;
|
|
474
|
+
const { context, registryEntries, existing, requestHandler, runtimeOptions = {}, containerScope = {}, containerRuntimeCtor = ContainerRuntime, } = params;
|
|
454
475
|
// If taggedLogger exists, use it. Otherwise, wrap the vanilla logger:
|
|
455
476
|
// back-compat: Remove the TaggedLoggerAdapter fallback once all the host are using loader > 0.45
|
|
456
477
|
const backCompatContext = context;
|
|
@@ -462,13 +483,15 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
462
483
|
});
|
|
463
484
|
const { summaryOptions = {}, gcOptions = {}, loadSequenceNumberVerification = "close", flushMode = defaultFlushMode, enableOfflineLoad = false, compressionOptions = {
|
|
464
485
|
minimumBatchSizeInBytes: Number.POSITIVE_INFINITY,
|
|
465
|
-
compressionAlgorithm: CompressionAlgorithms.lz4
|
|
486
|
+
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
466
487
|
}, maxBatchSizeInBytes = defaultMaxBatchSizeInBytes, chunkSizeInBytes = Number.POSITIVE_INFINITY, enableOpReentryCheck = false, } = runtimeOptions;
|
|
467
488
|
const pendingRuntimeState = context.pendingLocalState;
|
|
468
489
|
const baseSnapshot = (_b = pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.baseSnapshot) !== null && _b !== void 0 ? _b : context.baseSnapshot;
|
|
469
|
-
const storage = !pendingRuntimeState
|
|
470
|
-
context.storage
|
|
471
|
-
new serializedSnapshotStorage_1.SerializedSnapshotStorage(() => {
|
|
490
|
+
const storage = !pendingRuntimeState
|
|
491
|
+
? context.storage
|
|
492
|
+
: new serializedSnapshotStorage_1.SerializedSnapshotStorage(() => {
|
|
493
|
+
return context.storage;
|
|
494
|
+
}, pendingRuntimeState.snapshotBlobs);
|
|
472
495
|
const registry = new dataStoreRegistry_1.FluidDataStoreRegistry(registryEntries);
|
|
473
496
|
const tryFetchBlob = async (blobName) => {
|
|
474
497
|
const blobId = baseSnapshot === null || baseSnapshot === void 0 ? void 0 : baseSnapshot.blobs[blobName];
|
|
@@ -499,7 +522,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
499
522
|
if (!pendingRuntimeState && runtimeSequenceNumber !== undefined) {
|
|
500
523
|
const protocolSequenceNumber = context.deltaManager.initialSequenceNumber;
|
|
501
524
|
// Unless bypass is explicitly set, then take action when sequence numbers mismatch.
|
|
502
|
-
if (loadSequenceNumberVerification !== "bypass" &&
|
|
525
|
+
if (loadSequenceNumberVerification !== "bypass" &&
|
|
526
|
+
runtimeSequenceNumber !== protocolSequenceNumber) {
|
|
503
527
|
// "Load from summary, runtime metadata sequenceNumber !== initialSequenceNumber"
|
|
504
528
|
const error = new container_utils_1.DataCorruptionError(
|
|
505
529
|
// pre-0.58 error message: SummaryMetadataMismatch
|
|
@@ -606,7 +630,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
606
630
|
var _a;
|
|
607
631
|
return (_a = this.summarizerClientElection) === null || _a === void 0 ? void 0 : _a.electedClientId;
|
|
608
632
|
}
|
|
609
|
-
get disposed() {
|
|
633
|
+
get disposed() {
|
|
634
|
+
return this._disposed;
|
|
635
|
+
}
|
|
610
636
|
get summarizer() {
|
|
611
637
|
(0, common_utils_1.assert)(this._summarizer !== undefined, 0x257 /* "This is not summarizing container" */);
|
|
612
638
|
return this._summarizer;
|
|
@@ -716,7 +742,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
716
742
|
status: 200,
|
|
717
743
|
mimeType: "fluid/object",
|
|
718
744
|
value: blob,
|
|
719
|
-
}
|
|
745
|
+
}
|
|
746
|
+
: (0, runtime_utils_1.create404Response)(request);
|
|
720
747
|
}
|
|
721
748
|
else if (requestParser.pathParts.length > 0) {
|
|
722
749
|
const dataStore = await this.getDataStoreFromRequest(id, request);
|
|
@@ -759,7 +786,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
759
786
|
* This is a workaround to handle scenarios where a data store shared with an external app is deleted
|
|
760
787
|
* and marked as unreferenced by GC. Returning an error will fail to load the data store for the app.
|
|
761
788
|
*/
|
|
762
|
-
if (((_d = request.headers) === null || _d === void 0 ? void 0 : _d[RuntimeHeaders.externalRequest]) &&
|
|
789
|
+
if (((_d = request.headers) === null || _d === void 0 ? void 0 : _d[RuntimeHeaders.externalRequest]) &&
|
|
790
|
+
this.garbageCollector.shouldRunGC) {
|
|
763
791
|
// The data store is referenced if used routes in the base summary has a route to self.
|
|
764
792
|
// Older documents may not have used routes in the summary. They are considered referenced.
|
|
765
793
|
const usedRoutes = (await dataStoreContext.getBaseGCDetails()).usedRoutes;
|
|
@@ -933,7 +961,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
933
961
|
if (reconnection) {
|
|
934
962
|
this.consecutiveReconnects++;
|
|
935
963
|
if (!this.shouldContinueReconnecting()) {
|
|
936
|
-
this.closeFn(container_utils_1.DataProcessingError.create("Runtime detected too many reconnects with no progress syncing local ops.
|
|
964
|
+
this.closeFn(container_utils_1.DataProcessingError.create("Runtime detected too many reconnects with no progress syncing local ops.", "setConnectionState", undefined, {
|
|
937
965
|
dataLoss: 1,
|
|
938
966
|
attempts: this.consecutiveReconnects,
|
|
939
967
|
pendingMessages: this.pendingStateManager.pendingMessagesCount,
|
|
@@ -949,7 +977,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
949
977
|
(0, telemetry_utils_1.raiseConnectedEvent)(this.mc.logger, this, connected, clientId);
|
|
950
978
|
}
|
|
951
979
|
process(messageArg, local) {
|
|
952
|
-
var _a
|
|
980
|
+
var _a;
|
|
953
981
|
this.verifyNotClosed();
|
|
954
982
|
if ((_a = this.mc.config.getBoolean("enableOfflineLoad")) !== null && _a !== void 0 ? _a : this.runtimeOptions.enableOfflineLoad) {
|
|
955
983
|
this.savedOps.push(messageArg);
|
|
@@ -993,19 +1021,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
993
1021
|
case ContainerMessageType.Rejoin:
|
|
994
1022
|
break;
|
|
995
1023
|
default:
|
|
996
|
-
|
|
997
|
-
const error = container_utils_1.DataProcessingError.create(
|
|
998
|
-
// Former assert 0x3ce
|
|
999
|
-
"Runtime message of unknown type", "OpProcessing", message, {
|
|
1000
|
-
local,
|
|
1001
|
-
type: message.type,
|
|
1002
|
-
contentType: typeof message.contents,
|
|
1003
|
-
batch: (_b = message.metadata) === null || _b === void 0 ? void 0 : _b.batch,
|
|
1004
|
-
compression: message.compression,
|
|
1005
|
-
});
|
|
1006
|
-
this.closeFn(error);
|
|
1007
|
-
throw error;
|
|
1008
|
-
}
|
|
1024
|
+
(0, common_utils_1.assert)(!runtimeMessage, 0x3ce /* Runtime message of unknown type */);
|
|
1009
1025
|
}
|
|
1010
1026
|
// For back-compat, notify only about runtime messages for now.
|
|
1011
1027
|
if (runtimeMessage) {
|
|
@@ -1052,7 +1068,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1052
1068
|
if (message.clientId === this.clientId && this.connected) {
|
|
1053
1069
|
// Check to see if the signal was lost.
|
|
1054
1070
|
if (this._perfSignalData.trackingSignalSequenceNumber !== undefined &&
|
|
1055
|
-
envelope.clientSignalSequenceNumber >
|
|
1071
|
+
envelope.clientSignalSequenceNumber >
|
|
1072
|
+
this._perfSignalData.trackingSignalSequenceNumber) {
|
|
1056
1073
|
this._perfSignalData.signalsLost++;
|
|
1057
1074
|
this._perfSignalData.trackingSignalSequenceNumber = undefined;
|
|
1058
1075
|
this.logger.sendErrorEvent({
|
|
@@ -1063,7 +1080,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1063
1080
|
clientSignalSequenceNumber: envelope.clientSignalSequenceNumber,
|
|
1064
1081
|
});
|
|
1065
1082
|
}
|
|
1066
|
-
else if (envelope.clientSignalSequenceNumber ===
|
|
1083
|
+
else if (envelope.clientSignalSequenceNumber ===
|
|
1084
|
+
this._perfSignalData.trackingSignalSequenceNumber) {
|
|
1067
1085
|
this.sendSignalTelemetryEvent(envelope.clientSignalSequenceNumber);
|
|
1068
1086
|
this._perfSignalData.trackingSignalSequenceNumber = undefined;
|
|
1069
1087
|
}
|
|
@@ -1150,7 +1168,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1150
1168
|
return this.dataStores.createDetachedDataStoreCore(pkg, false);
|
|
1151
1169
|
}
|
|
1152
1170
|
async _createDataStoreWithProps(pkg, props, id = (0, uuid_1.v4)()) {
|
|
1153
|
-
const fluidDataStore = await this.dataStores
|
|
1171
|
+
const fluidDataStore = await this.dataStores
|
|
1172
|
+
._createFluidDataStoreContext(Array.isArray(pkg) ? pkg : [pkg], id, props)
|
|
1173
|
+
.realize();
|
|
1154
1174
|
return (0, dataStore_1.channelToDataStore)(fluidDataStore, id, this, this.dataStores, this.mc.logger);
|
|
1155
1175
|
}
|
|
1156
1176
|
async _createDataStore(pkg, id = (0, uuid_1.v4)(), props) {
|
|
@@ -1281,21 +1301,16 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1281
1301
|
async summarize(options) {
|
|
1282
1302
|
this.verifyNotClosed();
|
|
1283
1303
|
const { fullTree = false, trackState = true, summaryLogger = this.mc.logger, runGC = this.garbageCollector.shouldRunGC, runSweep, fullGC, } = options;
|
|
1284
|
-
const telemetryContext = new runtime_utils_1.TelemetryContext();
|
|
1285
|
-
// Add the options that are used to generate this summary to the telemetry context.
|
|
1286
|
-
telemetryContext.setAll("fluid_Summarize", "Options", {
|
|
1287
|
-
fullTree,
|
|
1288
|
-
trackState,
|
|
1289
|
-
runGC,
|
|
1290
|
-
fullGC,
|
|
1291
|
-
runSweep,
|
|
1292
|
-
});
|
|
1293
1304
|
let gcStats;
|
|
1294
1305
|
if (runGC) {
|
|
1295
|
-
gcStats = await this.collectGarbage({ logger: summaryLogger, runSweep, fullGC }
|
|
1306
|
+
gcStats = await this.collectGarbage({ logger: summaryLogger, runSweep, fullGC });
|
|
1296
1307
|
}
|
|
1308
|
+
const telemetryContext = new runtime_utils_1.TelemetryContext();
|
|
1297
1309
|
const { stats, summary } = await this.summarizerNode.summarize(fullTree, trackState, telemetryContext);
|
|
1298
|
-
this.logger.sendTelemetryEvent({
|
|
1310
|
+
this.logger.sendTelemetryEvent({
|
|
1311
|
+
eventName: "SummarizeTelemetry",
|
|
1312
|
+
details: telemetryContext.serialize(),
|
|
1313
|
+
});
|
|
1299
1314
|
(0, common_utils_1.assert)(summary.type === protocol_definitions_1.SummaryType.Tree, 0x12f /* "Container Runtime's summarize should always return a tree" */);
|
|
1300
1315
|
return { stats, summary, gcStats };
|
|
1301
1316
|
}
|
|
@@ -1346,6 +1361,18 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1346
1361
|
this.blobManager.updateUnusedRoutes(blobManagerRoutes);
|
|
1347
1362
|
this.dataStores.updateUnusedRoutes(dataStoreRoutes);
|
|
1348
1363
|
}
|
|
1364
|
+
/**
|
|
1365
|
+
* This is called to delete objects from the runtime
|
|
1366
|
+
* @param unusedRoutes - object routes and sub routes that can be deleted
|
|
1367
|
+
* @returns - routes of objects deleted from the runtime
|
|
1368
|
+
*/
|
|
1369
|
+
deleteUnusedNodes(unusedRoutes) {
|
|
1370
|
+
const { dataStoreRoutes } = this.getDataStoreAndBlobManagerRoutes(unusedRoutes);
|
|
1371
|
+
const deletedRoutes = [];
|
|
1372
|
+
const deletedDataStoreRoutes = this.dataStores.deleteUnusedNodes(dataStoreRoutes);
|
|
1373
|
+
deletedRoutes.push(...deletedDataStoreRoutes);
|
|
1374
|
+
return deletedRoutes;
|
|
1375
|
+
}
|
|
1349
1376
|
/**
|
|
1350
1377
|
* This is called to update objects that are tombstones.
|
|
1351
1378
|
* @param tombstonedRoutes - Data store and attachment blob routes that are tombstones in this Container.
|
|
@@ -1423,8 +1450,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1423
1450
|
* Runs garbage collection and updates the reference / used state of the nodes in the container.
|
|
1424
1451
|
* @returns the statistics of the garbage collection run; undefined if GC did not run.
|
|
1425
1452
|
*/
|
|
1426
|
-
async collectGarbage(options
|
|
1427
|
-
return this.garbageCollector.collectGarbage(options
|
|
1453
|
+
async collectGarbage(options) {
|
|
1454
|
+
return this.garbageCollector.collectGarbage(options);
|
|
1428
1455
|
}
|
|
1429
1456
|
/**
|
|
1430
1457
|
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
@@ -1461,8 +1488,12 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1461
1488
|
// We might need to catch up to the latest summary's reference sequence number before pausing.
|
|
1462
1489
|
await this.waitForDeltaManagerToCatchup(latestSnapshotRefSeq, summaryNumberLogger);
|
|
1463
1490
|
}
|
|
1491
|
+
const shouldPauseInboundSignal = this.mc.config.getBoolean("Fluid.ContainerRuntime.SubmitSummary.disableInboundSignalPause") !== true;
|
|
1464
1492
|
try {
|
|
1465
1493
|
await this.deltaManager.inbound.pause();
|
|
1494
|
+
if (shouldPauseInboundSignal) {
|
|
1495
|
+
await this.deltaManager.inboundSignal.pause();
|
|
1496
|
+
}
|
|
1466
1497
|
const summaryRefSeqNum = this.deltaManager.lastSequenceNumber;
|
|
1467
1498
|
const minimumSequenceNumber = this.deltaManager.minimumSequenceNumber;
|
|
1468
1499
|
const message = `Summary @${summaryRefSeqNum}:${this.deltaManager.minimumSequenceNumber}`;
|
|
@@ -1563,8 +1594,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1563
1594
|
// latestSnapshotVersionId from storage and it does not match with the lastAck ackHandle, then use
|
|
1564
1595
|
// the one fetched from storage as parent as that is the latest.
|
|
1565
1596
|
let summaryContext;
|
|
1566
|
-
if ((lastAck === null || lastAck === void 0 ? void 0 : lastAck.summaryAck.contents.handle) !== latestSnapshotVersionId
|
|
1567
|
-
|
|
1597
|
+
if ((lastAck === null || lastAck === void 0 ? void 0 : lastAck.summaryAck.contents.handle) !== latestSnapshotVersionId &&
|
|
1598
|
+
latestSnapshotVersionId !== undefined) {
|
|
1568
1599
|
summaryContext = {
|
|
1569
1600
|
proposalHandle: undefined,
|
|
1570
1601
|
ackHandle: latestSnapshotVersionId,
|
|
@@ -1621,6 +1652,9 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1621
1652
|
this.summarizerNode.clearSummary();
|
|
1622
1653
|
// Restart the delta manager
|
|
1623
1654
|
this.deltaManager.inbound.resume();
|
|
1655
|
+
if (shouldPauseInboundSignal) {
|
|
1656
|
+
this.deltaManager.inboundSignal.resume();
|
|
1657
|
+
}
|
|
1624
1658
|
}
|
|
1625
1659
|
}
|
|
1626
1660
|
hasPendingMessages() {
|
|
@@ -1669,7 +1703,10 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1669
1703
|
const deserializedContent = { type, contents };
|
|
1670
1704
|
const serializedContent = JSON.stringify(deserializedContent);
|
|
1671
1705
|
if (this.deltaManager.readOnlyInfo.readonly) {
|
|
1672
|
-
this.logger.sendTelemetryEvent({
|
|
1706
|
+
this.logger.sendTelemetryEvent({
|
|
1707
|
+
eventName: "SubmitOpInReadonly",
|
|
1708
|
+
connected: this.connected,
|
|
1709
|
+
});
|
|
1673
1710
|
}
|
|
1674
1711
|
const message = {
|
|
1675
1712
|
contents: serializedContent,
|
|
@@ -1699,7 +1736,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1699
1736
|
// issue than sending.
|
|
1700
1737
|
// Please note that this does not change file format, so it can be disabled in the future if this
|
|
1701
1738
|
// optimization no longer makes sense (for example, batch compression may make it less appealing).
|
|
1702
|
-
if (this.currentlyBatching() &&
|
|
1739
|
+
if (this.currentlyBatching() &&
|
|
1740
|
+
type === ContainerMessageType.Attach &&
|
|
1703
1741
|
this.mc.config.getBoolean("Fluid.ContainerRuntime.disableAttachOpReorder") !== true) {
|
|
1704
1742
|
this.outbox.submitAttach(message);
|
|
1705
1743
|
}
|
|
@@ -1712,10 +1750,14 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1712
1750
|
else if (!this.flushMicroTaskExists) {
|
|
1713
1751
|
this.flushMicroTaskExists = true;
|
|
1714
1752
|
// Queue a microtask to detect the end of the turn and force a flush.
|
|
1715
|
-
Promise.resolve()
|
|
1753
|
+
Promise.resolve()
|
|
1754
|
+
.then(() => {
|
|
1716
1755
|
this.flushMicroTaskExists = false;
|
|
1717
1756
|
this.flush();
|
|
1718
|
-
})
|
|
1757
|
+
})
|
|
1758
|
+
.catch((error) => {
|
|
1759
|
+
this.closeFn(error);
|
|
1760
|
+
});
|
|
1719
1761
|
}
|
|
1720
1762
|
}
|
|
1721
1763
|
catch (error) {
|
|
@@ -1910,13 +1952,15 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1910
1952
|
notifyAttaching(snapshot) {
|
|
1911
1953
|
var _a;
|
|
1912
1954
|
if ((_a = this.mc.config.getBoolean("enableOfflineLoad")) !== null && _a !== void 0 ? _a : this.runtimeOptions.enableOfflineLoad) {
|
|
1913
|
-
this.baseSnapshotBlobs =
|
|
1955
|
+
this.baseSnapshotBlobs =
|
|
1956
|
+
serializedSnapshotStorage_1.SerializedSnapshotStorage.serializeTreeWithBlobContents(snapshot);
|
|
1914
1957
|
}
|
|
1915
1958
|
}
|
|
1916
1959
|
async initializeBaseSnapshotBlobs() {
|
|
1917
1960
|
var _a;
|
|
1918
1961
|
if (!((_a = this.mc.config.getBoolean("enableOfflineLoad")) !== null && _a !== void 0 ? _a : this.runtimeOptions.enableOfflineLoad) ||
|
|
1919
|
-
this.attachState !== container_definitions_1.AttachState.Attached ||
|
|
1962
|
+
this.attachState !== container_definitions_1.AttachState.Attached ||
|
|
1963
|
+
this.context.pendingLocalState) {
|
|
1920
1964
|
return;
|
|
1921
1965
|
}
|
|
1922
1966
|
(0, common_utils_1.assert)(!!this.context.baseSnapshot, 0x2e5 /* "Must have a base snapshot" */);
|