@fluidframework/container-runtime 2.0.0-dev.7.4.0.217212 → 2.0.0-dev.7.4.0.221926
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.json +0 -3
- package/api-report/container-runtime.api.md +77 -73
- 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 +1361 -132
- package/dist/container-runtime-beta.d.ts +40 -2
- package/dist/container-runtime-public.d.ts +40 -2
- package/dist/container-runtime-untrimmed.d.ts +106 -93
- package/dist/containerRuntime.d.ts +19 -17
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +44 -24
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStores.d.ts +10 -15
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +63 -36
- package/dist/dataStores.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +29 -10
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +149 -67
- 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 +97 -44
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +26 -16
- 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.map +1 -1
- package/dist/gc/gcTelemetry.js +14 -3
- 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 -4
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +13 -1
- 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 +13 -5
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +5 -0
- package/dist/messageTypes.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/summarizerTypes.d.ts +28 -28
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +3 -3
- 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 +1361 -132
- package/lib/container-runtime-beta.d.ts +40 -2
- package/lib/container-runtime-public.d.ts +40 -2
- package/lib/container-runtime-untrimmed.d.ts +106 -93
- package/lib/containerRuntime.d.ts +19 -17
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +46 -26
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStores.d.ts +10 -15
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +65 -38
- package/lib/dataStores.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +29 -10
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +151 -69
- 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 +97 -44
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +25 -15
- 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.map +1 -1
- package/lib/gc/gcTelemetry.js +14 -3
- 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 +13 -1
- 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 +13 -5
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +5 -0
- package/lib/messageTypes.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/summarizerTypes.d.ts +28 -28
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +3 -3
- 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 +18 -15
- package/src/blobManager.ts +5 -5
- package/src/containerRuntime.ts +66 -40
- package/src/dataStores.ts +118 -59
- package/src/gc/garbageCollection.md +14 -15
- package/src/gc/garbageCollection.ts +182 -75
- package/src/gc/gcConfigs.ts +50 -52
- package/src/gc/gcDefinitions.ts +112 -50
- package/src/gc/gcHelpers.ts +31 -52
- package/src/gc/gcTelemetry.ts +16 -4
- package/src/gc/gcUnreferencedStateTracker.ts +61 -22
- package/src/gc/index.ts +4 -3
- package/src/index.ts +17 -1
- package/src/messageTypes.ts +16 -2
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +1 -0
- package/src/summary/orderedClientElection.ts +1 -1
- package/src/summary/summarizerTypes.ts +28 -28
- package/src/summary/summaryCollection.ts +3 -3
- 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 -69
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-runtime",
|
|
3
|
-
"version": "2.0.0-dev.7.4.0.
|
|
3
|
+
"version": "2.0.0-dev.7.4.0.221926",
|
|
4
4
|
"description": "Fluid container runtime",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -35,18 +35,19 @@
|
|
|
35
35
|
"temp-directory": "nyc/.nyc_output"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@fluid-internal/client-utils": "2.0.0-dev.7.4.0.
|
|
39
|
-
"@fluidframework/container-definitions": "2.0.0-dev.7.4.0.
|
|
40
|
-
"@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.
|
|
41
|
-
"@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.
|
|
42
|
-
"@fluidframework/core-utils": "2.0.0-dev.7.4.0.
|
|
43
|
-
"@fluidframework/datastore": "2.0.0-dev.7.4.0.
|
|
44
|
-
"@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.
|
|
45
|
-
"@fluidframework/driver-utils": "2.0.0-dev.7.4.0.
|
|
38
|
+
"@fluid-internal/client-utils": "2.0.0-dev.7.4.0.221926",
|
|
39
|
+
"@fluidframework/container-definitions": "2.0.0-dev.7.4.0.221926",
|
|
40
|
+
"@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.221926",
|
|
41
|
+
"@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.221926",
|
|
42
|
+
"@fluidframework/core-utils": "2.0.0-dev.7.4.0.221926",
|
|
43
|
+
"@fluidframework/datastore": "2.0.0-dev.7.4.0.221926",
|
|
44
|
+
"@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.221926",
|
|
45
|
+
"@fluidframework/driver-utils": "2.0.0-dev.7.4.0.221926",
|
|
46
|
+
"@fluidframework/id-compressor": "2.0.0-dev.7.4.0.221926",
|
|
46
47
|
"@fluidframework/protocol-definitions": "^3.0.0",
|
|
47
|
-
"@fluidframework/runtime-definitions": "2.0.0-dev.7.4.0.
|
|
48
|
-
"@fluidframework/runtime-utils": "2.0.0-dev.7.4.0.
|
|
49
|
-
"@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.
|
|
48
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev.7.4.0.221926",
|
|
49
|
+
"@fluidframework/runtime-utils": "2.0.0-dev.7.4.0.221926",
|
|
50
|
+
"@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.221926",
|
|
50
51
|
"double-ended-queue": "^2.1.0-0",
|
|
51
52
|
"events": "^3.1.0",
|
|
52
53
|
"lz4js": "^0.2.0",
|
|
@@ -54,15 +55,16 @@
|
|
|
54
55
|
"uuid": "^9.0.0"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
|
-
"@
|
|
58
|
+
"@arethetypeswrong/cli": "^0.13.3",
|
|
59
|
+
"@fluid-private/stochastic-test-utils": "2.0.0-dev.7.4.0.221926",
|
|
58
60
|
"@fluid-tools/benchmark": "^0.48.0",
|
|
59
61
|
"@fluid-tools/build-cli": "^0.28.0",
|
|
60
62
|
"@fluidframework/build-common": "^2.0.3",
|
|
61
63
|
"@fluidframework/build-tools": "^0.28.0",
|
|
62
64
|
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.0.0-internal.7.2.0",
|
|
63
65
|
"@fluidframework/eslint-config-fluid": "^3.1.0",
|
|
64
|
-
"@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.
|
|
65
|
-
"@fluidframework/test-runtime-utils": "2.0.0-dev.7.4.0.
|
|
66
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.221926",
|
|
67
|
+
"@fluidframework/test-runtime-utils": "2.0.0-dev.7.4.0.221926",
|
|
66
68
|
"@microsoft/api-extractor": "^7.38.3",
|
|
67
69
|
"@types/double-ended-queue": "^2.1.0",
|
|
68
70
|
"@types/events": "^3.0.0",
|
|
@@ -115,6 +117,7 @@
|
|
|
115
117
|
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
116
118
|
"build:genver": "gen-version",
|
|
117
119
|
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
120
|
+
"check:are-the-types-wrong": "attw --pack",
|
|
118
121
|
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
119
122
|
"ci:build:docs": "api-extractor run",
|
|
120
123
|
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
package/src/blobManager.ts
CHANGED
|
@@ -85,7 +85,7 @@ export class BlobHandle implements IFluidHandle<ArrayBufferLike> {
|
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* Information from a snapshot needed to load BlobManager
|
|
88
|
-
* @
|
|
88
|
+
* @alpha
|
|
89
89
|
*/
|
|
90
90
|
export interface IBlobManagerLoadInfo {
|
|
91
91
|
ids?: string[];
|
|
@@ -729,7 +729,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
729
729
|
* This is called to update blobs whose routes are unused. The unused blobs are deleted.
|
|
730
730
|
* @param unusedRoutes - The routes of the blob nodes that are unused. These routes will be based off of local ids.
|
|
731
731
|
*/
|
|
732
|
-
public updateUnusedRoutes(unusedRoutes: string[]): void {
|
|
732
|
+
public updateUnusedRoutes(unusedRoutes: readonly string[]): void {
|
|
733
733
|
this.deleteBlobsFromRedirectTable(unusedRoutes);
|
|
734
734
|
}
|
|
735
735
|
|
|
@@ -739,7 +739,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
739
739
|
* be based off of local ids.
|
|
740
740
|
* @returns The routes of blobs that were deleted.
|
|
741
741
|
*/
|
|
742
|
-
public deleteSweepReadyNodes(sweepReadyBlobRoutes: string[]): string[] {
|
|
742
|
+
public deleteSweepReadyNodes(sweepReadyBlobRoutes: readonly string[]): readonly string[] {
|
|
743
743
|
// If sweep for attachment blobs is not enabled, return empty list indicating nothing is deleted.
|
|
744
744
|
if (this.mc.config.getBoolean(disableAttachmentBlobSweepKey) === true) {
|
|
745
745
|
return [];
|
|
@@ -760,7 +760,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
760
760
|
* Note that this does not delete the blobs from storage service immediately. Deleting the blobs from redirect table
|
|
761
761
|
* will remove them the next summary. The service would them delete them some time in the future.
|
|
762
762
|
*/
|
|
763
|
-
private deleteBlobsFromRedirectTable(blobRoutes: string[]) {
|
|
763
|
+
private deleteBlobsFromRedirectTable(blobRoutes: readonly string[]) {
|
|
764
764
|
if (blobRoutes.length === 0) {
|
|
765
765
|
return;
|
|
766
766
|
}
|
|
@@ -805,7 +805,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
805
805
|
* accessing deleted content without actually deleting content from summaries.
|
|
806
806
|
* @param tombstonedRoutes - The routes of blob nodes that are tombstones.
|
|
807
807
|
*/
|
|
808
|
-
public updateTombstonedRoutes(tombstonedRoutes: string[]) {
|
|
808
|
+
public updateTombstonedRoutes(tombstonedRoutes: readonly string[]) {
|
|
809
809
|
const tombstonedBlobsSet: Set<string> = new Set();
|
|
810
810
|
// The routes or blob node paths are in the same format as returned in getGCData -
|
|
811
811
|
// `/<BlobManager.basePath>/<blobId>`.
|
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
|
|
@@ -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;
|
|
@@ -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",
|
|
@@ -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
|
|
|
@@ -1341,8 +1347,7 @@ export class ContainerRuntime
|
|
|
1341
1347
|
eventName: "GCFeatureMatrix",
|
|
1342
1348
|
metadataValue: JSON.stringify(metadata?.gcFeatureMatrix),
|
|
1343
1349
|
inputs: JSON.stringify({
|
|
1344
|
-
|
|
1345
|
-
this.runtimeOptions.gcOptions[gcTombstoneGenerationOptionName],
|
|
1350
|
+
gcOptions_gcGeneration: this.runtimeOptions.gcOptions[gcGenerationOptionName],
|
|
1346
1351
|
}),
|
|
1347
1352
|
});
|
|
1348
1353
|
|
|
@@ -1447,6 +1452,7 @@ export class ContainerRuntime
|
|
|
1447
1452
|
// GC runs in summarizer client and needs access to the real (non-proxy) active information. The proxy
|
|
1448
1453
|
// delta manager would always return false for summarizer client.
|
|
1449
1454
|
activeConnection: () => this.innerDeltaManager.active,
|
|
1455
|
+
submitMessage: (message: ContainerRuntimeGCMessage) => this.submit(message),
|
|
1450
1456
|
});
|
|
1451
1457
|
|
|
1452
1458
|
const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
|
|
@@ -2082,6 +2088,9 @@ export class ContainerRuntime
|
|
|
2082
2088
|
throw new Error("chunkedOp not expected here");
|
|
2083
2089
|
case ContainerMessageType.Rejoin:
|
|
2084
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");
|
|
2085
2094
|
default: {
|
|
2086
2095
|
// This should be extremely rare for stashed ops.
|
|
2087
2096
|
// It would require a newer runtime stashing ops and then an older one applying them,
|
|
@@ -2335,6 +2344,9 @@ export class ContainerRuntime
|
|
|
2335
2344
|
this.idCompressor.finalizeCreationRange(messageWithContext.message.contents);
|
|
2336
2345
|
}
|
|
2337
2346
|
break;
|
|
2347
|
+
case ContainerMessageType.GC:
|
|
2348
|
+
this.garbageCollector.processMessage(messageWithContext.message, local);
|
|
2349
|
+
break;
|
|
2338
2350
|
case ContainerMessageType.ChunkedOp:
|
|
2339
2351
|
case ContainerMessageType.Rejoin:
|
|
2340
2352
|
break;
|
|
@@ -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
|