@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/dist/containerRuntime.js
CHANGED
|
@@ -62,14 +62,8 @@ function compatBehaviorAllowsMessageType(_unknownContainerRuntimeMessageType, co
|
|
|
62
62
|
// undefined defaults to same behavior as "FailToProcess"
|
|
63
63
|
return compatBehavior === "Ignore";
|
|
64
64
|
}
|
|
65
|
-
function prepareLocalContainerRuntimeIdAllocationMessageForTransit(message) {
|
|
66
|
-
// Remove the stashedState from the op if it's a stashed op
|
|
67
|
-
if ("stashedState" in message.contents) {
|
|
68
|
-
delete message.contents.stashedState;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
65
|
/**
|
|
72
|
-
* @
|
|
66
|
+
* @internal
|
|
73
67
|
*/
|
|
74
68
|
exports.DefaultSummaryConfiguration = {
|
|
75
69
|
state: "enabled",
|
|
@@ -87,7 +81,7 @@ exports.DefaultSummaryConfiguration = {
|
|
|
87
81
|
};
|
|
88
82
|
/**
|
|
89
83
|
* Accepted header keys for requests coming to the runtime.
|
|
90
|
-
* @
|
|
84
|
+
* @internal
|
|
91
85
|
*/
|
|
92
86
|
var RuntimeHeaders;
|
|
93
87
|
(function (RuntimeHeaders) {
|
|
@@ -97,22 +91,22 @@ var RuntimeHeaders;
|
|
|
97
91
|
RuntimeHeaders["viaHandle"] = "viaHandle";
|
|
98
92
|
})(RuntimeHeaders || (exports.RuntimeHeaders = RuntimeHeaders = {}));
|
|
99
93
|
/** True if a tombstoned object should be returned without erroring
|
|
100
|
-
* @
|
|
94
|
+
* @internal
|
|
101
95
|
*/
|
|
102
96
|
exports.AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
|
|
103
97
|
/**
|
|
104
98
|
* [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
|
|
105
|
-
* @
|
|
99
|
+
* @internal
|
|
106
100
|
*/
|
|
107
101
|
exports.AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
|
|
108
102
|
/**
|
|
109
103
|
* Tombstone error responses will have this header set to true
|
|
110
|
-
* @
|
|
104
|
+
* @internal
|
|
111
105
|
*/
|
|
112
106
|
exports.TombstoneResponseHeaderKey = "isTombstoned";
|
|
113
107
|
/**
|
|
114
108
|
* Inactive error responses will have this header set to true
|
|
115
|
-
* @
|
|
109
|
+
* @internal
|
|
116
110
|
*/
|
|
117
111
|
exports.InactiveResponseHeaderKey = "isInactive";
|
|
118
112
|
/** Default values for Runtime Headers */
|
|
@@ -124,7 +118,7 @@ exports.defaultRuntimeHeaderData = {
|
|
|
124
118
|
};
|
|
125
119
|
/**
|
|
126
120
|
* Available compression algorithms for op compression.
|
|
127
|
-
* @
|
|
121
|
+
* @alpha
|
|
128
122
|
*/
|
|
129
123
|
var CompressionAlgorithms;
|
|
130
124
|
(function (CompressionAlgorithms) {
|
|
@@ -155,7 +149,7 @@ exports.defaultPendingOpsRetryDelayMs = 1000;
|
|
|
155
149
|
const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
|
|
156
150
|
/**
|
|
157
151
|
* @deprecated use ContainerRuntimeMessageType instead
|
|
158
|
-
* @
|
|
152
|
+
* @internal
|
|
159
153
|
*/
|
|
160
154
|
var RuntimeMessage;
|
|
161
155
|
(function (RuntimeMessage) {
|
|
@@ -169,7 +163,7 @@ var RuntimeMessage;
|
|
|
169
163
|
})(RuntimeMessage || (exports.RuntimeMessage = RuntimeMessage = {}));
|
|
170
164
|
/**
|
|
171
165
|
* @deprecated please use version in driver-utils
|
|
172
|
-
* @
|
|
166
|
+
* @internal
|
|
173
167
|
*/
|
|
174
168
|
function isRuntimeMessage(message) {
|
|
175
169
|
return Object.values(RuntimeMessage).includes(message.type);
|
|
@@ -179,7 +173,7 @@ exports.isRuntimeMessage = isRuntimeMessage;
|
|
|
179
173
|
* Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
|
|
180
174
|
* special-case for document dirty state. Ultimately we should have no special-cases from the
|
|
181
175
|
* ContainerRuntime's perspective.
|
|
182
|
-
* @
|
|
176
|
+
* @internal
|
|
183
177
|
*/
|
|
184
178
|
exports.agentSchedulerId = "_scheduler";
|
|
185
179
|
// safely check navigator and get the hardware spec value
|
|
@@ -258,7 +252,7 @@ exports.TEST_requestSummarizer = TEST_requestSummarizer;
|
|
|
258
252
|
/**
|
|
259
253
|
* Represents the runtime of the container. Contains helper functions/state of the container.
|
|
260
254
|
* It will define the store level mappings.
|
|
261
|
-
* @
|
|
255
|
+
* @alpha
|
|
262
256
|
*/
|
|
263
257
|
class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
264
258
|
/**
|
|
@@ -375,11 +369,17 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
375
369
|
const idCompressorEnabled = metadata?.idCompressorEnabled ?? runtimeOptions.enableRuntimeIdCompressor ?? false;
|
|
376
370
|
let idCompressor;
|
|
377
371
|
if (idCompressorEnabled) {
|
|
378
|
-
const {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
372
|
+
const { createIdCompressor, deserializeIdCompressor, createSessionId } = await Promise.resolve().then(() => __importStar(require("@fluidframework/id-compressor")));
|
|
373
|
+
const pendingLocalState = context.pendingLocalState;
|
|
374
|
+
if (pendingLocalState?.pendingIdCompressorState !== undefined) {
|
|
375
|
+
idCompressor = deserializeIdCompressor(pendingLocalState.pendingIdCompressorState);
|
|
376
|
+
}
|
|
377
|
+
else if (serializedIdCompressor !== undefined) {
|
|
378
|
+
idCompressor = deserializeIdCompressor(serializedIdCompressor, createSessionId());
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
idCompressor = createIdCompressor(logger);
|
|
382
|
+
}
|
|
383
383
|
}
|
|
384
384
|
const runtime = new containerRuntimeCtor(context, registry, metadata, electedSummarizerData, chunks ?? [], aliases ?? [], {
|
|
385
385
|
summaryOptions,
|
|
@@ -481,9 +481,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
481
481
|
get gcThrowOnTombstoneUsage() {
|
|
482
482
|
return this.garbageCollector.throwOnTombstoneUsage;
|
|
483
483
|
}
|
|
484
|
-
|
|
485
|
-
* @internal
|
|
486
|
-
*/
|
|
484
|
+
/***/
|
|
487
485
|
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, _storage, idCompressor, provideEntryPoint, requestHandler, summaryConfiguration = {
|
|
488
486
|
// the defaults
|
|
489
487
|
...exports.DefaultSummaryConfiguration,
|
|
@@ -498,6 +496,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
498
496
|
this._storage = _storage;
|
|
499
497
|
this.requestHandler = requestHandler;
|
|
500
498
|
this.summaryConfiguration = summaryConfiguration;
|
|
499
|
+
this.imminentClosure = false;
|
|
501
500
|
this.defaultMaxConsecutiveReconnects = 7;
|
|
502
501
|
this._orderSequentiallyCalls = 0;
|
|
503
502
|
this.flushTaskExists = false;
|
|
@@ -589,7 +588,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
589
588
|
eventName: "GCFeatureMatrix",
|
|
590
589
|
metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
|
|
591
590
|
inputs: JSON.stringify({
|
|
592
|
-
|
|
591
|
+
gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gc_1.gcGenerationOptionName],
|
|
593
592
|
}),
|
|
594
593
|
});
|
|
595
594
|
this.telemetryDocumentId = metadata?.telemetryDocumentId ?? (0, uuid_1.v4)();
|
|
@@ -655,6 +654,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
655
654
|
// GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
|
|
656
655
|
// delta manager would always return false for summarizer client.
|
|
657
656
|
activeConnection: () => this.innerDeltaManager.active,
|
|
657
|
+
submitMessage: (message) => this.submit(message),
|
|
658
658
|
});
|
|
659
659
|
const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
|
|
660
660
|
this.summarizerNode = (0, summary_1.createRootSummarizerNodeWithGC)((0, telemetry_utils_1.createChildLogger)({ logger: this.logger, namespace: "SummarizerNode" }),
|
|
@@ -1078,19 +1078,6 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1078
1078
|
// Officially transition from the old state to the new state.
|
|
1079
1079
|
this.updateDocumentDirtyState(newState);
|
|
1080
1080
|
}
|
|
1081
|
-
/**
|
|
1082
|
-
* Updates the runtime's IdCompressor with the stashed state present in the given op. This is a bit of a
|
|
1083
|
-
* hack and is unnecessarily expensive. As it stands, every locally stashed op (all ops that get stored in
|
|
1084
|
-
* the PendingStateManager) will store their serialized representation locally until ack'd. Upon receiving
|
|
1085
|
-
* this stashed state, the IdCompressor blindly deserializes to the stashed state and assumes the session.
|
|
1086
|
-
* Technically only the last stashed state is needed to do this correctly, but we would have to write some
|
|
1087
|
-
* more hacky code to modify the batch before it gets sent out.
|
|
1088
|
-
* @param content - An IdAllocationOp with "stashedState", which is a representation of un-ack'd local state.
|
|
1089
|
-
*/
|
|
1090
|
-
async applyStashedIdAllocationOp(op) {
|
|
1091
|
-
const { IdCompressor } = await Promise.resolve().then(() => __importStar(require("./id-compressor")));
|
|
1092
|
-
this.idCompressor = IdCompressor.deserialize(op.stashedState);
|
|
1093
|
-
}
|
|
1094
1081
|
/**
|
|
1095
1082
|
* Parse an op's type and actual content from given serialized content
|
|
1096
1083
|
* ! Note: this format needs to be in-line with what is set in the "ContainerRuntime.submit(...)" method
|
|
@@ -1112,7 +1099,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1112
1099
|
return this.dataStores.applyStashedAttachOp(opContents.contents);
|
|
1113
1100
|
case messageTypes_1.ContainerMessageType.IdAllocation:
|
|
1114
1101
|
(0, core_utils_1.assert)(this.idCompressor !== undefined, 0x67b /* IdCompressor should be defined if enabled */);
|
|
1115
|
-
return
|
|
1102
|
+
return;
|
|
1116
1103
|
case messageTypes_1.ContainerMessageType.Alias:
|
|
1117
1104
|
case messageTypes_1.ContainerMessageType.BlobAttach:
|
|
1118
1105
|
return;
|
|
@@ -1120,6 +1107,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1120
1107
|
throw new Error("chunkedOp not expected here");
|
|
1121
1108
|
case messageTypes_1.ContainerMessageType.Rejoin:
|
|
1122
1109
|
throw new Error("rejoin not expected here");
|
|
1110
|
+
case messageTypes_1.ContainerMessageType.GC:
|
|
1111
|
+
// GC op is only sent in summarizer which should never have stashed ops.
|
|
1112
|
+
throw new telemetry_utils_1.LoggingError("GC op not expected to be stashed in summarizer");
|
|
1123
1113
|
default: {
|
|
1124
1114
|
// This should be extremely rare for stashed ops.
|
|
1125
1115
|
// It would require a newer runtime stashing ops and then an older one applying them,
|
|
@@ -1298,7 +1288,14 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1298
1288
|
break;
|
|
1299
1289
|
case messageTypes_1.ContainerMessageType.IdAllocation:
|
|
1300
1290
|
(0, core_utils_1.assert)(this.idCompressor !== undefined, 0x67c /* IdCompressor should be defined if enabled */);
|
|
1301
|
-
|
|
1291
|
+
// Don't re-finalize the range if we're processing a "savedOp" in
|
|
1292
|
+
// stashed ops flow. The compressor is stashed with these ops already processed.
|
|
1293
|
+
if (messageWithContext.message.metadata?.savedOp !== true) {
|
|
1294
|
+
this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
|
|
1295
|
+
}
|
|
1296
|
+
break;
|
|
1297
|
+
case messageTypes_1.ContainerMessageType.GC:
|
|
1298
|
+
this.garbageCollector.processMessage(messageWithContext.message, local);
|
|
1302
1299
|
break;
|
|
1303
1300
|
case messageTypes_1.ContainerMessageType.ChunkedOp:
|
|
1304
1301
|
case messageTypes_1.ContainerMessageType.Rejoin:
|
|
@@ -1489,7 +1486,6 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1489
1486
|
}
|
|
1490
1487
|
/**
|
|
1491
1488
|
* @deprecated 0.16 Issue #1537, #3631
|
|
1492
|
-
* @internal
|
|
1493
1489
|
*/
|
|
1494
1490
|
async _createDataStoreWithProps(pkg, props, id = (0, uuid_1.v4)()) {
|
|
1495
1491
|
return (0, dataStore_1.channelToDataStore)(await this.dataStores
|
|
@@ -1499,7 +1495,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1499
1495
|
canSendOps() {
|
|
1500
1496
|
// Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
|
|
1501
1497
|
// container runtime's ability to send ops depend on the actual readonly state of the delta manager.
|
|
1502
|
-
return this.connected && !this.innerDeltaManager.readOnlyInfo.readonly;
|
|
1498
|
+
return (this.connected && !this.innerDeltaManager.readOnlyInfo.readonly && !this.imminentClosure);
|
|
1503
1499
|
}
|
|
1504
1500
|
/**
|
|
1505
1501
|
* Are we in the middle of batching ops together?
|
|
@@ -1521,19 +1517,28 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1521
1517
|
return this.dirtyContainer;
|
|
1522
1518
|
}
|
|
1523
1519
|
isContainerMessageDirtyable({ type, contents }) {
|
|
1524
|
-
//
|
|
1525
|
-
//
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1520
|
+
// Certain container runtime messages should not mark the container dirty such as the old built-in
|
|
1521
|
+
// AgentScheduler and Garbage collector messages.
|
|
1522
|
+
switch (type) {
|
|
1523
|
+
case messageTypes_1.ContainerMessageType.Attach: {
|
|
1524
|
+
const attachMessage = contents;
|
|
1525
|
+
if (attachMessage.id === exports.agentSchedulerId) {
|
|
1526
|
+
return false;
|
|
1527
|
+
}
|
|
1528
|
+
break;
|
|
1530
1529
|
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1530
|
+
case messageTypes_1.ContainerMessageType.FluidDataStoreOp: {
|
|
1531
|
+
const envelope = contents;
|
|
1532
|
+
if (envelope.address === exports.agentSchedulerId) {
|
|
1533
|
+
return false;
|
|
1534
|
+
}
|
|
1535
|
+
break;
|
|
1536
|
+
}
|
|
1537
|
+
case messageTypes_1.ContainerMessageType.GC: {
|
|
1535
1538
|
return false;
|
|
1536
1539
|
}
|
|
1540
|
+
default:
|
|
1541
|
+
break;
|
|
1537
1542
|
}
|
|
1538
1543
|
return true;
|
|
1539
1544
|
}
|
|
@@ -1824,10 +1829,10 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1824
1829
|
properties: { all: { safeSummary: true } },
|
|
1825
1830
|
}));
|
|
1826
1831
|
}
|
|
1827
|
-
// If there are pending
|
|
1828
|
-
// incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
1829
|
-
// within the timeout, check if it should be failed or can continue.
|
|
1830
|
-
if (this.validateSummaryBeforeUpload && this.
|
|
1832
|
+
// If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
|
|
1833
|
+
// and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
1834
|
+
// saved within the timeout, check if it should be failed or can continue.
|
|
1835
|
+
if (this.validateSummaryBeforeUpload && this.isDirty) {
|
|
1831
1836
|
const countBefore = this.pendingMessagesCount;
|
|
1832
1837
|
// The timeout for waiting for pending ops can be overridden via configurations.
|
|
1833
1838
|
const pendingOpsTimeout = this.mc.config.getNumber("Fluid.Summarizer.waitForPendingOpsTimeoutMs") ??
|
|
@@ -1847,7 +1852,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1847
1852
|
// happens, whether we attempted to wait for these ops to be acked and what was the result.
|
|
1848
1853
|
summaryNumberLogger.sendTelemetryEvent({
|
|
1849
1854
|
eventName: "PendingOpsWhileSummarizing",
|
|
1850
|
-
saved: this.
|
|
1855
|
+
saved: !this.isDirty,
|
|
1851
1856
|
timeout: pendingOpsTimeout,
|
|
1852
1857
|
countBefore,
|
|
1853
1858
|
countAfter: this.pendingMessagesCount,
|
|
@@ -2072,7 +2077,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2072
2077
|
}
|
|
2073
2078
|
}
|
|
2074
2079
|
/**
|
|
2075
|
-
* This helper is called during summarization. If
|
|
2080
|
+
* This helper is called during summarization. If the container is dirty, it will return a failed summarize result
|
|
2076
2081
|
* (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
|
|
2077
2082
|
* @param logger - The logger to be used for sending telemetry.
|
|
2078
2083
|
* @param referenceSequenceNumber - The reference sequence number of the summary attempt.
|
|
@@ -2082,7 +2087,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2082
2087
|
* @returns failed summarize result (IBaseSummarizeResult) if summary should be failed, undefined otherwise.
|
|
2083
2088
|
*/
|
|
2084
2089
|
async shouldFailSummaryOnPendingOps(logger, referenceSequenceNumber, minimumSequenceNumber, finalAttempt, beforeSummaryGeneration) {
|
|
2085
|
-
if (!this.
|
|
2090
|
+
if (!this.isDirty) {
|
|
2086
2091
|
return;
|
|
2087
2092
|
}
|
|
2088
2093
|
// If "SkipFailingIncorrectSummary" option is true, don't fail the summary in the last attempt.
|
|
@@ -2174,12 +2179,12 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2174
2179
|
contents: JSON.stringify(idAllocationMessage),
|
|
2175
2180
|
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
2176
2181
|
metadata: undefined,
|
|
2177
|
-
localOpMetadata:
|
|
2182
|
+
localOpMetadata: undefined,
|
|
2178
2183
|
type: messageTypes_1.ContainerMessageType.IdAllocation,
|
|
2179
2184
|
};
|
|
2180
2185
|
}
|
|
2181
2186
|
if (idAllocationBatchMessage !== undefined) {
|
|
2182
|
-
this.outbox.
|
|
2187
|
+
this.outbox.submitIdAllocation(idAllocationBatchMessage);
|
|
2183
2188
|
}
|
|
2184
2189
|
}
|
|
2185
2190
|
}
|
|
@@ -2352,6 +2357,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2352
2357
|
/**
|
|
2353
2358
|
* Finds the right store and asks it to resubmit the message. This typically happens when we
|
|
2354
2359
|
* reconnect and there are pending messages.
|
|
2360
|
+
* ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
|
|
2355
2361
|
* @param message - The original LocalContainerRuntimeMessage.
|
|
2356
2362
|
* @param localOpMetadata - The local metadata associated with the original message.
|
|
2357
2363
|
*/
|
|
@@ -2364,10 +2370,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2364
2370
|
break;
|
|
2365
2371
|
case messageTypes_1.ContainerMessageType.Attach:
|
|
2366
2372
|
case messageTypes_1.ContainerMessageType.Alias:
|
|
2367
|
-
this.submit(message, localOpMetadata);
|
|
2368
|
-
break;
|
|
2369
2373
|
case messageTypes_1.ContainerMessageType.IdAllocation: {
|
|
2370
|
-
prepareLocalContainerRuntimeIdAllocationMessageForTransit(message);
|
|
2371
2374
|
this.submit(message, localOpMetadata);
|
|
2372
2375
|
break;
|
|
2373
2376
|
}
|
|
@@ -2379,6 +2382,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2379
2382
|
case messageTypes_1.ContainerMessageType.Rejoin:
|
|
2380
2383
|
this.submit(message);
|
|
2381
2384
|
break;
|
|
2385
|
+
case messageTypes_1.ContainerMessageType.GC:
|
|
2386
|
+
// GC op is only sent in summarizer which should never reconnect.
|
|
2387
|
+
throw new telemetry_utils_1.LoggingError("GC op not expected to be resubmitted in summarizer");
|
|
2382
2388
|
default: {
|
|
2383
2389
|
// This case should be very rare - it would imply an op was stashed from a
|
|
2384
2390
|
// future version of runtime code and now is being applied on an older version
|
|
@@ -2520,7 +2526,11 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2520
2526
|
notifyImminentClosure: props?.notifyImminentClosure,
|
|
2521
2527
|
}, async (event) => {
|
|
2522
2528
|
this.verifyNotClosed();
|
|
2523
|
-
|
|
2529
|
+
// in case imminentClosure is set to true by future code, we don't
|
|
2530
|
+
// try to change its value
|
|
2531
|
+
if (!this.imminentClosure) {
|
|
2532
|
+
this.imminentClosure = props?.notifyImminentClosure ?? this.imminentClosure;
|
|
2533
|
+
}
|
|
2524
2534
|
const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
|
|
2525
2535
|
if (this._orderSequentiallyCalls !== 0) {
|
|
2526
2536
|
throw new telemetry_utils_1.UsageError("can't get state during orderSequentially");
|
|
@@ -2529,16 +2539,18 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2529
2539
|
// getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
|
|
2530
2540
|
// to close current batch.
|
|
2531
2541
|
this.flush();
|
|
2532
|
-
const pendingAttachmentBlobs =
|
|
2542
|
+
const pendingAttachmentBlobs = this.imminentClosure
|
|
2533
2543
|
? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
|
|
2534
2544
|
: undefined;
|
|
2535
2545
|
const pending = this.pendingStateManager.getLocalState();
|
|
2536
2546
|
if (!pendingAttachmentBlobs && !this.hasPendingMessages()) {
|
|
2537
2547
|
return; // no pending state to save
|
|
2538
2548
|
}
|
|
2549
|
+
const pendingIdCompressorState = this.idCompressor?.serialize(true);
|
|
2539
2550
|
const pendingState = {
|
|
2540
2551
|
pending,
|
|
2541
2552
|
pendingAttachmentBlobs,
|
|
2553
|
+
pendingIdCompressorState,
|
|
2542
2554
|
};
|
|
2543
2555
|
event.end({
|
|
2544
2556
|
attachmentBlobsSize: Object.keys(pendingAttachmentBlobs ?? {}).length,
|