@fluidframework/container-runtime 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.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 +50 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +9 -1
- package/api-report/container-runtime.api.md +123 -123
- 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 +1444 -0
- package/dist/container-runtime-beta.d.ts +292 -0
- package/dist/container-runtime-public.d.ts +292 -0
- package/dist/container-runtime-untrimmed.d.ts +1792 -0
- package/dist/containerRuntime.d.ts +36 -66
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +68 -104
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +0 -12
- package/dist/dataStore.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 +15 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -6
- 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 -13
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +1 -47
- 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 +1444 -0
- package/lib/container-runtime-beta.d.ts +292 -0
- package/lib/container-runtime-public.d.ts +292 -0
- package/lib/container-runtime-untrimmed.d.ts +1792 -0
- package/lib/containerRuntime.d.ts +36 -66
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +69 -104
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +0 -12
- package/lib/dataStore.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 +15 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +16 -2
- 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 -13
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +1 -47
- 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 +46 -19
- package/src/blobManager.ts +5 -5
- package/src/containerRuntime.ts +93 -141
- package/src/dataStore.ts +1 -15
- 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 -2
- 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 +2 -51
- 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
|
@@ -8,8 +8,6 @@ import {
|
|
|
8
8
|
FluidObject,
|
|
9
9
|
IFluidHandle,
|
|
10
10
|
IFluidHandleContext,
|
|
11
|
-
// eslint-disable-next-line import/no-deprecated
|
|
12
|
-
IFluidRouter,
|
|
13
11
|
IRequest,
|
|
14
12
|
IResponse,
|
|
15
13
|
IProvideFluidHandleContext,
|
|
@@ -47,6 +45,7 @@ import {
|
|
|
47
45
|
wrapError,
|
|
48
46
|
ITelemetryLoggerExt,
|
|
49
47
|
UsageError,
|
|
48
|
+
LoggingError,
|
|
50
49
|
} from "@fluidframework/telemetry-utils";
|
|
51
50
|
import {
|
|
52
51
|
DriverHeader,
|
|
@@ -87,12 +86,14 @@ import {
|
|
|
87
86
|
channelsTreeName,
|
|
88
87
|
IDataStore,
|
|
89
88
|
ITelemetryContext,
|
|
89
|
+
} from "@fluidframework/runtime-definitions";
|
|
90
|
+
import type {
|
|
90
91
|
SerializedIdCompressorWithNoSession,
|
|
91
92
|
IIdCompressor,
|
|
92
93
|
IIdCompressorCore,
|
|
93
94
|
IdCreationRange,
|
|
94
95
|
SerializedIdCompressorWithOngoingSession,
|
|
95
|
-
} from "@fluidframework/
|
|
96
|
+
} from "@fluidframework/id-compressor";
|
|
96
97
|
import {
|
|
97
98
|
addBlobToSummary,
|
|
98
99
|
addSummarizeResultToSummary,
|
|
@@ -163,7 +164,7 @@ import { formExponentialFn, Throttler } from "./throttler";
|
|
|
163
164
|
import {
|
|
164
165
|
GarbageCollector,
|
|
165
166
|
GCNodeType,
|
|
166
|
-
|
|
167
|
+
gcGenerationOptionName,
|
|
167
168
|
IGarbageCollector,
|
|
168
169
|
IGCRuntimeOptions,
|
|
169
170
|
IGCStats,
|
|
@@ -194,6 +195,7 @@ import {
|
|
|
194
195
|
type LocalContainerRuntimeMessage,
|
|
195
196
|
type OutboundContainerRuntimeMessage,
|
|
196
197
|
type UnknownContainerRuntimeMessage,
|
|
198
|
+
ContainerRuntimeGCMessage,
|
|
197
199
|
} from "./messageTypes";
|
|
198
200
|
|
|
199
201
|
/**
|
|
@@ -213,7 +215,7 @@ function compatBehaviorAllowsMessageType(
|
|
|
213
215
|
}
|
|
214
216
|
|
|
215
217
|
/**
|
|
216
|
-
* @
|
|
218
|
+
* @alpha
|
|
217
219
|
*/
|
|
218
220
|
export interface ISummaryBaseConfiguration {
|
|
219
221
|
/**
|
|
@@ -235,7 +237,7 @@ export interface ISummaryBaseConfiguration {
|
|
|
235
237
|
}
|
|
236
238
|
|
|
237
239
|
/**
|
|
238
|
-
* @
|
|
240
|
+
* @alpha
|
|
239
241
|
*/
|
|
240
242
|
export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
|
|
241
243
|
state: "enabled";
|
|
@@ -298,21 +300,21 @@ export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfigurati
|
|
|
298
300
|
}
|
|
299
301
|
|
|
300
302
|
/**
|
|
301
|
-
* @
|
|
303
|
+
* @alpha
|
|
302
304
|
*/
|
|
303
305
|
export interface ISummaryConfigurationDisableSummarizer {
|
|
304
306
|
state: "disabled";
|
|
305
307
|
}
|
|
306
308
|
|
|
307
309
|
/**
|
|
308
|
-
* @
|
|
310
|
+
* @alpha
|
|
309
311
|
*/
|
|
310
312
|
export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
|
|
311
313
|
state: "disableHeuristics";
|
|
312
314
|
}
|
|
313
315
|
|
|
314
316
|
/**
|
|
315
|
-
* @
|
|
317
|
+
* @alpha
|
|
316
318
|
*/
|
|
317
319
|
export type ISummaryConfiguration =
|
|
318
320
|
| ISummaryConfigurationDisableSummarizer
|
|
@@ -320,7 +322,7 @@ export type ISummaryConfiguration =
|
|
|
320
322
|
| ISummaryConfigurationHeuristics;
|
|
321
323
|
|
|
322
324
|
/**
|
|
323
|
-
* @
|
|
325
|
+
* @internal
|
|
324
326
|
*/
|
|
325
327
|
export const DefaultSummaryConfiguration: ISummaryConfiguration = {
|
|
326
328
|
state: "enabled",
|
|
@@ -349,7 +351,7 @@ export const DefaultSummaryConfiguration: ISummaryConfiguration = {
|
|
|
349
351
|
};
|
|
350
352
|
|
|
351
353
|
/**
|
|
352
|
-
* @
|
|
354
|
+
* @alpha
|
|
353
355
|
*/
|
|
354
356
|
export interface ISummaryRuntimeOptions {
|
|
355
357
|
/** Override summary configurations set by the server. */
|
|
@@ -366,7 +368,7 @@ export interface ISummaryRuntimeOptions {
|
|
|
366
368
|
|
|
367
369
|
/**
|
|
368
370
|
* Options for op compression.
|
|
369
|
-
* @
|
|
371
|
+
* @alpha
|
|
370
372
|
*/
|
|
371
373
|
export interface ICompressionRuntimeOptions {
|
|
372
374
|
/**
|
|
@@ -384,7 +386,7 @@ export interface ICompressionRuntimeOptions {
|
|
|
384
386
|
|
|
385
387
|
/**
|
|
386
388
|
* Options for container runtime.
|
|
387
|
-
* @
|
|
389
|
+
* @alpha
|
|
388
390
|
*/
|
|
389
391
|
export interface IContainerRuntimeOptions {
|
|
390
392
|
readonly summaryOptions?: ISummaryRuntimeOptions;
|
|
@@ -466,7 +468,7 @@ export interface IContainerRuntimeOptions {
|
|
|
466
468
|
|
|
467
469
|
/**
|
|
468
470
|
* Accepted header keys for requests coming to the runtime.
|
|
469
|
-
* @
|
|
471
|
+
* @internal
|
|
470
472
|
*/
|
|
471
473
|
export enum RuntimeHeaders {
|
|
472
474
|
/** True to wait for a data store to be created and loaded before returning it. */
|
|
@@ -476,23 +478,23 @@ export enum RuntimeHeaders {
|
|
|
476
478
|
}
|
|
477
479
|
|
|
478
480
|
/** True if a tombstoned object should be returned without erroring
|
|
479
|
-
* @
|
|
481
|
+
* @internal
|
|
480
482
|
*/
|
|
481
483
|
export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
|
|
482
484
|
/**
|
|
483
485
|
* [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
|
|
484
|
-
* @
|
|
486
|
+
* @internal
|
|
485
487
|
*/
|
|
486
488
|
export const AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
|
|
487
489
|
|
|
488
490
|
/**
|
|
489
491
|
* Tombstone error responses will have this header set to true
|
|
490
|
-
* @
|
|
492
|
+
* @internal
|
|
491
493
|
*/
|
|
492
494
|
export const TombstoneResponseHeaderKey = "isTombstoned";
|
|
493
495
|
/**
|
|
494
496
|
* Inactive error responses will have this header set to true
|
|
495
|
-
* @
|
|
497
|
+
* @internal
|
|
496
498
|
*/
|
|
497
499
|
export const InactiveResponseHeaderKey = "isInactive";
|
|
498
500
|
|
|
@@ -516,7 +518,7 @@ export const defaultRuntimeHeaderData: Required<RuntimeHeaderData> = {
|
|
|
516
518
|
|
|
517
519
|
/**
|
|
518
520
|
* Available compression algorithms for op compression.
|
|
519
|
-
* @
|
|
521
|
+
* @alpha
|
|
520
522
|
*/
|
|
521
523
|
export enum CompressionAlgorithms {
|
|
522
524
|
lz4 = "lz4",
|
|
@@ -585,7 +587,7 @@ const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
|
|
|
585
587
|
|
|
586
588
|
/**
|
|
587
589
|
* @deprecated use ContainerRuntimeMessageType instead
|
|
588
|
-
* @
|
|
590
|
+
* @internal
|
|
589
591
|
*/
|
|
590
592
|
export enum RuntimeMessage {
|
|
591
593
|
FluidDataStoreOp = "component",
|
|
@@ -599,7 +601,7 @@ export enum RuntimeMessage {
|
|
|
599
601
|
|
|
600
602
|
/**
|
|
601
603
|
* @deprecated please use version in driver-utils
|
|
602
|
-
* @
|
|
604
|
+
* @internal
|
|
603
605
|
*/
|
|
604
606
|
export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean {
|
|
605
607
|
return (Object.values(RuntimeMessage) as string[]).includes(message.type);
|
|
@@ -609,7 +611,7 @@ export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean {
|
|
|
609
611
|
* Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
|
|
610
612
|
* special-case for document dirty state. Ultimately we should have no special-cases from the
|
|
611
613
|
* ContainerRuntime's perspective.
|
|
612
|
-
* @
|
|
614
|
+
* @internal
|
|
613
615
|
*/
|
|
614
616
|
export const agentSchedulerId = "_scheduler";
|
|
615
617
|
|
|
@@ -694,7 +696,9 @@ async function createSummarizer(loader: ILoader, url: string): Promise<ISummariz
|
|
|
694
696
|
if (resolvedContainer.getEntryPoint !== undefined) {
|
|
695
697
|
fluidObject = await resolvedContainer.getEntryPoint();
|
|
696
698
|
} else {
|
|
697
|
-
const response = await resolvedContainer.request({
|
|
699
|
+
const response = await (resolvedContainer as any).request({
|
|
700
|
+
url: `/${summarizerRequestUrl}`,
|
|
701
|
+
});
|
|
698
702
|
if (response.status !== 200 || response.mimeType !== "fluid/object") {
|
|
699
703
|
throw responseToException(response, request);
|
|
700
704
|
}
|
|
@@ -707,18 +711,10 @@ async function createSummarizer(loader: ILoader, url: string): Promise<ISummariz
|
|
|
707
711
|
return fluidObject.ISummarizer;
|
|
708
712
|
}
|
|
709
713
|
|
|
710
|
-
/**
|
|
711
|
-
* This function is not supported publicly and exists for e2e testing
|
|
712
|
-
* @internal
|
|
713
|
-
*/
|
|
714
|
-
export async function TEST_requestSummarizer(loader: ILoader, url: string): Promise<ISummarizer> {
|
|
715
|
-
return createSummarizer(loader, url);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
714
|
/**
|
|
719
715
|
* Represents the runtime of the container. Contains helper functions/state of the container.
|
|
720
716
|
* It will define the store level mappings.
|
|
721
|
-
* @
|
|
717
|
+
* @alpha
|
|
722
718
|
*/
|
|
723
719
|
export class ContainerRuntime
|
|
724
720
|
extends TypedEventEmitter<IContainerRuntimeEvents & ISummarizerEvents>
|
|
@@ -729,53 +725,6 @@ export class ContainerRuntime
|
|
|
729
725
|
ISummarizerInternalsProvider,
|
|
730
726
|
IProvideFluidHandleContext
|
|
731
727
|
{
|
|
732
|
-
/**
|
|
733
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
734
|
-
*/
|
|
735
|
-
public get IFluidRouter() {
|
|
736
|
-
return this;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
/**
|
|
740
|
-
* @deprecated use loadRuntime instead.
|
|
741
|
-
* Load the stores from a snapshot and returns the runtime.
|
|
742
|
-
* @param context - Context of the container.
|
|
743
|
-
* @param registryEntries - Mapping to the stores.
|
|
744
|
-
* @param requestHandler - Request handlers for the container runtime
|
|
745
|
-
* @param runtimeOptions - Additional options to be passed to the runtime
|
|
746
|
-
* @param existing - (optional) When loading from an existing snapshot. Precedes context.existing if provided
|
|
747
|
-
* @param containerRuntimeCtor - (optional) Constructor to use to create the ContainerRuntime instance. This
|
|
748
|
-
* allows mixin classes to leverage this method to define their own async initializer.
|
|
749
|
-
*/
|
|
750
|
-
public static async load(
|
|
751
|
-
context: IContainerContext,
|
|
752
|
-
registryEntries: NamedFluidDataStoreRegistryEntries,
|
|
753
|
-
requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>,
|
|
754
|
-
runtimeOptions: IContainerRuntimeOptions = {},
|
|
755
|
-
containerScope: FluidObject = context.scope,
|
|
756
|
-
existing?: boolean,
|
|
757
|
-
containerRuntimeCtor: typeof ContainerRuntime = ContainerRuntime,
|
|
758
|
-
): Promise<ContainerRuntime> {
|
|
759
|
-
let existingFlag = true;
|
|
760
|
-
if (!existing) {
|
|
761
|
-
existingFlag = false;
|
|
762
|
-
}
|
|
763
|
-
return this.loadRuntime({
|
|
764
|
-
context,
|
|
765
|
-
registryEntries,
|
|
766
|
-
existing: existingFlag,
|
|
767
|
-
runtimeOptions,
|
|
768
|
-
containerScope,
|
|
769
|
-
containerRuntimeCtor,
|
|
770
|
-
requestHandler,
|
|
771
|
-
provideEntryPoint: () => {
|
|
772
|
-
throw new UsageError(
|
|
773
|
-
"ContainerRuntime.load is deprecated and should no longer be used",
|
|
774
|
-
);
|
|
775
|
-
},
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
|
|
779
728
|
/**
|
|
780
729
|
* Load the stores from a snapshot and returns the runtime.
|
|
781
730
|
* @param params - An object housing the runtime properties:
|
|
@@ -798,7 +747,7 @@ export class ContainerRuntime
|
|
|
798
747
|
runtimeOptions?: IContainerRuntimeOptions;
|
|
799
748
|
containerScope?: FluidObject;
|
|
800
749
|
containerRuntimeCtor?: typeof ContainerRuntime;
|
|
801
|
-
/** @deprecated Will be removed
|
|
750
|
+
/** @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md */
|
|
802
751
|
requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
|
|
803
752
|
provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>;
|
|
804
753
|
}): Promise<ContainerRuntime> {
|
|
@@ -909,16 +858,18 @@ export class ContainerRuntime
|
|
|
909
858
|
metadata?.idCompressorEnabled ?? runtimeOptions.enableRuntimeIdCompressor ?? false;
|
|
910
859
|
let idCompressor: (IIdCompressor & IIdCompressorCore) | undefined;
|
|
911
860
|
if (idCompressorEnabled) {
|
|
912
|
-
const {
|
|
861
|
+
const { createIdCompressor, deserializeIdCompressor, createSessionId } = await import(
|
|
862
|
+
"@fluidframework/id-compressor"
|
|
863
|
+
);
|
|
913
864
|
|
|
914
865
|
const pendingLocalState = context.pendingLocalState as IPendingRuntimeState;
|
|
915
866
|
|
|
916
867
|
if (pendingLocalState?.pendingIdCompressorState !== undefined) {
|
|
917
|
-
idCompressor =
|
|
868
|
+
idCompressor = deserializeIdCompressor(pendingLocalState.pendingIdCompressorState);
|
|
918
869
|
} else if (serializedIdCompressor !== undefined) {
|
|
919
|
-
idCompressor =
|
|
870
|
+
idCompressor = deserializeIdCompressor(serializedIdCompressor, createSessionId());
|
|
920
871
|
} else {
|
|
921
|
-
idCompressor =
|
|
872
|
+
idCompressor = createIdCompressor(logger);
|
|
922
873
|
}
|
|
923
874
|
}
|
|
924
875
|
|
|
@@ -963,6 +914,7 @@ export class ContainerRuntime
|
|
|
963
914
|
}
|
|
964
915
|
|
|
965
916
|
public readonly options: ILoaderOptions;
|
|
917
|
+
private imminentClosure: boolean = false;
|
|
966
918
|
|
|
967
919
|
private readonly _getClientId: () => string | undefined;
|
|
968
920
|
public get clientId(): string | undefined {
|
|
@@ -1214,9 +1166,7 @@ export class ContainerRuntime
|
|
|
1214
1166
|
*/
|
|
1215
1167
|
private readonly loadedFromVersionId: string | undefined;
|
|
1216
1168
|
|
|
1217
|
-
|
|
1218
|
-
* @internal
|
|
1219
|
-
*/
|
|
1169
|
+
/***/
|
|
1220
1170
|
protected constructor(
|
|
1221
1171
|
context: IContainerContext,
|
|
1222
1172
|
private readonly registry: IFluidDataStoreRegistry,
|
|
@@ -1342,8 +1292,7 @@ export class ContainerRuntime
|
|
|
1342
1292
|
eventName: "GCFeatureMatrix",
|
|
1343
1293
|
metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
|
|
1344
1294
|
inputs: JSON.stringify({
|
|
1345
|
-
|
|
1346
|
-
this.runtimeOptions.gcOptions[gcTombstoneGenerationOptionName],
|
|
1295
|
+
gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gcGenerationOptionName],
|
|
1347
1296
|
}),
|
|
1348
1297
|
});
|
|
1349
1298
|
|
|
@@ -1448,6 +1397,7 @@ export class ContainerRuntime
|
|
|
1448
1397
|
// GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
|
|
1449
1398
|
// delta manager would always return false for summarizer client.
|
|
1450
1399
|
activeConnection: () => this.innerDeltaManager.active,
|
|
1400
|
+
submitMessage: (message: ContainerRuntimeGCMessage) => this.submit(message),
|
|
1451
1401
|
});
|
|
1452
1402
|
|
|
1453
1403
|
const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
|
|
@@ -1778,9 +1728,10 @@ export class ContainerRuntime
|
|
|
1778
1728
|
/**
|
|
1779
1729
|
* Notifies this object about the request made to the container.
|
|
1780
1730
|
* @param request - Request made to the handler.
|
|
1781
|
-
* @deprecated Will be removed in future major release.
|
|
1731
|
+
* @deprecated Will be removed in future major release. This method needs to stay private until LTS version of Loader moves to "2.0.0-internal.7.0.0".
|
|
1782
1732
|
*/
|
|
1783
|
-
|
|
1733
|
+
// @ts-expect-error expected to be used by LTS Loaders and Containers
|
|
1734
|
+
private async request(request: IRequest): Promise<IResponse> {
|
|
1784
1735
|
try {
|
|
1785
1736
|
const parser = RequestParser.create(request);
|
|
1786
1737
|
const id = parser.pathParts[0];
|
|
@@ -2083,6 +2034,9 @@ export class ContainerRuntime
|
|
|
2083
2034
|
throw new Error("chunkedOp not expected here");
|
|
2084
2035
|
case ContainerMessageType.Rejoin:
|
|
2085
2036
|
throw new Error("rejoin not expected here");
|
|
2037
|
+
case ContainerMessageType.GC:
|
|
2038
|
+
// GC op is only sent in summarizer which should never have stashed ops.
|
|
2039
|
+
throw new LoggingError("GC op not expected to be stashed in summarizer");
|
|
2086
2040
|
default: {
|
|
2087
2041
|
// This should be extremely rare for stashed ops.
|
|
2088
2042
|
// It would require a newer runtime stashing ops and then an older one applying them,
|
|
@@ -2336,6 +2290,9 @@ export class ContainerRuntime
|
|
|
2336
2290
|
this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
|
|
2337
2291
|
}
|
|
2338
2292
|
break;
|
|
2293
|
+
case ContainerMessageType.GC:
|
|
2294
|
+
this.garbageCollector.processMessage(messageWithContext.message, local);
|
|
2295
|
+
break;
|
|
2339
2296
|
case ContainerMessageType.ChunkedOp:
|
|
2340
2297
|
case ContainerMessageType.Rejoin:
|
|
2341
2298
|
break;
|
|
@@ -2439,28 +2396,6 @@ export class ContainerRuntime
|
|
|
2439
2396
|
this.dataStores.processSignal(envelope.address, transformed, local);
|
|
2440
2397
|
}
|
|
2441
2398
|
|
|
2442
|
-
/**
|
|
2443
|
-
* Returns the runtime of the data store.
|
|
2444
|
-
* @param id - Id supplied during creating the data store.
|
|
2445
|
-
* @param wait - True if you want to wait for it.
|
|
2446
|
-
* @deprecated Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
|
|
2447
|
-
*/
|
|
2448
|
-
// eslint-disable-next-line import/no-deprecated
|
|
2449
|
-
public async getRootDataStore(id: string, wait = true): Promise<IFluidRouter> {
|
|
2450
|
-
return this.getRootDataStoreChannel(id, wait);
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
private async getRootDataStoreChannel(
|
|
2454
|
-
id: string,
|
|
2455
|
-
wait = true,
|
|
2456
|
-
): Promise<IFluidDataStoreChannel> {
|
|
2457
|
-
await this.dataStores.waitIfPendingAlias(id);
|
|
2458
|
-
const internalId = this.internalId(id);
|
|
2459
|
-
const context = await this.dataStores.getDataStore(internalId, { wait });
|
|
2460
|
-
assert(await context.isRoot(), 0x12b /* "did not get root data store" */);
|
|
2461
|
-
return context.realize();
|
|
2462
|
-
}
|
|
2463
|
-
|
|
2464
2399
|
/**
|
|
2465
2400
|
* Flush the pending ops manually.
|
|
2466
2401
|
* This method is expected to be called at the end of a batch.
|
|
@@ -2582,7 +2517,6 @@ export class ContainerRuntime
|
|
|
2582
2517
|
|
|
2583
2518
|
/**
|
|
2584
2519
|
* @deprecated 0.16 Issue #1537, #3631
|
|
2585
|
-
* @internal
|
|
2586
2520
|
*/
|
|
2587
2521
|
public async _createDataStoreWithProps(
|
|
2588
2522
|
pkg: string | string[],
|
|
@@ -2603,7 +2537,9 @@ export class ContainerRuntime
|
|
|
2603
2537
|
private canSendOps() {
|
|
2604
2538
|
// Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because
|
|
2605
2539
|
// container runtime's ability to send ops depend on the actual readonly state of the delta manager.
|
|
2606
|
-
return
|
|
2540
|
+
return (
|
|
2541
|
+
this.connected && !this.innerDeltaManager.readOnlyInfo.readonly && !this.imminentClosure
|
|
2542
|
+
);
|
|
2607
2543
|
}
|
|
2608
2544
|
|
|
2609
2545
|
/**
|
|
@@ -2632,18 +2568,28 @@ export class ContainerRuntime
|
|
|
2632
2568
|
}
|
|
2633
2569
|
|
|
2634
2570
|
private isContainerMessageDirtyable({ type, contents }: OutboundContainerRuntimeMessage) {
|
|
2635
|
-
//
|
|
2636
|
-
//
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2571
|
+
// Certain container runtime messages should not mark the container dirty such as the old built-in
|
|
2572
|
+
// AgentScheduler and Garbage collector messages.
|
|
2573
|
+
switch (type) {
|
|
2574
|
+
case ContainerMessageType.Attach: {
|
|
2575
|
+
const attachMessage = contents as InboundAttachMessage;
|
|
2576
|
+
if (attachMessage.id === agentSchedulerId) {
|
|
2577
|
+
return false;
|
|
2578
|
+
}
|
|
2579
|
+
break;
|
|
2641
2580
|
}
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2581
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
2582
|
+
const envelope = contents;
|
|
2583
|
+
if (envelope.address === agentSchedulerId) {
|
|
2584
|
+
return false;
|
|
2585
|
+
}
|
|
2586
|
+
break;
|
|
2587
|
+
}
|
|
2588
|
+
case ContainerMessageType.GC: {
|
|
2645
2589
|
return false;
|
|
2646
2590
|
}
|
|
2591
|
+
default:
|
|
2592
|
+
break;
|
|
2647
2593
|
}
|
|
2648
2594
|
return true;
|
|
2649
2595
|
}
|
|
@@ -2874,7 +2820,7 @@ export class ContainerRuntime
|
|
|
2874
2820
|
* @param usedRoutes - The routes that are used in all nodes in this Container.
|
|
2875
2821
|
* @see IGarbageCollectionRuntime.updateUsedRoutes
|
|
2876
2822
|
*/
|
|
2877
|
-
public updateUsedRoutes(usedRoutes: string[]) {
|
|
2823
|
+
public updateUsedRoutes(usedRoutes: readonly string[]) {
|
|
2878
2824
|
// Update our summarizer node's used routes. Updating used routes in summarizer node before
|
|
2879
2825
|
// summarizing is required and asserted by the the summarizer node. We are the root and are
|
|
2880
2826
|
// always referenced, so the used routes is only self-route (empty string).
|
|
@@ -2888,7 +2834,7 @@ export class ContainerRuntime
|
|
|
2888
2834
|
* This is called to update objects whose routes are unused.
|
|
2889
2835
|
* @param unusedRoutes - Data store and attachment blob routes that are unused in this Container.
|
|
2890
2836
|
*/
|
|
2891
|
-
public updateUnusedRoutes(unusedRoutes: string[]) {
|
|
2837
|
+
public updateUnusedRoutes(unusedRoutes: readonly string[]) {
|
|
2892
2838
|
const { blobManagerRoutes, dataStoreRoutes } =
|
|
2893
2839
|
this.getDataStoreAndBlobManagerRoutes(unusedRoutes);
|
|
2894
2840
|
this.blobManager.updateUnusedRoutes(blobManagerRoutes);
|
|
@@ -2898,7 +2844,7 @@ export class ContainerRuntime
|
|
|
2898
2844
|
/**
|
|
2899
2845
|
* @deprecated Replaced by deleteSweepReadyNodes.
|
|
2900
2846
|
*/
|
|
2901
|
-
public deleteUnusedNodes(unusedRoutes: string[]): string[] {
|
|
2847
|
+
public deleteUnusedNodes(unusedRoutes: readonly string[]): string[] {
|
|
2902
2848
|
throw new Error("deleteUnusedRoutes should not be called");
|
|
2903
2849
|
}
|
|
2904
2850
|
|
|
@@ -2907,7 +2853,7 @@ export class ContainerRuntime
|
|
|
2907
2853
|
* @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
|
|
2908
2854
|
* @returns The routes of nodes that were deleted.
|
|
2909
2855
|
*/
|
|
2910
|
-
public deleteSweepReadyNodes(sweepReadyRoutes: string[]): string[] {
|
|
2856
|
+
public deleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[] {
|
|
2911
2857
|
const { dataStoreRoutes, blobManagerRoutes } =
|
|
2912
2858
|
this.getDataStoreAndBlobManagerRoutes(sweepReadyRoutes);
|
|
2913
2859
|
|
|
@@ -2919,7 +2865,7 @@ export class ContainerRuntime
|
|
|
2919
2865
|
* This is called to update objects that are tombstones.
|
|
2920
2866
|
* @param tombstonedRoutes - Data store and attachment blob routes that are tombstones in this Container.
|
|
2921
2867
|
*/
|
|
2922
|
-
public updateTombstonedRoutes(tombstonedRoutes: string[]) {
|
|
2868
|
+
public updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {
|
|
2923
2869
|
const { blobManagerRoutes, dataStoreRoutes } =
|
|
2924
2870
|
this.getDataStoreAndBlobManagerRoutes(tombstonedRoutes);
|
|
2925
2871
|
this.blobManager.updateTombstonedRoutes(blobManagerRoutes);
|
|
@@ -2979,7 +2925,7 @@ export class ContainerRuntime
|
|
|
2979
2925
|
* @returns Two route lists - One that contains routes for blob manager and another one that contains routes
|
|
2980
2926
|
* for data stores.
|
|
2981
2927
|
*/
|
|
2982
|
-
private getDataStoreAndBlobManagerRoutes(routes: string[]) {
|
|
2928
|
+
private getDataStoreAndBlobManagerRoutes(routes: readonly string[]) {
|
|
2983
2929
|
const blobManagerRoutes: string[] = [];
|
|
2984
2930
|
const dataStoreRoutes: string[] = [];
|
|
2985
2931
|
for (const route of routes) {
|
|
@@ -3056,10 +3002,10 @@ export class ContainerRuntime
|
|
|
3056
3002
|
);
|
|
3057
3003
|
}
|
|
3058
3004
|
|
|
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.
|
|
3005
|
+
// If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
|
|
3006
|
+
// and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
3007
|
+
// saved within the timeout, check if it should be failed or can continue.
|
|
3008
|
+
if (this.validateSummaryBeforeUpload && this.isDirty) {
|
|
3063
3009
|
const countBefore = this.pendingMessagesCount;
|
|
3064
3010
|
// The timeout for waiting for pending ops can be overridden via configurations.
|
|
3065
3011
|
const pendingOpsTimeout =
|
|
@@ -3081,7 +3027,7 @@ export class ContainerRuntime
|
|
|
3081
3027
|
// happens, whether we attempted to wait for these ops to be acked and what was the result.
|
|
3082
3028
|
summaryNumberLogger.sendTelemetryEvent({
|
|
3083
3029
|
eventName: "PendingOpsWhileSummarizing",
|
|
3084
|
-
saved: this.
|
|
3030
|
+
saved: !this.isDirty,
|
|
3085
3031
|
timeout: pendingOpsTimeout,
|
|
3086
3032
|
countBefore,
|
|
3087
3033
|
countAfter: this.pendingMessagesCount,
|
|
@@ -3360,7 +3306,7 @@ export class ContainerRuntime
|
|
|
3360
3306
|
}
|
|
3361
3307
|
|
|
3362
3308
|
/**
|
|
3363
|
-
* This helper is called during summarization. If
|
|
3309
|
+
* This helper is called during summarization. If the container is dirty, it will return a failed summarize result
|
|
3364
3310
|
* (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
|
|
3365
3311
|
* @param logger - The logger to be used for sending telemetry.
|
|
3366
3312
|
* @param referenceSequenceNumber - The reference sequence number of the summary attempt.
|
|
@@ -3376,7 +3322,7 @@ export class ContainerRuntime
|
|
|
3376
3322
|
finalAttempt: boolean,
|
|
3377
3323
|
beforeSummaryGeneration: boolean,
|
|
3378
3324
|
): Promise<IBaseSummarizeResult | undefined> {
|
|
3379
|
-
if (!this.
|
|
3325
|
+
if (!this.isDirty) {
|
|
3380
3326
|
return;
|
|
3381
3327
|
}
|
|
3382
3328
|
|
|
@@ -3724,6 +3670,7 @@ export class ContainerRuntime
|
|
|
3724
3670
|
/**
|
|
3725
3671
|
* Finds the right store and asks it to resubmit the message. This typically happens when we
|
|
3726
3672
|
* reconnect and there are pending messages.
|
|
3673
|
+
* ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
|
|
3727
3674
|
* @param message - The original LocalContainerRuntimeMessage.
|
|
3728
3675
|
* @param localOpMetadata - The local metadata associated with the original message.
|
|
3729
3676
|
*/
|
|
@@ -3752,6 +3699,9 @@ export class ContainerRuntime
|
|
|
3752
3699
|
case ContainerMessageType.Rejoin:
|
|
3753
3700
|
this.submit(message);
|
|
3754
3701
|
break;
|
|
3702
|
+
case ContainerMessageType.GC:
|
|
3703
|
+
// GC op is only sent in summarizer which should never reconnect.
|
|
3704
|
+
throw new LoggingError("GC op not expected to be resubmitted in summarizer");
|
|
3755
3705
|
default: {
|
|
3756
3706
|
// This case should be very rare - it would imply an op was stashed from a
|
|
3757
3707
|
// future version of runtime code and now is being applied on an older version
|
|
@@ -3952,8 +3902,6 @@ export class ContainerRuntime
|
|
|
3952
3902
|
);
|
|
3953
3903
|
}
|
|
3954
3904
|
|
|
3955
|
-
public notifyAttaching() {} // do nothing (deprecated method)
|
|
3956
|
-
|
|
3957
3905
|
public async getPendingLocalState(props?: IGetPendingLocalStateProps): Promise<unknown> {
|
|
3958
3906
|
return PerformanceEvent.timedExecAsync(
|
|
3959
3907
|
this.mc.logger,
|
|
@@ -3963,7 +3911,11 @@ export class ContainerRuntime
|
|
|
3963
3911
|
},
|
|
3964
3912
|
async (event) => {
|
|
3965
3913
|
this.verifyNotClosed();
|
|
3966
|
-
|
|
3914
|
+
// in case imminentClosure is set to true by future code, we don't
|
|
3915
|
+
// try to change its value
|
|
3916
|
+
if (!this.imminentClosure) {
|
|
3917
|
+
this.imminentClosure = props?.notifyImminentClosure ?? this.imminentClosure;
|
|
3918
|
+
}
|
|
3967
3919
|
const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
|
|
3968
3920
|
if (this._orderSequentiallyCalls !== 0) {
|
|
3969
3921
|
throw new UsageError("can't get state during orderSequentially");
|
|
@@ -3972,7 +3924,7 @@ export class ContainerRuntime
|
|
|
3972
3924
|
// getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
|
|
3973
3925
|
// to close current batch.
|
|
3974
3926
|
this.flush();
|
|
3975
|
-
const pendingAttachmentBlobs =
|
|
3927
|
+
const pendingAttachmentBlobs = this.imminentClosure
|
|
3976
3928
|
? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
|
|
3977
3929
|
: undefined;
|
|
3978
3930
|
const pending = this.pendingStateManager.getLocalState();
|
package/src/dataStore.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { ITelemetryLoggerExt, TelemetryDataTag, UsageError } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { assert, unreachableCase } from "@fluidframework/core-utils";
|
|
8
8
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
9
|
-
import { FluidObject, IFluidHandle
|
|
9
|
+
import { FluidObject, IFluidHandle } from "@fluidframework/core-interfaces";
|
|
10
10
|
import {
|
|
11
11
|
AliasResult,
|
|
12
12
|
IDataStore,
|
|
@@ -160,13 +160,6 @@ class DataStore implements IDataStore {
|
|
|
160
160
|
return "Success";
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
/**
|
|
164
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
165
|
-
*/
|
|
166
|
-
public async request(request: IRequest): Promise<IResponse> {
|
|
167
|
-
return this.fluidDataStoreChannel.request(request);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
163
|
/**
|
|
171
164
|
* {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}
|
|
172
165
|
*/
|
|
@@ -184,13 +177,6 @@ class DataStore implements IDataStore {
|
|
|
184
177
|
this.pendingAliases = datastores.pendingAliases;
|
|
185
178
|
}
|
|
186
179
|
|
|
187
|
-
/**
|
|
188
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
189
|
-
*/
|
|
190
|
-
public get IFluidRouter() {
|
|
191
|
-
return this.fluidDataStoreChannel;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
180
|
private async ackBasedPromise<T>(
|
|
195
181
|
executor: (
|
|
196
182
|
resolve: (value: T | PromiseLike<T>) => void,
|