@fluidframework/container-runtime 2.0.0-internal.7.2.2 → 2.0.0-internal.7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +1 -2
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +9 -1
- package/api-report/container-runtime.api.md +124 -107
- package/dist/batchTracker.d.ts +1 -0
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/blobManager.d.ts +4 -4
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.js +1 -1
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +1473 -0
- package/dist/container-runtime-beta.d.ts +300 -0
- package/dist/container-runtime-public.d.ts +300 -0
- package/dist/container-runtime-untrimmed.d.ts +1836 -0
- package/dist/containerRuntime.d.ts +34 -40
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +79 -67
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -1
- package/dist/dataStoreRegistry.js +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +10 -15
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +77 -40
- package/dist/dataStores.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +41 -13
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +215 -78
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +34 -37
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +121 -46
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +26 -18
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +18 -25
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +29 -45
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +0 -5
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +14 -42
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts +11 -5
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +43 -19
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +4 -5
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +16 -11
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +6 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/metadata.d.ts +6 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +10 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +2 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +21 -0
- 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 +1 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +2 -11
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +1 -0
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +2 -2
- package/dist/summary/runWhileConnectedCoordinator.js +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -1
- package/dist/summary/summarizer.js +1 -1
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +30 -30
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +10 -10
- package/dist/summary/summaryCollection.js +1 -1
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +3 -3
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/batchTracker.d.ts +1 -0
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/blobManager.d.ts +4 -4
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.js +1 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/container-runtime-alpha.d.ts +1473 -0
- package/lib/container-runtime-beta.d.ts +300 -0
- package/lib/container-runtime-public.d.ts +300 -0
- package/lib/container-runtime-untrimmed.d.ts +1836 -0
- package/lib/containerRuntime.d.ts +34 -40
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +81 -69
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +1 -1
- package/lib/dataStoreRegistry.js +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +10 -15
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +80 -43
- package/lib/dataStores.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +41 -13
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +217 -80
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +37 -40
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +121 -46
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +25 -17
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +18 -25
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +27 -43
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +0 -5
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +15 -43
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.d.ts +11 -5
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +43 -19
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/index.d.ts +14 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +15 -1
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +16 -11
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +6 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/metadata.d.ts +6 -0
- package/lib/metadata.d.ts.map +1 -1
- package/lib/metadata.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +10 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +2 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +21 -0
- 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 +1 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +2 -11
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts +1 -0
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +2 -2
- package/lib/summary/runWhileConnectedCoordinator.js +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -1
- package/lib/summary/summarizer.js +1 -1
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +30 -30
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +10 -10
- package/lib/summary/summaryCollection.js +1 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +3 -3
- package/lib/summary/summaryFormat.js.map +1 -1
- package/package.json +56 -29
- package/src/blobManager.ts +5 -5
- package/src/connectionTelemetry.ts +1 -1
- package/src/containerRuntime.ts +113 -90
- package/src/dataStoreRegistry.ts +1 -1
- package/src/dataStores.ts +140 -69
- package/src/gc/garbageCollection.md +14 -15
- package/src/gc/garbageCollection.ts +256 -96
- package/src/gc/gcConfigs.ts +50 -52
- package/src/gc/gcDefinitions.ts +137 -52
- package/src/gc/gcHelpers.ts +31 -52
- package/src/gc/gcTelemetry.ts +16 -57
- package/src/gc/gcUnreferencedStateTracker.ts +61 -22
- package/src/gc/index.ts +6 -4
- package/src/index.ts +19 -1
- package/src/messageTypes.ts +21 -11
- package/src/metadata.ts +7 -0
- package/src/opLifecycle/definitions.ts +1 -1
- package/src/opLifecycle/opGroupingManager.ts +10 -1
- package/src/opLifecycle/outbox.ts +34 -0
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +3 -13
- package/src/summary/orderedClientElection.ts +1 -1
- package/src/summary/runWhileConnectedCoordinator.ts +2 -2
- package/src/summary/summarizer.ts +1 -1
- package/src/summary/summarizerTypes.ts +30 -30
- package/src/summary/summaryCollection.ts +10 -10
- package/src/summary/summaryFormat.ts +3 -3
- package/dist/id-compressor/appendOnlySortedMap.d.ts +0 -124
- package/dist/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
- package/dist/id-compressor/appendOnlySortedMap.js +0 -318
- package/dist/id-compressor/appendOnlySortedMap.js.map +0 -1
- package/dist/id-compressor/finalSpace.d.ts +0 -29
- package/dist/id-compressor/finalSpace.d.ts.map +0 -1
- package/dist/id-compressor/finalSpace.js +0 -62
- package/dist/id-compressor/finalSpace.js.map +0 -1
- package/dist/id-compressor/idCompressor.d.ts +0 -54
- package/dist/id-compressor/idCompressor.d.ts.map +0 -1
- package/dist/id-compressor/idCompressor.js +0 -495
- package/dist/id-compressor/idCompressor.js.map +0 -1
- package/dist/id-compressor/identifiers.d.ts +0 -32
- package/dist/id-compressor/identifiers.d.ts.map +0 -1
- package/dist/id-compressor/identifiers.js +0 -15
- package/dist/id-compressor/identifiers.js.map +0 -1
- package/dist/id-compressor/index.d.ts +0 -13
- package/dist/id-compressor/index.d.ts.map +0 -1
- package/dist/id-compressor/index.js +0 -32
- package/dist/id-compressor/index.js.map +0 -1
- package/dist/id-compressor/persistanceUtilities.d.ts +0 -22
- package/dist/id-compressor/persistanceUtilities.d.ts.map +0 -1
- package/dist/id-compressor/persistanceUtilities.js +0 -43
- package/dist/id-compressor/persistanceUtilities.js.map +0 -1
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
- package/dist/id-compressor/sessionSpaceNormalizer.js +0 -80
- package/dist/id-compressor/sessionSpaceNormalizer.js.map +0 -1
- package/dist/id-compressor/sessions.d.ts +0 -115
- package/dist/id-compressor/sessions.d.ts.map +0 -1
- package/dist/id-compressor/sessions.js +0 -305
- package/dist/id-compressor/sessions.js.map +0 -1
- package/dist/id-compressor/utilities.d.ts +0 -52
- package/dist/id-compressor/utilities.d.ts.map +0 -1
- package/dist/id-compressor/utilities.js +0 -169
- package/dist/id-compressor/utilities.js.map +0 -1
- package/lib/id-compressor/appendOnlySortedMap.d.ts +0 -124
- package/lib/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
- package/lib/id-compressor/appendOnlySortedMap.js +0 -314
- package/lib/id-compressor/appendOnlySortedMap.js.map +0 -1
- package/lib/id-compressor/finalSpace.d.ts +0 -29
- package/lib/id-compressor/finalSpace.d.ts.map +0 -1
- package/lib/id-compressor/finalSpace.js +0 -58
- package/lib/id-compressor/finalSpace.js.map +0 -1
- package/lib/id-compressor/idCompressor.d.ts +0 -54
- package/lib/id-compressor/idCompressor.d.ts.map +0 -1
- package/lib/id-compressor/idCompressor.js +0 -491
- package/lib/id-compressor/idCompressor.js.map +0 -1
- package/lib/id-compressor/identifiers.d.ts +0 -32
- package/lib/id-compressor/identifiers.d.ts.map +0 -1
- package/lib/id-compressor/identifiers.js +0 -11
- package/lib/id-compressor/identifiers.js.map +0 -1
- package/lib/id-compressor/index.d.ts +0 -13
- package/lib/id-compressor/index.d.ts.map +0 -1
- package/lib/id-compressor/index.js +0 -13
- package/lib/id-compressor/index.js.map +0 -1
- package/lib/id-compressor/persistanceUtilities.d.ts +0 -22
- package/lib/id-compressor/persistanceUtilities.d.ts.map +0 -1
- package/lib/id-compressor/persistanceUtilities.js +0 -34
- package/lib/id-compressor/persistanceUtilities.js.map +0 -1
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
- package/lib/id-compressor/sessionSpaceNormalizer.js +0 -76
- package/lib/id-compressor/sessionSpaceNormalizer.js.map +0 -1
- package/lib/id-compressor/sessions.d.ts +0 -115
- package/lib/id-compressor/sessions.d.ts.map +0 -1
- package/lib/id-compressor/sessions.js +0 -290
- package/lib/id-compressor/sessions.js.map +0 -1
- package/lib/id-compressor/utilities.d.ts +0 -52
- package/lib/id-compressor/utilities.d.ts.map +0 -1
- package/lib/id-compressor/utilities.js +0 -151
- package/lib/id-compressor/utilities.js.map +0 -1
- package/src/id-compressor/README.md +0 -3
- package/src/id-compressor/appendOnlySortedMap.ts +0 -366
- package/src/id-compressor/finalSpace.ts +0 -67
- package/src/id-compressor/idCompressor.ts +0 -630
- package/src/id-compressor/identifiers.ts +0 -42
- package/src/id-compressor/index.ts +0 -26
- package/src/id-compressor/persistanceUtilities.ts +0 -58
- package/src/id-compressor/sessionSpaceNormalizer.ts +0 -83
- package/src/id-compressor/sessions.ts +0 -405
- package/src/id-compressor/utilities.ts +0 -190
package/lib/containerRuntime.js
CHANGED
|
@@ -3,7 +3,7 @@ import { assert, delay, LazyPromise } from "@fluidframework/core-utils";
|
|
|
3
3
|
import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
4
4
|
import { createChildLogger, createChildMonitoringContext, DataCorruptionError, DataProcessingError, GenericError, raiseConnectedEvent, PerformanceEvent,
|
|
5
5
|
// eslint-disable-next-line import/no-deprecated
|
|
6
|
-
TaggedLoggerAdapter, wrapError, UsageError, } from "@fluidframework/telemetry-utils";
|
|
6
|
+
TaggedLoggerAdapter, wrapError, UsageError, LoggingError, } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { DriverHeader, FetchSource, } from "@fluidframework/driver-definitions";
|
|
8
8
|
import { readAndParse } from "@fluidframework/driver-utils";
|
|
9
9
|
import { MessageType, SummaryType, } from "@fluidframework/protocol-definitions";
|
|
@@ -19,7 +19,7 @@ import { BlobManager } from "./blobManager";
|
|
|
19
19
|
import { DataStores, getSummaryForDatastores } from "./dataStores";
|
|
20
20
|
import { aliasBlobName, blobsTreeName, chunksBlobName, createRootSummarizerNodeWithGC, electedSummarizerBlobName, extractSummaryMetadataMessage, idCompressorBlobName, metadataBlobName, Summarizer, SummaryManager, wrapSummaryInChannelsTree, SummaryCollection, OrderedClientCollection, OrderedClientElection, SummarizerClientElection, summarizerClientType, RunWhileConnectedCoordinator, RetriableSummaryError, } from "./summary";
|
|
21
21
|
import { formExponentialFn, Throttler } from "./throttler";
|
|
22
|
-
import { GarbageCollector, GCNodeType,
|
|
22
|
+
import { GarbageCollector, GCNodeType, gcGenerationOptionName, trimLeadingAndTrailingSlashes, } from "./gc";
|
|
23
23
|
import { channelToDataStore, isDataStoreAliasMessage } from "./dataStore";
|
|
24
24
|
import { BindBatchTracker } from "./batchTracker";
|
|
25
25
|
import { ScheduleManager } from "./scheduleManager";
|
|
@@ -38,14 +38,8 @@ function compatBehaviorAllowsMessageType(_unknownContainerRuntimeMessageType, co
|
|
|
38
38
|
// undefined defaults to same behavior as "FailToProcess"
|
|
39
39
|
return compatBehavior === "Ignore";
|
|
40
40
|
}
|
|
41
|
-
function prepareLocalContainerRuntimeIdAllocationMessageForTransit(message) {
|
|
42
|
-
// Remove the stashedState from the op if it's a stashed op
|
|
43
|
-
if ("stashedState" in message.contents) {
|
|
44
|
-
delete message.contents.stashedState;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
41
|
/**
|
|
48
|
-
* @
|
|
42
|
+
* @internal
|
|
49
43
|
*/
|
|
50
44
|
export const DefaultSummaryConfiguration = {
|
|
51
45
|
state: "enabled",
|
|
@@ -63,7 +57,7 @@ export const DefaultSummaryConfiguration = {
|
|
|
63
57
|
};
|
|
64
58
|
/**
|
|
65
59
|
* Accepted header keys for requests coming to the runtime.
|
|
66
|
-
* @
|
|
60
|
+
* @internal
|
|
67
61
|
*/
|
|
68
62
|
export var RuntimeHeaders;
|
|
69
63
|
(function (RuntimeHeaders) {
|
|
@@ -73,22 +67,22 @@ export var RuntimeHeaders;
|
|
|
73
67
|
RuntimeHeaders["viaHandle"] = "viaHandle";
|
|
74
68
|
})(RuntimeHeaders || (RuntimeHeaders = {}));
|
|
75
69
|
/** True if a tombstoned object should be returned without erroring
|
|
76
|
-
* @
|
|
70
|
+
* @internal
|
|
77
71
|
*/
|
|
78
72
|
export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
|
|
79
73
|
/**
|
|
80
74
|
* [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
|
|
81
|
-
* @
|
|
75
|
+
* @internal
|
|
82
76
|
*/
|
|
83
77
|
export const AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
|
|
84
78
|
/**
|
|
85
79
|
* Tombstone error responses will have this header set to true
|
|
86
|
-
* @
|
|
80
|
+
* @internal
|
|
87
81
|
*/
|
|
88
82
|
export const TombstoneResponseHeaderKey = "isTombstoned";
|
|
89
83
|
/**
|
|
90
84
|
* Inactive error responses will have this header set to true
|
|
91
|
-
* @
|
|
85
|
+
* @internal
|
|
92
86
|
*/
|
|
93
87
|
export const InactiveResponseHeaderKey = "isInactive";
|
|
94
88
|
/** Default values for Runtime Headers */
|
|
@@ -100,7 +94,7 @@ export const defaultRuntimeHeaderData = {
|
|
|
100
94
|
};
|
|
101
95
|
/**
|
|
102
96
|
* Available compression algorithms for op compression.
|
|
103
|
-
* @
|
|
97
|
+
* @alpha
|
|
104
98
|
*/
|
|
105
99
|
export var CompressionAlgorithms;
|
|
106
100
|
(function (CompressionAlgorithms) {
|
|
@@ -131,7 +125,7 @@ export const defaultPendingOpsRetryDelayMs = 1000;
|
|
|
131
125
|
const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
|
|
132
126
|
/**
|
|
133
127
|
* @deprecated use ContainerRuntimeMessageType instead
|
|
134
|
-
* @
|
|
128
|
+
* @internal
|
|
135
129
|
*/
|
|
136
130
|
export var RuntimeMessage;
|
|
137
131
|
(function (RuntimeMessage) {
|
|
@@ -145,7 +139,7 @@ export var RuntimeMessage;
|
|
|
145
139
|
})(RuntimeMessage || (RuntimeMessage = {}));
|
|
146
140
|
/**
|
|
147
141
|
* @deprecated please use version in driver-utils
|
|
148
|
-
* @
|
|
142
|
+
* @internal
|
|
149
143
|
*/
|
|
150
144
|
export function isRuntimeMessage(message) {
|
|
151
145
|
return Object.values(RuntimeMessage).includes(message.type);
|
|
@@ -154,7 +148,7 @@ export function isRuntimeMessage(message) {
|
|
|
154
148
|
* Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
|
|
155
149
|
* special-case for document dirty state. Ultimately we should have no special-cases from the
|
|
156
150
|
* ContainerRuntime's perspective.
|
|
157
|
-
* @
|
|
151
|
+
* @internal
|
|
158
152
|
*/
|
|
159
153
|
export const agentSchedulerId = "_scheduler";
|
|
160
154
|
// safely check navigator and get the hardware spec value
|
|
@@ -230,7 +224,7 @@ export async function TEST_requestSummarizer(loader, url) {
|
|
|
230
224
|
/**
|
|
231
225
|
* Represents the runtime of the container. Contains helper functions/state of the container.
|
|
232
226
|
* It will define the store level mappings.
|
|
233
|
-
* @
|
|
227
|
+
* @alpha
|
|
234
228
|
*/
|
|
235
229
|
export class ContainerRuntime extends TypedEventEmitter {
|
|
236
230
|
/**
|
|
@@ -347,11 +341,17 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
347
341
|
const idCompressorEnabled = metadata?.idCompressorEnabled ?? runtimeOptions.enableRuntimeIdCompressor ?? false;
|
|
348
342
|
let idCompressor;
|
|
349
343
|
if (idCompressorEnabled) {
|
|
350
|
-
const {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
344
|
+
const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import("@fluidframework/id-compressor");
|
|
345
|
+
const pendingLocalState = context.pendingLocalState;
|
|
346
|
+
if (pendingLocalState?.pendingIdCompressorState !== undefined) {
|
|
347
|
+
idCompressor = deserializeIdCompressor(pendingLocalState.pendingIdCompressorState);
|
|
348
|
+
}
|
|
349
|
+
else if (serializedIdCompressor !== undefined) {
|
|
350
|
+
idCompressor = deserializeIdCompressor(serializedIdCompressor, createSessionId());
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
idCompressor = createIdCompressor(logger);
|
|
354
|
+
}
|
|
355
355
|
}
|
|
356
356
|
const runtime = new containerRuntimeCtor(context, registry, metadata, electedSummarizerData, chunks ?? [], aliases ?? [], {
|
|
357
357
|
summaryOptions,
|
|
@@ -453,9 +453,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
453
453
|
get gcThrowOnTombstoneUsage() {
|
|
454
454
|
return this.garbageCollector.throwOnTombstoneUsage;
|
|
455
455
|
}
|
|
456
|
-
|
|
457
|
-
* @internal
|
|
458
|
-
*/
|
|
456
|
+
/***/
|
|
459
457
|
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, idCompressor, provideEntryPoint, requestHandler, summaryConfiguration = {
|
|
460
458
|
// the defaults
|
|
461
459
|
...DefaultSummaryConfiguration,
|
|
@@ -470,6 +468,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
470
468
|
this._storage = _storage;
|
|
471
469
|
this.requestHandler = requestHandler;
|
|
472
470
|
this.summaryConfiguration = summaryConfiguration;
|
|
471
|
+
this.imminentClosure = false;
|
|
473
472
|
this.defaultMaxConsecutiveReconnects = 7;
|
|
474
473
|
this._orderSequentiallyCalls = 0;
|
|
475
474
|
this.flushTaskExists = false;
|
|
@@ -561,7 +560,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
561
560
|
eventName: "GCFeatureMatrix",
|
|
562
561
|
metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
|
|
563
562
|
inputs: JSON.stringify({
|
|
564
|
-
|
|
563
|
+
gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gcGenerationOptionName],
|
|
565
564
|
}),
|
|
566
565
|
});
|
|
567
566
|
this.telemetryDocumentId = metadata?.telemetryDocumentId ?? uuid();
|
|
@@ -627,6 +626,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
627
626
|
// GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
|
|
628
627
|
// delta manager would always return false for summarizer client.
|
|
629
628
|
activeConnection: () => this.innerDeltaManager.active,
|
|
629
|
+
submitMessage: (message) => this.submit(message),
|
|
630
630
|
});
|
|
631
631
|
const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
|
|
632
632
|
this.summarizerNode = createRootSummarizerNodeWithGC(createChildLogger({ logger: this.logger, namespace: "SummarizerNode" }),
|
|
@@ -1050,19 +1050,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1050
1050
|
// Officially transition from the old state to the new state.
|
|
1051
1051
|
this.updateDocumentDirtyState(newState);
|
|
1052
1052
|
}
|
|
1053
|
-
/**
|
|
1054
|
-
* Updates the runtime's IdCompressor with the stashed state present in the given op. This is a bit of a
|
|
1055
|
-
* hack and is unnecessarily expensive. As it stands, every locally stashed op (all ops that get stored in
|
|
1056
|
-
* the PendingStateManager) will store their serialized representation locally until ack'd. Upon receiving
|
|
1057
|
-
* this stashed state, the IdCompressor blindly deserializes to the stashed state and assumes the session.
|
|
1058
|
-
* Technically only the last stashed state is needed to do this correctly, but we would have to write some
|
|
1059
|
-
* more hacky code to modify the batch before it gets sent out.
|
|
1060
|
-
* @param content - An IdAllocationOp with "stashedState", which is a representation of un-ack'd local state.
|
|
1061
|
-
*/
|
|
1062
|
-
async applyStashedIdAllocationOp(op) {
|
|
1063
|
-
const { IdCompressor } = await import("./id-compressor");
|
|
1064
|
-
this.idCompressor = IdCompressor.deserialize(op.stashedState);
|
|
1065
|
-
}
|
|
1066
1053
|
/**
|
|
1067
1054
|
* Parse an op's type and actual content from given serialized content
|
|
1068
1055
|
* ! Note: this format needs to be in-line with what is set in the "ContainerRuntime.submit(...)" method
|
|
@@ -1084,7 +1071,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1084
1071
|
return this.dataStores.applyStashedAttachOp(opContents.contents);
|
|
1085
1072
|
case ContainerMessageType.IdAllocation:
|
|
1086
1073
|
assert(this.idCompressor !== undefined, 0x67b /* IdCompressor should be defined if enabled */);
|
|
1087
|
-
return
|
|
1074
|
+
return;
|
|
1088
1075
|
case ContainerMessageType.Alias:
|
|
1089
1076
|
case ContainerMessageType.BlobAttach:
|
|
1090
1077
|
return;
|
|
@@ -1092,6 +1079,9 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1092
1079
|
throw new Error("chunkedOp not expected here");
|
|
1093
1080
|
case ContainerMessageType.Rejoin:
|
|
1094
1081
|
throw new Error("rejoin not expected here");
|
|
1082
|
+
case ContainerMessageType.GC:
|
|
1083
|
+
// GC op is only sent in summarizer which should never have stashed ops.
|
|
1084
|
+
throw new LoggingError("GC op not expected to be stashed in summarizer");
|
|
1095
1085
|
default: {
|
|
1096
1086
|
// This should be extremely rare for stashed ops.
|
|
1097
1087
|
// It would require a newer runtime stashing ops and then an older one applying them,
|
|
@@ -1270,7 +1260,14 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1270
1260
|
break;
|
|
1271
1261
|
case ContainerMessageType.IdAllocation:
|
|
1272
1262
|
assert(this.idCompressor !== undefined, 0x67c /* IdCompressor should be defined if enabled */);
|
|
1273
|
-
|
|
1263
|
+
// Don't re-finalize the range if we're processing a "savedOp" in
|
|
1264
|
+
// stashed ops flow. The compressor is stashed with these ops already processed.
|
|
1265
|
+
if (messageWithContext.message.metadata?.savedOp !== true) {
|
|
1266
|
+
this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
|
|
1267
|
+
}
|
|
1268
|
+
break;
|
|
1269
|
+
case ContainerMessageType.GC:
|
|
1270
|
+
this.garbageCollector.processMessage(messageWithContext.message, local);
|
|
1274
1271
|
break;
|
|
1275
1272
|
case ContainerMessageType.ChunkedOp:
|
|
1276
1273
|
case ContainerMessageType.Rejoin:
|
|
@@ -1461,7 +1458,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1461
1458
|
}
|
|
1462
1459
|
/**
|
|
1463
1460
|
* @deprecated 0.16 Issue #1537, #3631
|
|
1464
|
-
* @internal
|
|
1465
1461
|
*/
|
|
1466
1462
|
async _createDataStoreWithProps(pkg, props, id = uuid()) {
|
|
1467
1463
|
return channelToDataStore(await this.dataStores
|
|
@@ -1471,7 +1467,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1471
1467
|
canSendOps() {
|
|
1472
1468
|
// Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
|
|
1473
1469
|
// container runtime's ability to send ops depend on the actual readonly state of the delta manager.
|
|
1474
|
-
return this.connected && !this.innerDeltaManager.readOnlyInfo.readonly;
|
|
1470
|
+
return (this.connected && !this.innerDeltaManager.readOnlyInfo.readonly && !this.imminentClosure);
|
|
1475
1471
|
}
|
|
1476
1472
|
/**
|
|
1477
1473
|
* Are we in the middle of batching ops together?
|
|
@@ -1493,19 +1489,28 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1493
1489
|
return this.dirtyContainer;
|
|
1494
1490
|
}
|
|
1495
1491
|
isContainerMessageDirtyable({ type, contents }) {
|
|
1496
|
-
//
|
|
1497
|
-
//
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1492
|
+
// Certain container runtime messages should not mark the container dirty such as the old built-in
|
|
1493
|
+
// AgentScheduler and Garbage collector messages.
|
|
1494
|
+
switch (type) {
|
|
1495
|
+
case ContainerMessageType.Attach: {
|
|
1496
|
+
const attachMessage = contents;
|
|
1497
|
+
if (attachMessage.id === agentSchedulerId) {
|
|
1498
|
+
return false;
|
|
1499
|
+
}
|
|
1500
|
+
break;
|
|
1502
1501
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1502
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
1503
|
+
const envelope = contents;
|
|
1504
|
+
if (envelope.address === agentSchedulerId) {
|
|
1505
|
+
return false;
|
|
1506
|
+
}
|
|
1507
|
+
break;
|
|
1508
|
+
}
|
|
1509
|
+
case ContainerMessageType.GC: {
|
|
1507
1510
|
return false;
|
|
1508
1511
|
}
|
|
1512
|
+
default:
|
|
1513
|
+
break;
|
|
1509
1514
|
}
|
|
1510
1515
|
return true;
|
|
1511
1516
|
}
|
|
@@ -1796,10 +1801,10 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1796
1801
|
properties: { all: { safeSummary: true } },
|
|
1797
1802
|
}));
|
|
1798
1803
|
}
|
|
1799
|
-
// If there are pending
|
|
1800
|
-
// incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
1801
|
-
// within the timeout, check if it should be failed or can continue.
|
|
1802
|
-
if (this.validateSummaryBeforeUpload && this.
|
|
1804
|
+
// If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
|
|
1805
|
+
// and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
1806
|
+
// saved within the timeout, check if it should be failed or can continue.
|
|
1807
|
+
if (this.validateSummaryBeforeUpload && this.isDirty) {
|
|
1803
1808
|
const countBefore = this.pendingMessagesCount;
|
|
1804
1809
|
// The timeout for waiting for pending ops can be overridden via configurations.
|
|
1805
1810
|
const pendingOpsTimeout = this.mc.config.getNumber("Fluid.Summarizer.waitForPendingOpsTimeoutMs") ??
|
|
@@ -1819,7 +1824,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1819
1824
|
// happens, whether we attempted to wait for these ops to be acked and what was the result.
|
|
1820
1825
|
summaryNumberLogger.sendTelemetryEvent({
|
|
1821
1826
|
eventName: "PendingOpsWhileSummarizing",
|
|
1822
|
-
saved: this.
|
|
1827
|
+
saved: !this.isDirty,
|
|
1823
1828
|
timeout: pendingOpsTimeout,
|
|
1824
1829
|
countBefore,
|
|
1825
1830
|
countAfter: this.pendingMessagesCount,
|
|
@@ -2044,7 +2049,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2044
2049
|
}
|
|
2045
2050
|
}
|
|
2046
2051
|
/**
|
|
2047
|
-
* This helper is called during summarization. If
|
|
2052
|
+
* This helper is called during summarization. If the container is dirty, it will return a failed summarize result
|
|
2048
2053
|
* (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
|
|
2049
2054
|
* @param logger - The logger to be used for sending telemetry.
|
|
2050
2055
|
* @param referenceSequenceNumber - The reference sequence number of the summary attempt.
|
|
@@ -2054,7 +2059,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2054
2059
|
* @returns failed summarize result (IBaseSummarizeResult) if summary should be failed, undefined otherwise.
|
|
2055
2060
|
*/
|
|
2056
2061
|
async shouldFailSummaryOnPendingOps(logger, referenceSequenceNumber, minimumSequenceNumber, finalAttempt, beforeSummaryGeneration) {
|
|
2057
|
-
if (!this.
|
|
2062
|
+
if (!this.isDirty) {
|
|
2058
2063
|
return;
|
|
2059
2064
|
}
|
|
2060
2065
|
// If "SkipFailingIncorrectSummary" option is true, don't fail the summary in the last attempt.
|
|
@@ -2146,12 +2151,12 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2146
2151
|
contents: JSON.stringify(idAllocationMessage),
|
|
2147
2152
|
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
2148
2153
|
metadata: undefined,
|
|
2149
|
-
localOpMetadata:
|
|
2154
|
+
localOpMetadata: undefined,
|
|
2150
2155
|
type: ContainerMessageType.IdAllocation,
|
|
2151
2156
|
};
|
|
2152
2157
|
}
|
|
2153
2158
|
if (idAllocationBatchMessage !== undefined) {
|
|
2154
|
-
this.outbox.
|
|
2159
|
+
this.outbox.submitIdAllocation(idAllocationBatchMessage);
|
|
2155
2160
|
}
|
|
2156
2161
|
}
|
|
2157
2162
|
}
|
|
@@ -2324,6 +2329,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2324
2329
|
/**
|
|
2325
2330
|
* Finds the right store and asks it to resubmit the message. This typically happens when we
|
|
2326
2331
|
* reconnect and there are pending messages.
|
|
2332
|
+
* ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
|
|
2327
2333
|
* @param message - The original LocalContainerRuntimeMessage.
|
|
2328
2334
|
* @param localOpMetadata - The local metadata associated with the original message.
|
|
2329
2335
|
*/
|
|
@@ -2336,10 +2342,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2336
2342
|
break;
|
|
2337
2343
|
case ContainerMessageType.Attach:
|
|
2338
2344
|
case ContainerMessageType.Alias:
|
|
2339
|
-
this.submit(message, localOpMetadata);
|
|
2340
|
-
break;
|
|
2341
2345
|
case ContainerMessageType.IdAllocation: {
|
|
2342
|
-
prepareLocalContainerRuntimeIdAllocationMessageForTransit(message);
|
|
2343
2346
|
this.submit(message, localOpMetadata);
|
|
2344
2347
|
break;
|
|
2345
2348
|
}
|
|
@@ -2351,6 +2354,9 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2351
2354
|
case ContainerMessageType.Rejoin:
|
|
2352
2355
|
this.submit(message);
|
|
2353
2356
|
break;
|
|
2357
|
+
case ContainerMessageType.GC:
|
|
2358
|
+
// GC op is only sent in summarizer which should never reconnect.
|
|
2359
|
+
throw new LoggingError("GC op not expected to be resubmitted in summarizer");
|
|
2354
2360
|
default: {
|
|
2355
2361
|
// This case should be very rare - it would imply an op was stashed from a
|
|
2356
2362
|
// future version of runtime code and now is being applied on an older version
|
|
@@ -2492,7 +2498,11 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2492
2498
|
notifyImminentClosure: props?.notifyImminentClosure,
|
|
2493
2499
|
}, async (event) => {
|
|
2494
2500
|
this.verifyNotClosed();
|
|
2495
|
-
|
|
2501
|
+
// in case imminentClosure is set to true by future code, we don't
|
|
2502
|
+
// try to change its value
|
|
2503
|
+
if (!this.imminentClosure) {
|
|
2504
|
+
this.imminentClosure = props?.notifyImminentClosure ?? this.imminentClosure;
|
|
2505
|
+
}
|
|
2496
2506
|
const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
|
|
2497
2507
|
if (this._orderSequentiallyCalls !== 0) {
|
|
2498
2508
|
throw new UsageError("can't get state during orderSequentially");
|
|
@@ -2501,16 +2511,18 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2501
2511
|
// getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
|
|
2502
2512
|
// to close current batch.
|
|
2503
2513
|
this.flush();
|
|
2504
|
-
const pendingAttachmentBlobs =
|
|
2514
|
+
const pendingAttachmentBlobs = this.imminentClosure
|
|
2505
2515
|
? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
|
|
2506
2516
|
: undefined;
|
|
2507
2517
|
const pending = this.pendingStateManager.getLocalState();
|
|
2508
2518
|
if (!pendingAttachmentBlobs && !this.hasPendingMessages()) {
|
|
2509
2519
|
return; // no pending state to save
|
|
2510
2520
|
}
|
|
2521
|
+
const pendingIdCompressorState = this.idCompressor?.serialize(true);
|
|
2511
2522
|
const pendingState = {
|
|
2512
2523
|
pending,
|
|
2513
2524
|
pendingAttachmentBlobs,
|
|
2525
|
+
pendingIdCompressorState,
|
|
2514
2526
|
};
|
|
2515
2527
|
event.end({
|
|
2516
2528
|
attachmentBlobsSize: Object.keys(pendingAttachmentBlobs ?? {}).length,
|