@fluidframework/container-runtime 2.0.0-internal.7.3.0 → 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 +18 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +9 -1
- package/api-report/container-runtime.api.md +124 -107
- package/dist/blobManager.d.ts +4 -4
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.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 +30 -30
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +62 -40
- 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 +15 -7
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +6 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +1 -1
- package/dist/opLifecycle/definitions.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 -0
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +1 -0
- package/dist/pendingStateManager.js.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/lib/blobManager.d.ts +4 -4
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.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 +30 -30
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +64 -42
- 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 +15 -7
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +6 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +1 -1
- package/lib/opLifecycle/definitions.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 -0
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +1 -0
- package/lib/pendingStateManager.js.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 +42 -19
- package/src/blobManager.ts +5 -5
- package/src/containerRuntime.ts +86 -56
- 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 +19 -4
- package/src/opLifecycle/definitions.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +1 -0
- 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/src/containerRuntime.ts
CHANGED
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
wrapError,
|
|
48
48
|
ITelemetryLoggerExt,
|
|
49
49
|
UsageError,
|
|
50
|
+
LoggingError,
|
|
50
51
|
} from "@fluidframework/telemetry-utils";
|
|
51
52
|
import {
|
|
52
53
|
DriverHeader,
|
|
@@ -87,12 +88,14 @@ import {
|
|
|
87
88
|
channelsTreeName,
|
|
88
89
|
IDataStore,
|
|
89
90
|
ITelemetryContext,
|
|
91
|
+
} from "@fluidframework/runtime-definitions";
|
|
92
|
+
import type {
|
|
90
93
|
SerializedIdCompressorWithNoSession,
|
|
91
94
|
IIdCompressor,
|
|
92
95
|
IIdCompressorCore,
|
|
93
96
|
IdCreationRange,
|
|
94
97
|
SerializedIdCompressorWithOngoingSession,
|
|
95
|
-
} from "@fluidframework/
|
|
98
|
+
} from "@fluidframework/id-compressor";
|
|
96
99
|
import {
|
|
97
100
|
addBlobToSummary,
|
|
98
101
|
addSummarizeResultToSummary,
|
|
@@ -163,7 +166,7 @@ import { formExponentialFn, Throttler } from "./throttler";
|
|
|
163
166
|
import {
|
|
164
167
|
GarbageCollector,
|
|
165
168
|
GCNodeType,
|
|
166
|
-
|
|
169
|
+
gcGenerationOptionName,
|
|
167
170
|
IGarbageCollector,
|
|
168
171
|
IGCRuntimeOptions,
|
|
169
172
|
IGCStats,
|
|
@@ -194,6 +197,7 @@ import {
|
|
|
194
197
|
type LocalContainerRuntimeMessage,
|
|
195
198
|
type OutboundContainerRuntimeMessage,
|
|
196
199
|
type UnknownContainerRuntimeMessage,
|
|
200
|
+
ContainerRuntimeGCMessage,
|
|
197
201
|
} from "./messageTypes";
|
|
198
202
|
|
|
199
203
|
/**
|
|
@@ -213,7 +217,7 @@ function compatBehaviorAllowsMessageType(
|
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
/**
|
|
216
|
-
* @
|
|
220
|
+
* @alpha
|
|
217
221
|
*/
|
|
218
222
|
export interface ISummaryBaseConfiguration {
|
|
219
223
|
/**
|
|
@@ -235,7 +239,7 @@ export interface ISummaryBaseConfiguration {
|
|
|
235
239
|
}
|
|
236
240
|
|
|
237
241
|
/**
|
|
238
|
-
* @
|
|
242
|
+
* @alpha
|
|
239
243
|
*/
|
|
240
244
|
export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
|
|
241
245
|
state: "enabled";
|
|
@@ -298,21 +302,21 @@ export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfigurati
|
|
|
298
302
|
}
|
|
299
303
|
|
|
300
304
|
/**
|
|
301
|
-
* @
|
|
305
|
+
* @alpha
|
|
302
306
|
*/
|
|
303
307
|
export interface ISummaryConfigurationDisableSummarizer {
|
|
304
308
|
state: "disabled";
|
|
305
309
|
}
|
|
306
310
|
|
|
307
311
|
/**
|
|
308
|
-
* @
|
|
312
|
+
* @alpha
|
|
309
313
|
*/
|
|
310
314
|
export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
|
|
311
315
|
state: "disableHeuristics";
|
|
312
316
|
}
|
|
313
317
|
|
|
314
318
|
/**
|
|
315
|
-
* @
|
|
319
|
+
* @alpha
|
|
316
320
|
*/
|
|
317
321
|
export type ISummaryConfiguration =
|
|
318
322
|
| ISummaryConfigurationDisableSummarizer
|
|
@@ -320,7 +324,7 @@ export type ISummaryConfiguration =
|
|
|
320
324
|
| ISummaryConfigurationHeuristics;
|
|
321
325
|
|
|
322
326
|
/**
|
|
323
|
-
* @
|
|
327
|
+
* @internal
|
|
324
328
|
*/
|
|
325
329
|
export const DefaultSummaryConfiguration: ISummaryConfiguration = {
|
|
326
330
|
state: "enabled",
|
|
@@ -349,7 +353,7 @@ export const DefaultSummaryConfiguration: ISummaryConfiguration = {
|
|
|
349
353
|
};
|
|
350
354
|
|
|
351
355
|
/**
|
|
352
|
-
* @
|
|
356
|
+
* @alpha
|
|
353
357
|
*/
|
|
354
358
|
export interface ISummaryRuntimeOptions {
|
|
355
359
|
/** Override summary configurations set by the server. */
|
|
@@ -366,7 +370,7 @@ export interface ISummaryRuntimeOptions {
|
|
|
366
370
|
|
|
367
371
|
/**
|
|
368
372
|
* Options for op compression.
|
|
369
|
-
* @
|
|
373
|
+
* @alpha
|
|
370
374
|
*/
|
|
371
375
|
export interface ICompressionRuntimeOptions {
|
|
372
376
|
/**
|
|
@@ -384,7 +388,7 @@ export interface ICompressionRuntimeOptions {
|
|
|
384
388
|
|
|
385
389
|
/**
|
|
386
390
|
* Options for container runtime.
|
|
387
|
-
* @
|
|
391
|
+
* @alpha
|
|
388
392
|
*/
|
|
389
393
|
export interface IContainerRuntimeOptions {
|
|
390
394
|
readonly summaryOptions?: ISummaryRuntimeOptions;
|
|
@@ -466,7 +470,7 @@ export interface IContainerRuntimeOptions {
|
|
|
466
470
|
|
|
467
471
|
/**
|
|
468
472
|
* Accepted header keys for requests coming to the runtime.
|
|
469
|
-
* @
|
|
473
|
+
* @internal
|
|
470
474
|
*/
|
|
471
475
|
export enum RuntimeHeaders {
|
|
472
476
|
/** True to wait for a data store to be created and loaded before returning it. */
|
|
@@ -476,23 +480,23 @@ export enum RuntimeHeaders {
|
|
|
476
480
|
}
|
|
477
481
|
|
|
478
482
|
/** True if a tombstoned object should be returned without erroring
|
|
479
|
-
* @
|
|
483
|
+
* @internal
|
|
480
484
|
*/
|
|
481
485
|
export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
|
|
482
486
|
/**
|
|
483
487
|
* [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
|
|
484
|
-
* @
|
|
488
|
+
* @internal
|
|
485
489
|
*/
|
|
486
490
|
export const AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
|
|
487
491
|
|
|
488
492
|
/**
|
|
489
493
|
* Tombstone error responses will have this header set to true
|
|
490
|
-
* @
|
|
494
|
+
* @internal
|
|
491
495
|
*/
|
|
492
496
|
export const TombstoneResponseHeaderKey = "isTombstoned";
|
|
493
497
|
/**
|
|
494
498
|
* Inactive error responses will have this header set to true
|
|
495
|
-
* @
|
|
499
|
+
* @internal
|
|
496
500
|
*/
|
|
497
501
|
export const InactiveResponseHeaderKey = "isInactive";
|
|
498
502
|
|
|
@@ -516,7 +520,7 @@ export const defaultRuntimeHeaderData: Required<RuntimeHeaderData> = {
|
|
|
516
520
|
|
|
517
521
|
/**
|
|
518
522
|
* Available compression algorithms for op compression.
|
|
519
|
-
* @
|
|
523
|
+
* @alpha
|
|
520
524
|
*/
|
|
521
525
|
export enum CompressionAlgorithms {
|
|
522
526
|
lz4 = "lz4",
|
|
@@ -585,7 +589,7 @@ const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
|
|
|
585
589
|
|
|
586
590
|
/**
|
|
587
591
|
* @deprecated use ContainerRuntimeMessageType instead
|
|
588
|
-
* @
|
|
592
|
+
* @internal
|
|
589
593
|
*/
|
|
590
594
|
export enum RuntimeMessage {
|
|
591
595
|
FluidDataStoreOp = "component",
|
|
@@ -599,7 +603,7 @@ export enum RuntimeMessage {
|
|
|
599
603
|
|
|
600
604
|
/**
|
|
601
605
|
* @deprecated please use version in driver-utils
|
|
602
|
-
* @
|
|
606
|
+
* @internal
|
|
603
607
|
*/
|
|
604
608
|
export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean {
|
|
605
609
|
return (Object.values(RuntimeMessage) as string[]).includes(message.type);
|
|
@@ -609,7 +613,7 @@ export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean {
|
|
|
609
613
|
* Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
|
|
610
614
|
* special-case for document dirty state. Ultimately we should have no special-cases from the
|
|
611
615
|
* ContainerRuntime's perspective.
|
|
612
|
-
* @
|
|
616
|
+
* @internal
|
|
613
617
|
*/
|
|
614
618
|
export const agentSchedulerId = "_scheduler";
|
|
615
619
|
|
|
@@ -718,7 +722,7 @@ export async function TEST_requestSummarizer(loader: ILoader, url: string): Prom
|
|
|
718
722
|
/**
|
|
719
723
|
* Represents the runtime of the container. Contains helper functions/state of the container.
|
|
720
724
|
* It will define the store level mappings.
|
|
721
|
-
* @
|
|
725
|
+
* @alpha
|
|
722
726
|
*/
|
|
723
727
|
export class ContainerRuntime
|
|
724
728
|
extends TypedEventEmitter<IContainerRuntimeEvents & ISummarizerEvents>
|
|
@@ -909,16 +913,18 @@ export class ContainerRuntime
|
|
|
909
913
|
metadata?.idCompressorEnabled ?? runtimeOptions.enableRuntimeIdCompressor ?? false;
|
|
910
914
|
let idCompressor: (IIdCompressor & IIdCompressorCore) | undefined;
|
|
911
915
|
if (idCompressorEnabled) {
|
|
912
|
-
const {
|
|
916
|
+
const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import(
|
|
917
|
+
"@fluidframework/id-compressor"
|
|
918
|
+
);
|
|
913
919
|
|
|
914
920
|
const pendingLocalState = context.pendingLocalState as IPendingRuntimeState;
|
|
915
921
|
|
|
916
922
|
if (pendingLocalState?.pendingIdCompressorState !== undefined) {
|
|
917
|
-
idCompressor =
|
|
923
|
+
idCompressor = deserializeIdCompressor(pendingLocalState.pendingIdCompressorState);
|
|
918
924
|
} else if (serializedIdCompressor !== undefined) {
|
|
919
|
-
idCompressor =
|
|
925
|
+
idCompressor = deserializeIdCompressor(serializedIdCompressor, createSessionId());
|
|
920
926
|
} else {
|
|
921
|
-
idCompressor =
|
|
927
|
+
idCompressor = createIdCompressor(logger);
|
|
922
928
|
}
|
|
923
929
|
}
|
|
924
930
|
|
|
@@ -963,6 +969,7 @@ export class ContainerRuntime
|
|
|
963
969
|
}
|
|
964
970
|
|
|
965
971
|
public readonly options: ILoaderOptions;
|
|
972
|
+
private imminentClosure: boolean = false;
|
|
966
973
|
|
|
967
974
|
private readonly _getClientId: () => string | undefined;
|
|
968
975
|
public get clientId(): string | undefined {
|
|
@@ -1214,9 +1221,7 @@ export class ContainerRuntime
|
|
|
1214
1221
|
*/
|
|
1215
1222
|
private readonly loadedFromVersionId: string | undefined;
|
|
1216
1223
|
|
|
1217
|
-
|
|
1218
|
-
* @internal
|
|
1219
|
-
*/
|
|
1224
|
+
/***/
|
|
1220
1225
|
protected constructor(
|
|
1221
1226
|
context: IContainerContext,
|
|
1222
1227
|
private readonly registry: IFluidDataStoreRegistry,
|
|
@@ -1342,8 +1347,7 @@ export class ContainerRuntime
|
|
|
1342
1347
|
eventName: "GCFeatureMatrix",
|
|
1343
1348
|
metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
|
|
1344
1349
|
inputs: JSON.stringify({
|
|
1345
|
-
|
|
1346
|
-
this.runtimeOptions.gcOptions[gcTombstoneGenerationOptionName],
|
|
1350
|
+
gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gcGenerationOptionName],
|
|
1347
1351
|
}),
|
|
1348
1352
|
});
|
|
1349
1353
|
|
|
@@ -1448,6 +1452,7 @@ export class ContainerRuntime
|
|
|
1448
1452
|
// GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
|
|
1449
1453
|
// delta manager would always return false for summarizer client.
|
|
1450
1454
|
activeConnection: () => this.innerDeltaManager.active,
|
|
1455
|
+
submitMessage: (message: ContainerRuntimeGCMessage) => this.submit(message),
|
|
1451
1456
|
});
|
|
1452
1457
|
|
|
1453
1458
|
const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
|
|
@@ -2083,6 +2088,9 @@ export class ContainerRuntime
|
|
|
2083
2088
|
throw new Error("chunkedOp not expected here");
|
|
2084
2089
|
case ContainerMessageType.Rejoin:
|
|
2085
2090
|
throw new Error("rejoin not expected here");
|
|
2091
|
+
case ContainerMessageType.GC:
|
|
2092
|
+
// GC op is only sent in summarizer which should never have stashed ops.
|
|
2093
|
+
throw new LoggingError("GC op not expected to be stashed in summarizer");
|
|
2086
2094
|
default: {
|
|
2087
2095
|
// This should be extremely rare for stashed ops.
|
|
2088
2096
|
// It would require a newer runtime stashing ops and then an older one applying them,
|
|
@@ -2336,6 +2344,9 @@ export class ContainerRuntime
|
|
|
2336
2344
|
this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
|
|
2337
2345
|
}
|
|
2338
2346
|
break;
|
|
2347
|
+
case ContainerMessageType.GC:
|
|
2348
|
+
this.garbageCollector.processMessage(messageWithContext.message, local);
|
|
2349
|
+
break;
|
|
2339
2350
|
case ContainerMessageType.ChunkedOp:
|
|
2340
2351
|
case ContainerMessageType.Rejoin:
|
|
2341
2352
|
break;
|
|
@@ -2582,7 +2593,6 @@ export class ContainerRuntime
|
|
|
2582
2593
|
|
|
2583
2594
|
/**
|
|
2584
2595
|
* @deprecated 0.16 Issue #1537, #3631
|
|
2585
|
-
* @internal
|
|
2586
2596
|
*/
|
|
2587
2597
|
public async _createDataStoreWithProps(
|
|
2588
2598
|
pkg: string | string[],
|
|
@@ -2603,7 +2613,9 @@ export class ContainerRuntime
|
|
|
2603
2613
|
private canSendOps() {
|
|
2604
2614
|
// Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
|
|
2605
2615
|
// container runtime's ability to send ops depend on the actual readonly state of the delta manager.
|
|
2606
|
-
return
|
|
2616
|
+
return (
|
|
2617
|
+
this.connected && !this.innerDeltaManager.readOnlyInfo.readonly && !this.imminentClosure
|
|
2618
|
+
);
|
|
2607
2619
|
}
|
|
2608
2620
|
|
|
2609
2621
|
/**
|
|
@@ -2632,18 +2644,28 @@ export class ContainerRuntime
|
|
|
2632
2644
|
}
|
|
2633
2645
|
|
|
2634
2646
|
private isContainerMessageDirtyable({ type, contents }: OutboundContainerRuntimeMessage) {
|
|
2635
|
-
//
|
|
2636
|
-
//
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2647
|
+
// Certain container runtime messages should not mark the container dirty such as the old built-in
|
|
2648
|
+
// AgentScheduler and Garbage collector messages.
|
|
2649
|
+
switch (type) {
|
|
2650
|
+
case ContainerMessageType.Attach: {
|
|
2651
|
+
const attachMessage = contents as InboundAttachMessage;
|
|
2652
|
+
if (attachMessage.id === agentSchedulerId) {
|
|
2653
|
+
return false;
|
|
2654
|
+
}
|
|
2655
|
+
break;
|
|
2641
2656
|
}
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2657
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
2658
|
+
const envelope = contents;
|
|
2659
|
+
if (envelope.address === agentSchedulerId) {
|
|
2660
|
+
return false;
|
|
2661
|
+
}
|
|
2662
|
+
break;
|
|
2663
|
+
}
|
|
2664
|
+
case ContainerMessageType.GC: {
|
|
2645
2665
|
return false;
|
|
2646
2666
|
}
|
|
2667
|
+
default:
|
|
2668
|
+
break;
|
|
2647
2669
|
}
|
|
2648
2670
|
return true;
|
|
2649
2671
|
}
|
|
@@ -2874,7 +2896,7 @@ export class ContainerRuntime
|
|
|
2874
2896
|
* @param usedRoutes - The routes that are used in all nodes in this Container.
|
|
2875
2897
|
* @see IGarbageCollectionRuntime.updateUsedRoutes
|
|
2876
2898
|
*/
|
|
2877
|
-
public updateUsedRoutes(usedRoutes: string[]) {
|
|
2899
|
+
public updateUsedRoutes(usedRoutes: readonly string[]) {
|
|
2878
2900
|
// Update our summarizer node's used routes. Updating used routes in summarizer node before
|
|
2879
2901
|
// summarizing is required and asserted by the the summarizer node. We are the root and are
|
|
2880
2902
|
// always referenced, so the used routes is only self-route (empty string).
|
|
@@ -2888,7 +2910,7 @@ export class ContainerRuntime
|
|
|
2888
2910
|
* This is called to update objects whose routes are unused.
|
|
2889
2911
|
* @param unusedRoutes - Data store and attachment blob routes that are unused in this Container.
|
|
2890
2912
|
*/
|
|
2891
|
-
public updateUnusedRoutes(unusedRoutes: string[]) {
|
|
2913
|
+
public updateUnusedRoutes(unusedRoutes: readonly string[]) {
|
|
2892
2914
|
const { blobManagerRoutes, dataStoreRoutes } =
|
|
2893
2915
|
this.getDataStoreAndBlobManagerRoutes(unusedRoutes);
|
|
2894
2916
|
this.blobManager.updateUnusedRoutes(blobManagerRoutes);
|
|
@@ -2898,7 +2920,7 @@ export class ContainerRuntime
|
|
|
2898
2920
|
/**
|
|
2899
2921
|
* @deprecated Replaced by deleteSweepReadyNodes.
|
|
2900
2922
|
*/
|
|
2901
|
-
public deleteUnusedNodes(unusedRoutes: string[]): string[] {
|
|
2923
|
+
public deleteUnusedNodes(unusedRoutes: readonly string[]): string[] {
|
|
2902
2924
|
throw new Error("deleteUnusedRoutes should not be called");
|
|
2903
2925
|
}
|
|
2904
2926
|
|
|
@@ -2907,7 +2929,7 @@ export class ContainerRuntime
|
|
|
2907
2929
|
* @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
|
|
2908
2930
|
* @returns The routes of nodes that were deleted.
|
|
2909
2931
|
*/
|
|
2910
|
-
public deleteSweepReadyNodes(sweepReadyRoutes: string[]): string[] {
|
|
2932
|
+
public deleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[] {
|
|
2911
2933
|
const { dataStoreRoutes, blobManagerRoutes } =
|
|
2912
2934
|
this.getDataStoreAndBlobManagerRoutes(sweepReadyRoutes);
|
|
2913
2935
|
|
|
@@ -2919,7 +2941,7 @@ export class ContainerRuntime
|
|
|
2919
2941
|
* This is called to update objects that are tombstones.
|
|
2920
2942
|
* @param tombstonedRoutes - Data store and attachment blob routes that are tombstones in this Container.
|
|
2921
2943
|
*/
|
|
2922
|
-
public updateTombstonedRoutes(tombstonedRoutes: string[]) {
|
|
2944
|
+
public updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {
|
|
2923
2945
|
const { blobManagerRoutes, dataStoreRoutes } =
|
|
2924
2946
|
this.getDataStoreAndBlobManagerRoutes(tombstonedRoutes);
|
|
2925
2947
|
this.blobManager.updateTombstonedRoutes(blobManagerRoutes);
|
|
@@ -2979,7 +3001,7 @@ export class ContainerRuntime
|
|
|
2979
3001
|
* @returns Two route lists - One that contains routes for blob manager and another one that contains routes
|
|
2980
3002
|
* for data stores.
|
|
2981
3003
|
*/
|
|
2982
|
-
private getDataStoreAndBlobManagerRoutes(routes: string[]) {
|
|
3004
|
+
private getDataStoreAndBlobManagerRoutes(routes: readonly string[]) {
|
|
2983
3005
|
const blobManagerRoutes: string[] = [];
|
|
2984
3006
|
const dataStoreRoutes: string[] = [];
|
|
2985
3007
|
for (const route of routes) {
|
|
@@ -3056,10 +3078,10 @@ export class ContainerRuntime
|
|
|
3056
3078
|
);
|
|
3057
3079
|
}
|
|
3058
3080
|
|
|
3059
|
-
// If there are pending
|
|
3060
|
-
// incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
3061
|
-
// within the timeout, check if it should be failed or can continue.
|
|
3062
|
-
if (this.validateSummaryBeforeUpload && this.
|
|
3081
|
+
// If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
|
|
3082
|
+
// and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
3083
|
+
// saved within the timeout, check if it should be failed or can continue.
|
|
3084
|
+
if (this.validateSummaryBeforeUpload && this.isDirty) {
|
|
3063
3085
|
const countBefore = this.pendingMessagesCount;
|
|
3064
3086
|
// The timeout for waiting for pending ops can be overridden via configurations.
|
|
3065
3087
|
const pendingOpsTimeout =
|
|
@@ -3081,7 +3103,7 @@ export class ContainerRuntime
|
|
|
3081
3103
|
// happens, whether we attempted to wait for these ops to be acked and what was the result.
|
|
3082
3104
|
summaryNumberLogger.sendTelemetryEvent({
|
|
3083
3105
|
eventName: "PendingOpsWhileSummarizing",
|
|
3084
|
-
saved: this.
|
|
3106
|
+
saved: !this.isDirty,
|
|
3085
3107
|
timeout: pendingOpsTimeout,
|
|
3086
3108
|
countBefore,
|
|
3087
3109
|
countAfter: this.pendingMessagesCount,
|
|
@@ -3360,7 +3382,7 @@ export class ContainerRuntime
|
|
|
3360
3382
|
}
|
|
3361
3383
|
|
|
3362
3384
|
/**
|
|
3363
|
-
* This helper is called during summarization. If
|
|
3385
|
+
* This helper is called during summarization. If the container is dirty, it will return a failed summarize result
|
|
3364
3386
|
* (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
|
|
3365
3387
|
* @param logger - The logger to be used for sending telemetry.
|
|
3366
3388
|
* @param referenceSequenceNumber - The reference sequence number of the summary attempt.
|
|
@@ -3376,7 +3398,7 @@ export class ContainerRuntime
|
|
|
3376
3398
|
finalAttempt: boolean,
|
|
3377
3399
|
beforeSummaryGeneration: boolean,
|
|
3378
3400
|
): Promise<IBaseSummarizeResult | undefined> {
|
|
3379
|
-
if (!this.
|
|
3401
|
+
if (!this.isDirty) {
|
|
3380
3402
|
return;
|
|
3381
3403
|
}
|
|
3382
3404
|
|
|
@@ -3724,6 +3746,7 @@ export class ContainerRuntime
|
|
|
3724
3746
|
/**
|
|
3725
3747
|
* Finds the right store and asks it to resubmit the message. This typically happens when we
|
|
3726
3748
|
* reconnect and there are pending messages.
|
|
3749
|
+
* ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
|
|
3727
3750
|
* @param message - The original LocalContainerRuntimeMessage.
|
|
3728
3751
|
* @param localOpMetadata - The local metadata associated with the original message.
|
|
3729
3752
|
*/
|
|
@@ -3752,6 +3775,9 @@ export class ContainerRuntime
|
|
|
3752
3775
|
case ContainerMessageType.Rejoin:
|
|
3753
3776
|
this.submit(message);
|
|
3754
3777
|
break;
|
|
3778
|
+
case ContainerMessageType.GC:
|
|
3779
|
+
// GC op is only sent in summarizer which should never reconnect.
|
|
3780
|
+
throw new LoggingError("GC op not expected to be resubmitted in summarizer");
|
|
3755
3781
|
default: {
|
|
3756
3782
|
// This case should be very rare - it would imply an op was stashed from a
|
|
3757
3783
|
// future version of runtime code and now is being applied on an older version
|
|
@@ -3963,7 +3989,11 @@ export class ContainerRuntime
|
|
|
3963
3989
|
},
|
|
3964
3990
|
async (event) => {
|
|
3965
3991
|
this.verifyNotClosed();
|
|
3966
|
-
|
|
3992
|
+
// in case imminentClosure is set to true by future code, we don't
|
|
3993
|
+
// try to change its value
|
|
3994
|
+
if (!this.imminentClosure) {
|
|
3995
|
+
this.imminentClosure = props?.notifyImminentClosure ?? this.imminentClosure;
|
|
3996
|
+
}
|
|
3967
3997
|
const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
|
|
3968
3998
|
if (this._orderSequentiallyCalls !== 0) {
|
|
3969
3999
|
throw new UsageError("can't get state during orderSequentially");
|
|
@@ -3972,7 +4002,7 @@ export class ContainerRuntime
|
|
|
3972
4002
|
// getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
|
|
3973
4003
|
// to close current batch.
|
|
3974
4004
|
this.flush();
|
|
3975
|
-
const pendingAttachmentBlobs =
|
|
4005
|
+
const pendingAttachmentBlobs = this.imminentClosure
|
|
3976
4006
|
? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
|
|
3977
4007
|
: undefined;
|
|
3978
4008
|
const pending = this.pendingStateManager.getLocalState();
|