@fluidframework/container-runtime 2.0.0-internal.2.3.0 → 2.0.0-internal.2.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/dist/blobManager.d.ts +4 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +43 -10
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +15 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +28 -13
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +5 -8
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +3 -3
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +14 -14
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +15 -7
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +101 -40
- package/dist/garbageCollection.js.map +1 -1
- package/dist/garbageCollectionConstants.d.ts +1 -0
- package/dist/garbageCollectionConstants.d.ts.map +1 -1
- package/dist/garbageCollectionConstants.js +4 -2
- package/dist/garbageCollectionConstants.js.map +1 -1
- package/dist/garbageCollectionTombstoneUtils.d.ts +5 -4
- package/dist/garbageCollectionTombstoneUtils.d.ts.map +1 -1
- package/dist/garbageCollectionTombstoneUtils.js +8 -13
- package/dist/garbageCollectionTombstoneUtils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.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/summarizer.js.map +1 -1
- package/lib/blobManager.d.ts +4 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +44 -11
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +15 -0
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +27 -12
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +5 -8
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +3 -3
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +15 -15
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +15 -7
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +103 -42
- package/lib/garbageCollection.js.map +1 -1
- package/lib/garbageCollectionConstants.d.ts +1 -0
- package/lib/garbageCollectionConstants.d.ts.map +1 -1
- package/lib/garbageCollectionConstants.js +3 -1
- package/lib/garbageCollectionConstants.js.map +1 -1
- package/lib/garbageCollectionTombstoneUtils.d.ts +5 -4
- package/lib/garbageCollectionTombstoneUtils.d.ts.map +1 -1
- package/lib/garbageCollectionTombstoneUtils.js +9 -14
- package/lib/garbageCollectionTombstoneUtils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.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/summarizer.js.map +1 -1
- package/package.json +16 -16
- package/src/blobManager.ts +57 -13
- package/src/containerRuntime.ts +38 -9
- package/src/dataStoreContext.ts +13 -14
- package/src/dataStores.ts +25 -19
- package/src/garbageCollection.ts +115 -42
- package/src/garbageCollectionConstants.ts +3 -1
- package/src/garbageCollectionTombstoneUtils.ts +11 -14
- package/src/index.ts +2 -0
- package/src/packageVersion.ts +1 -1
- package/src/summarizer.ts +1 -1
|
@@ -20,7 +20,9 @@ export const trackGCStateKey = "Fluid.GarbageCollection.TrackGCState";
|
|
|
20
20
|
export const disableSweepLogKey = "Fluid.GarbageCollection.DisableSweepLog";
|
|
21
21
|
// Feature gate key to disable the tombstone feature, i.e., tombstone information is not read / written into summary.
|
|
22
22
|
export const disableTombstoneKey = "Fluid.GarbageCollection.DisableTombstone";
|
|
23
|
-
// Feature gate to enable throwing an error when tombstone object is
|
|
23
|
+
// Feature gate to enable throwing an error when tombstone object is loaded (requested).
|
|
24
|
+
export const throwOnTombstoneLoadKey = "Fluid.GarbageCollection.ThrowOnTombstoneLoad";
|
|
25
|
+
// Feature gate to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops).
|
|
24
26
|
export const throwOnTombstoneUsageKey = "Fluid.GarbageCollection.ThrowOnTombstoneUsage";
|
|
25
27
|
// Feature gate to enable GC version upgrade.
|
|
26
28
|
export const gcVersionUpgradeToV2Key = "Fluid.GarbageCollection.GCVersionUpgradeToV2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollectionConstants.js","sourceRoot":"","sources":["../src/garbageCollectionConstants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAc,CAAC,CAAC;AAC5C,iDAAiD;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAc,CAAC,CAAC;AAE7C,wCAAwC;AACxC,MAAM,CAAC,MAAM,QAAQ,GAAG,+BAA+B,CAAC;AACxD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAC9D,kDAAkD;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAClE,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,0CAA0C,CAAC;AAC9E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,sCAAsC,CAAC;AACtE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,yCAAyC,CAAC;AAC5E,qHAAqH;AACrH,MAAM,CAAC,MAAM,mBAAmB,GAAG,0CAA0C,CAAC;AAC9E,
|
|
1
|
+
{"version":3,"file":"garbageCollectionConstants.js","sourceRoot":"","sources":["../src/garbageCollectionConstants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAc,CAAC,CAAC;AAC5C,iDAAiD;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAc,CAAC,CAAC;AAE7C,wCAAwC;AACxC,MAAM,CAAC,MAAM,QAAQ,GAAG,+BAA+B,CAAC;AACxD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAC9D,kDAAkD;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAClE,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,0CAA0C,CAAC;AAC9E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,sCAAsC,CAAC;AACtE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,yCAAyC,CAAC;AAC5E,qHAAqH;AACrH,MAAM,CAAC,MAAM,mBAAmB,GAAG,0CAA0C,CAAC;AAC9E,wFAAwF;AACxF,MAAM,CAAC,MAAM,uBAAuB,GAAG,8CAA8C,CAAC;AACtF,0GAA0G;AAC1G,MAAM,CAAC,MAAM,wBAAwB,GAAG,+CAA+C,CAAC;AACxF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,8CAA8C,CAAC;AAEtF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,SAAS;AAC/D,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC,UAAU","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { GCVersion } from \"./summaryFormat\";\n\n/** The stable version of garbage collection in production. */\nexport const stableGCVersion: GCVersion = 1;\n/** The current version of garbage collection. */\nexport const currentGCVersion: GCVersion = 2;\n\n// Feature gate key to turn GC on / off.\nexport const runGCKey = \"Fluid.GarbageCollection.RunGC\";\n// Feature gate key to turn GC sweep on / off.\nexport const runSweepKey = \"Fluid.GarbageCollection.RunSweep\";\n// Feature gate key to turn GC test mode on / off.\nexport const gcTestModeKey = \"Fluid.GarbageCollection.GCTestMode\";\n// Feature gate key to expire a session after a set period of time.\nexport const runSessionExpiryKey = \"Fluid.GarbageCollection.RunSessionExpiry\";\n// Feature gate key to write the gc blob as a handle if the data is the same.\nexport const trackGCStateKey = \"Fluid.GarbageCollection.TrackGCState\";\n// Feature gate key to turn GC sweep log off.\nexport const disableSweepLogKey = \"Fluid.GarbageCollection.DisableSweepLog\";\n// Feature gate key to disable the tombstone feature, i.e., tombstone information is not read / written into summary.\nexport const disableTombstoneKey = \"Fluid.GarbageCollection.DisableTombstone\";\n// Feature gate to enable throwing an error when tombstone object is loaded (requested).\nexport const throwOnTombstoneLoadKey = \"Fluid.GarbageCollection.ThrowOnTombstoneLoad\";\n// Feature gate to enable throwing an error when tombstone object is used (e.g. outgoing or incoming ops).\nexport const throwOnTombstoneUsageKey = \"Fluid.GarbageCollection.ThrowOnTombstoneUsage\";\n// Feature gate to enable GC version upgrade.\nexport const gcVersionUpgradeToV2Key = \"Fluid.GarbageCollection.GCVersionUpgradeToV2\";\n\n// One day in milliseconds.\nexport const oneDayMs = 1 * 24 * 60 * 60 * 1000;\n\nexport const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days\nexport const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days\n"]}
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import { ITelemetryGenericEvent } from "@fluidframework/common-definitions";
|
|
6
6
|
import { MonitoringContext } from "@fluidframework/telemetry-utils";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Adds isSummarizerClient, packagePath, and error to telemetry properties.
|
|
8
|
+
* Consolidates info / logic for logging when we encounter a Tombstone
|
|
11
9
|
*/
|
|
12
|
-
export declare function sendGCTombstoneEvent(mc: MonitoringContext, event: ITelemetryGenericEvent
|
|
10
|
+
export declare function sendGCTombstoneEvent(mc: MonitoringContext, event: ITelemetryGenericEvent & {
|
|
11
|
+
category: "error" | "generic";
|
|
12
|
+
isSummarizerClient: boolean;
|
|
13
|
+
}, packagePath: readonly string[] | undefined, error?: unknown): void;
|
|
13
14
|
//# sourceMappingURL=garbageCollectionTombstoneUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollectionTombstoneUtils.d.ts","sourceRoot":"","sources":["../src/garbageCollectionTombstoneUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE
|
|
1
|
+
{"version":3,"file":"garbageCollectionTombstoneUtils.d.ts","sourceRoot":"","sources":["../src/garbageCollectionTombstoneUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,iBAAiB,EACrB,KAAK,EAAE,sBAAsB,GAAG;IAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAAC,kBAAkB,EAAE,OAAO,CAAA;CAAE,EAC9F,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC1C,KAAK,CAAC,EAAE,OAAO,QAUlB"}
|
|
@@ -3,22 +3,17 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { packagePathToTelemetryProperty } from "@fluidframework/runtime-utils";
|
|
6
|
-
import { throwOnTombstoneUsageKey } from "./garbageCollectionConstants";
|
|
6
|
+
import { disableTombstoneKey, throwOnTombstoneLoadKey, throwOnTombstoneUsageKey } from "./garbageCollectionConstants";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Adds isSummarizerClient, packagePath, and error to telemetry properties.
|
|
8
|
+
* Consolidates info / logic for logging when we encounter a Tombstone
|
|
11
9
|
*/
|
|
12
|
-
export function sendGCTombstoneEvent(mc, event,
|
|
13
|
-
var _a;
|
|
14
|
-
const throwOnTombstoneUsage = event.throwOnTombstoneUsage = (_a = mc.config.getBoolean(throwOnTombstoneUsageKey)) !== null && _a !== void 0 ? _a : false;
|
|
10
|
+
export function sendGCTombstoneEvent(mc, event, packagePath, error) {
|
|
15
11
|
event.pkg = packagePathToTelemetryProperty(packagePath);
|
|
16
|
-
event.
|
|
17
|
-
|
|
18
|
-
mc.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
12
|
+
event.tombstoneFlags = JSON.stringify({
|
|
13
|
+
DisableTombstone: mc.config.getBoolean(disableTombstoneKey),
|
|
14
|
+
ThrowOnTombstoneUsage: mc.config.getBoolean(throwOnTombstoneUsageKey),
|
|
15
|
+
ThrowOnTombstoneLoad: mc.config.getBoolean(throwOnTombstoneLoadKey),
|
|
16
|
+
});
|
|
17
|
+
mc.logger.sendTelemetryEvent(event, error);
|
|
23
18
|
}
|
|
24
19
|
//# sourceMappingURL=garbageCollectionTombstoneUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollectionTombstoneUtils.js","sourceRoot":"","sources":["../src/garbageCollectionTombstoneUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"garbageCollectionTombstoneUtils.js","sourceRoot":"","sources":["../src/garbageCollectionTombstoneUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEtH;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAChC,EAAqB,EACrB,KAA8F,EAC9F,WAA0C,EAC1C,KAAe;IAEf,KAAK,CAAC,GAAG,GAAG,8BAA8B,CAAC,WAAW,CAAC,CAAC;IACxD,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,gBAAgB,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC;QAC3D,qBAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACrE,oBAAoB,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,uBAAuB,CAAC;KACtE,CAAC,CAAC;IAEH,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryGenericEvent } from \"@fluidframework/common-definitions\";\nimport { packagePathToTelemetryProperty } from \"@fluidframework/runtime-utils\";\nimport { MonitoringContext } from \"@fluidframework/telemetry-utils\";\nimport { disableTombstoneKey, throwOnTombstoneLoadKey, throwOnTombstoneUsageKey } from \"./garbageCollectionConstants\";\n\n/**\n * Consolidates info / logic for logging when we encounter a Tombstone\n */\nexport function sendGCTombstoneEvent(\n mc: MonitoringContext,\n event: ITelemetryGenericEvent & { category: \"error\" | \"generic\", isSummarizerClient: boolean },\n packagePath: readonly string[] | undefined,\n error?: unknown,\n) {\n event.pkg = packagePathToTelemetryProperty(packagePath);\n event.tombstoneFlags = JSON.stringify({\n DisableTombstone: mc.config.getBoolean(disableTombstoneKey),\n ThrowOnTombstoneUsage: mc.config.getBoolean(throwOnTombstoneUsageKey),\n ThrowOnTombstoneLoad: mc.config.getBoolean(throwOnTombstoneLoadKey),\n });\n\n mc.logger.sendTelemetryEvent(event, error);\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ContainerMessageType, ContainerRuntimeMessage, IGCRuntimeOptions, ISummaryRuntimeOptions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, IContainerRuntimeOptions, IRootSummaryTreeWithStats, isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime, RuntimeHeaders, ISummaryConfiguration, DefaultSummaryConfiguration, ICompressionRuntimeOptions, CompressionAlgorithms, } from "./containerRuntime";
|
|
5
|
+
export { ContainerMessageType, ContainerRuntimeMessage, IGCRuntimeOptions, ISummaryRuntimeOptions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, IContainerRuntimeOptions, IRootSummaryTreeWithStats, isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime, RuntimeHeaders, AllowTombstoneRequestHeaderKey, TombstoneResponseHeaderKey, ISummaryConfiguration, DefaultSummaryConfiguration, ICompressionRuntimeOptions, CompressionAlgorithms, } from "./containerRuntime";
|
|
6
6
|
export { FluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
7
7
|
export { IGCStats, } from "./garbageCollection";
|
|
8
8
|
export { IPendingFlush, IPendingLocalState, IPendingMessage, IPendingState, } from "./pendingStateManager";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACH,QAAQ,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,aAAa,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACH,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,iBA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,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ContainerMessageType, isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime, RuntimeHeaders, DefaultSummaryConfiguration, CompressionAlgorithms, } from "./containerRuntime";
|
|
5
|
+
export { ContainerMessageType, isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime, RuntimeHeaders, AllowTombstoneRequestHeaderKey, TombstoneResponseHeaderKey, DefaultSummaryConfiguration, CompressionAlgorithms, } from "./containerRuntime";
|
|
6
6
|
export { FluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
7
7
|
export { Summarizer } from "./summarizer";
|
|
8
8
|
export { ISummarizer, } from "./summarizerTypes";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,oBAAoB,EAUpB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,oBAAoB,EAUpB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,8BAA8B,EAC9B,0BAA0B,EAE1B,2BAA2B,EAE3B,qBAAqB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAU7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAkBH,WAAW,GAUd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAUH,iBAAiB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAoC,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAc,oBAAoB,EAAE,MAAM,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n ContainerMessageType,\n ContainerRuntimeMessage,\n IGCRuntimeOptions,\n ISummaryRuntimeOptions,\n ISummaryBaseConfiguration,\n ISummaryConfigurationHeuristics,\n ISummaryConfigurationDisableSummarizer,\n ISummaryConfigurationDisableHeuristics,\n IContainerRuntimeOptions,\n IRootSummaryTreeWithStats,\n isRuntimeMessage,\n RuntimeMessage,\n agentSchedulerId,\n ContainerRuntime,\n RuntimeHeaders,\n AllowTombstoneRequestHeaderKey,\n TombstoneResponseHeaderKey,\n ISummaryConfiguration,\n DefaultSummaryConfiguration,\n ICompressionRuntimeOptions,\n CompressionAlgorithms,\n} from \"./containerRuntime\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry\";\nexport {\n IGCStats,\n} from \"./garbageCollection\";\nexport {\n IPendingFlush,\n IPendingLocalState,\n IPendingMessage,\n IPendingState,\n} from \"./pendingStateManager\";\nexport { Summarizer } from \"./summarizer\";\nexport {\n EnqueueSummarizeResult,\n IAckSummaryResult,\n IBaseSummarizeResult,\n IBroadcastSummaryResult,\n ICancellationToken,\n IConnectableRuntime,\n IEnqueueSummarizeOptions,\n IGenerateSummaryTreeResult,\n IGeneratedSummaryStats,\n INackSummaryResult,\n IOnDemandSummarizeOptions,\n IProvideSummarizer,\n IRefreshSummaryAckOptions,\n ISubmitSummaryOpResult,\n ISubmitSummaryOptions,\n ISummarizeOptions,\n ISummarizeResults,\n ISummarizer,\n ISummarizerEvents,\n ISummarizerInternalsProvider,\n ISummarizerRuntime,\n ISummarizingWarning,\n ISummaryCancellationToken,\n IUploadSummaryResult,\n SubmitSummaryResult,\n SummarizeResultPart,\n SummarizerStopReason,\n} from \"./summarizerTypes\";\nexport {\n IAckedSummary,\n IClientSummaryWatcher,\n ISummary,\n ISummaryCollectionOpEvents,\n ISummaryAckMessage,\n ISummaryNackMessage,\n ISummaryOpMessage,\n OpActionEventListener,\n OpActionEventName,\n SummaryCollection,\n} from \"./summaryCollection\";\nexport { ICancellableSummarizerController, neverCancelledSummaryToken } from \"./runWhileConnectedCoordinator\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle\";\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/container-runtime";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.2.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.2.4.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/container-runtime";
|
|
8
|
-
export const pkgVersion = "2.0.0-internal.2.
|
|
8
|
+
export const pkgVersion = "2.0.0-internal.2.4.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.0.0-internal.2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.0.0-internal.2.4.0\";\n"]}
|
package/lib/summarizer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizer.js","sourceRoot":"","sources":["../src/summarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAW,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B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rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { Deferred } from \"@fluidframework/common-utils\";\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ILoader, LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { UsageError } from \"@fluidframework/container-utils\";\nimport { DriverErrorType, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { requestFluidObject } from \"@fluidframework/runtime-utils\";\nimport {\n ChildLogger,\n IFluidErrorBase,\n isFluidError,\n LoggingError,\n wrapErrorAndLog,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n FluidObject,\n IFluidHandleContext,\n IFluidHandle,\n IRequest,\n} from \"@fluidframework/core-interfaces\";\nimport { ISummaryConfiguration } from \"./containerRuntime\";\nimport { ICancellableSummarizerController } from \"./runWhileConnectedCoordinator\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\nimport { IAckedSummary, SummaryCollection } from \"./summaryCollection\";\nimport { SummarizerHandle } from \"./summarizerHandle\";\nimport { RunningSummarizer } from \"./runningSummarizer\";\nimport {\n ISummarizer,\n ISummarizerInternalsProvider,\n ISummarizerRuntime,\n ISummarizingWarning,\n SummarizerStopReason,\n} from \"./summarizerTypes\";\nimport { SummarizeHeuristicData } from \"./summarizerHeuristics\";\nimport { SummarizeResultBuilder } from \"./summaryGenerator\";\nimport { IConnectableRuntime } from \".\";\n\nconst summarizingError = \"summarizingError\";\n\nexport class SummarizingWarning extends LoggingError implements ISummarizingWarning, IFluidErrorBase {\n readonly errorType = summarizingError;\n readonly canRetry = true;\n\n constructor(\n errorMessage: string,\n readonly logged: boolean = false,\n ) {\n super(errorMessage);\n }\n\n static wrap(error: any, logged: boolean = false, logger: ITelemetryLogger) {\n const newErrorFn = (errMsg: string) => new SummarizingWarning(errMsg, logged);\n return wrapErrorAndLog<SummarizingWarning>(error, newErrorFn, logger);\n }\n}\n\nexport const createSummarizingWarning =\n (errorMessage: string, logged: boolean) => new SummarizingWarning(errorMessage, logged);\n\n/**\n * Summarizer is responsible for coordinating when to generate and send summaries.\n * It is the main entry point for summary work.\n * It is created only by summarizing container (i.e. one with clientType === \"summarizer\")\n */\nexport class Summarizer extends EventEmitter implements ISummarizer {\n public get IFluidLoadable() { return this; }\n public get ISummarizer() { return this; }\n\n private readonly logger: ITelemetryLogger;\n private runningSummarizer?: RunningSummarizer;\n private _disposed: boolean = false;\n private starting: boolean = false;\n\n private readonly innerHandle: IFluidHandle<this>;\n\n public get handle(): IFluidHandle<this> { return this.innerHandle; }\n private readonly stopDeferred = new Deferred<SummarizerStopReason>();\n\n constructor(\n url: string,\n /** Reference to runtime that created this object.\n * i.e. runtime with clientType === \"summarizer\"\n */\n private readonly runtime: ISummarizerRuntime,\n private readonly configurationGetter: () => ISummaryConfiguration,\n /** Represents an object that can generate summary.\n * In practical terms, it's same runtime (this.runtime) with clientType === \"summarizer\".\n */\n private readonly internalsProvider: ISummarizerInternalsProvider,\n handleContext: IFluidHandleContext,\n public readonly summaryCollection: SummaryCollection,\n private readonly runCoordinatorCreateFn:\n (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>,\n ) {\n super();\n this.logger = ChildLogger.create(this.runtime.logger, \"Summarizer\");\n this.innerHandle = new SummarizerHandle(this, url, handleContext);\n }\n\n /**\n * Creates a Summarizer and its underlying client.\n * Note that different implementations of ILoader will handle the URL differently.\n * ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's\n * starting with \"/\" as relative to the Container. The general ILoader\n * interface will expect an absolute URL and will not handle \"/\".\n * @param loader - the loader that resolves the request\n * @param url - the URL used to resolve the container\n */\n public static async create(\n loader: ILoader,\n url: string): Promise<ISummarizer> {\n const request: IRequest = {\n headers: {\n [LoaderHeader.cache]: false,\n [LoaderHeader.clientDetails]: {\n capabilities: { interactive: false },\n type: summarizerClientType,\n },\n [DriverHeader.summarizingClient]: true,\n [LoaderHeader.reconnect]: false,\n },\n url,\n };\n\n const resolvedContainer = await loader.resolve(request);\n const fluidObject =\n await requestFluidObject<FluidObject<ISummarizer>>(resolvedContainer, { url: \"_summarizer\" });\n if (fluidObject.ISummarizer === undefined) {\n throw new UsageError(\"Fluid object does not implement ISummarizer\");\n }\n return fluidObject.ISummarizer;\n }\n\n public async run(onBehalfOf: string): Promise<SummarizerStopReason> {\n try {\n return await this.runCore(onBehalfOf);\n } catch (error) {\n this.stop(\"summarizerException\");\n throw SummarizingWarning.wrap(error, false /* logged */, this.logger);\n } finally {\n this.close();\n }\n }\n\n /**\n * Stops the summarizer from running. This will complete\n * the run promise, and also close the container.\n * @param reason - reason code for stopping\n */\n public stop(reason: SummarizerStopReason) {\n this.stopDeferred.resolve(reason);\n }\n\n public close() {\n // This will result in \"summarizerClientDisconnected\" stop reason recorded in telemetry,\n // unless stop() was called earlier\n this.dispose();\n (this.runtime.disposeFn ?? this.runtime.closeFn)()\n }\n\n private async runCore(onBehalfOf: string): Promise<SummarizerStopReason> {\n const runCoordinator: ICancellableSummarizerController = await this.runCoordinatorCreateFn(this.runtime);\n\n // Wait for either external signal to cancel, or loss of connectivity.\n const stopP = Promise.race([runCoordinator.waitCancelled, this.stopDeferred.promise]);\n void stopP.then((reason) => {\n this.logger.sendTelemetryEvent({\n eventName: \"StoppingSummarizer\",\n onBehalfOf,\n reason,\n });\n });\n\n if (runCoordinator.cancelled) {\n return runCoordinator.waitCancelled;\n }\n\n const runningSummarizer = await this.start(onBehalfOf, runCoordinator);\n\n // Wait for either external signal to cancel, or loss of connectivity.\n const stopReason = await stopP;\n\n // There are two possible approaches here:\n // 1. Propagate cancellation from this.stopDeferred to runCoordinator. This will ensure that we move to the exit\n // faster, including breaking out of the RunningSummarizer.trySummarize() faster.\n // We could create new coordinator and pass it to waitStop() -> trySummarizeOnce(\"lastSummary\") flow.\n // The con of this approach is that we might cancel active summary, and lastSummary will fail because it\n // did not wait for ack/nack from previous summary. Plus we disregard any 429 kind of info from service\n // that way (i.e. trySummarize() loop might have been waiting for 5 min because storage told us so).\n // In general, it's more wasted resources.\n // 2. We can not do it and make waitStop() do last summary only if there was no active summary. This ensures\n // that client behaves properly (from server POV) and we do not waste resources. But, it may mean we wait\n // substantially longer for trySummarize() retries to play out and thus this summary loop may run into\n // conflict with new summarizer client starting on different client.\n // As of now, #2 is implemented. It's more forward looking, as issue #7279 suggests changing design for new\n // summarizer client to not be created until current summarizer fully moves to exit, and that would reduce\n // cons of #2 substantially.\n\n // Cleanup after running\n await runningSummarizer.waitStop(\n !runCoordinator.cancelled && Summarizer.stopReasonCanRunLastSummary(stopReason));\n\n // Propagate reason and ensure that if someone is waiting for cancellation token, they are moving to exit\n runCoordinator.stop(stopReason);\n\n return stopReason;\n }\n\n /**\n * Should we try to run a last summary for the given stop reason?\n * Currently only allows \"parentNotConnected\"\n * @param stopReason - SummarizerStopReason\n * @returns - true if the stop reason can run a last summary\n */\n public static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean {\n return stopReason === \"parentNotConnected\";\n }\n\n /**\n * Put the summarizer in a started state, including creating and initializing the RunningSummarizer.\n * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user\n * (in the on-demand case).\n * @param onBehalfOf - ID of the client that requested that the summarizer start\n * @param runCoordinator - cancellation token\n * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.\n * @returns - Promise that is fulfilled when the RunningSummarizer is ready\n */\n private async start(\n onBehalfOf: string,\n runCoordinator: ICancellableSummarizerController): Promise<RunningSummarizer> {\n if (this.runningSummarizer) {\n if (this.runningSummarizer.disposed) {\n throw new UsageError(\"Starting a disposed summarizer\");\n }\n return this.runningSummarizer;\n }\n if (this.starting) {\n throw new UsageError(\"Attempting to start a summarizer that is already starting\");\n }\n this.starting = true;\n // Initialize values and first ack (time is not exact)\n this.logger.sendTelemetryEvent({\n eventName: \"RunningSummarizer\",\n onBehalfOf,\n initSummarySeqNumber: this.runtime.deltaManager.initialSequenceNumber,\n config: JSON.stringify(this.configurationGetter()),\n });\n\n // Summarizing container ID (with clientType === \"summarizer\")\n const clientId = this.runtime.clientId;\n if (clientId === undefined) {\n throw new UsageError(\"clientId should be defined if connected.\");\n }\n\n const runningSummarizer = await RunningSummarizer.start(\n this.logger,\n this.summaryCollection.createWatcher(clientId),\n this.configurationGetter(),\n async (...args) => this.internalsProvider.submitSummary(...args), // submitSummaryCallback\n new SummarizeHeuristicData(\n this.runtime.deltaManager.lastSequenceNumber,\n { /** summary attempt baseline for heuristics */\n refSequenceNumber: this.runtime.deltaManager.initialSequenceNumber,\n summaryTime: Date.now(),\n } as const,\n ),\n (errorMessage: string) => {\n if (!this._disposed) {\n this.logger.sendErrorEvent({ eventName: \"summarizingError\" },\n createSummarizingWarning(errorMessage, true));\n }\n },\n this.summaryCollection,\n runCoordinator /* cancellationToken */,\n (reason) => runCoordinator.stop(reason), /* stopSummarizerCallback */\n this.runtime,\n );\n this.runningSummarizer = runningSummarizer;\n this.starting = false;\n\n // Handle summary acks\n // Note: no exceptions are thrown from handleSummaryAcks handler as it handles all exceptions\n this.handleSummaryAcks().catch((error) => {\n this.logger.sendErrorEvent({ eventName: \"HandleSummaryAckFatalError\" }, error);\n });\n\n return runningSummarizer;\n }\n\n /**\n * Disposes of resources after running. This cleanup will\n * clear any outstanding timers and reset some of the state\n * properties.\n * Called by ContainerRuntime when it is disposed, as well as at the end the run().\n */\n public dispose() {\n // Given that the call can come from own ContainerRuntime, ensure that we stop all the processes.\n this.stop(\"summarizerClientDisconnected\");\n\n this._disposed = true;\n if (this.runningSummarizer) {\n this.runningSummarizer.dispose();\n this.runningSummarizer = undefined;\n }\n }\n\n public readonly summarizeOnDemand: ISummarizer[\"summarizeOnDemand\"] = (...args) => {\n try {\n if (this._disposed || this.runningSummarizer?.disposed) {\n throw new UsageError(\"Summarizer is already disposed.\");\n }\n if (this.runtime.summarizerClientId !== undefined &&\n this.runtime.summarizerClientId !== this.runtime.clientId) {\n // If there is an elected summarizer, and it's not this one, don't allow on-demand summary.\n // This is to prevent the on-demand summary and heuristic-based summary from stepping on\n // each other.\n throw new UsageError(\"On-demand summary attempted while an elected summarizer is present\");\n }\n const builder = new SummarizeResultBuilder();\n if (this.runningSummarizer) {\n // Summarizer is already running. Go ahead and start.\n return this.runningSummarizer.summarizeOnDemand(builder, ...args);\n }\n\n // Summarizer isn't running, so we need to start it, which is an async operation.\n // Manage the promise related to creating the cancellation token here.\n // The promises related to starting, summarizing,\n // and submitting are communicated to the caller through the results builder.\n const coordinatorCreateP = this.runCoordinatorCreateFn(this.runtime);\n\n coordinatorCreateP.then((runCoordinator) => {\n // Successfully created the cancellation token. Start the summarizer.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const startP = this.start(this.runtime.clientId!, runCoordinator);\n startP.then(async (runningSummarizer) => {\n // Successfully started the summarizer. Run it.\n runningSummarizer.summarizeOnDemand(builder, ...args);\n // Wait for a command to stop or loss of connectivity before tearing down the summarizer and client.\n const stopReason = await Promise.race([this.stopDeferred.promise, runCoordinator.waitCancelled]);\n await runningSummarizer.waitStop(false);\n runCoordinator.stop(stopReason);\n this.close();\n }).catch((reason) => {\n builder.fail(\"Failed to start summarizer\", reason);\n });\n }).catch((reason) => {\n builder.fail(\"Failed to create cancellation token\", reason);\n });\n\n return builder.build();\n } catch (error) {\n throw SummarizingWarning.wrap(error, false /* logged */, this.logger);\n }\n };\n\n public readonly enqueueSummarize: ISummarizer[\"enqueueSummarize\"] = (...args) => {\n if (this._disposed || this.runningSummarizer === undefined || this.runningSummarizer.disposed) {\n throw new UsageError(\"Summarizer is not running or already disposed.\");\n }\n return this.runningSummarizer.enqueueSummarize(...args);\n };\n\n private async handleSummaryAcks() {\n let refSequenceNumber = this.runtime.deltaManager.initialSequenceNumber;\n let ack: IAckedSummary | undefined;\n while (this.runningSummarizer) {\n const summaryLogger = this.runningSummarizer.tryGetCorrelatedLogger(refSequenceNumber) ?? this.logger;\n try {\n // Initialize ack with undefined if exception happens inside of waitSummaryAck on second iteration,\n // we record undefined, not previous handles.\n ack = undefined;\n ack = await this.summaryCollection.waitSummaryAck(refSequenceNumber);\n refSequenceNumber = ack.summaryOp.referenceSequenceNumber;\n const summaryOpHandle = ack.summaryOp.contents.handle;\n const summaryAckHandle = ack.summaryAck.contents.handle;\n // Make sure we block any summarizer from being executed/enqueued while\n // executing the refreshLatestSummaryAck.\n // https://dev.azure.com/fluidframework/internal/_workitems/edit/779\n await this.runningSummarizer.lockedRefreshSummaryAckAction(async () =>\n this.internalsProvider.refreshLatestSummaryAck({\n proposalHandle: summaryOpHandle,\n ackHandle: summaryAckHandle,\n summaryRefSeq: refSequenceNumber,\n summaryLogger },\n ).catch(async (error) => {\n // If the error is 404, so maybe the fetched version no longer exists on server. We just\n // ignore this error in that case, as that means we will have another summaryAck for the\n // latest version with which we will refresh the state. However in case of single commit\n // summary, we might me missing a summary ack, so in that case we are still fine as the\n // code in `submitSummary` function in container runtime, will refresh the latest state\n // by calling `refreshLatestSummaryAckFromServer` and we will be fine.\n if (isFluidError(error)\n && error.errorType === DriverErrorType.fileNotFoundOrAccessDeniedError) {\n summaryLogger.sendTelemetryEvent({\n eventName: \"HandleSummaryAckErrorIgnored\",\n referenceSequenceNumber: refSequenceNumber,\n proposalHandle: summaryOpHandle,\n ackHandle: summaryAckHandle,\n }, error);\n } else {\n throw error;\n }\n }),\n );\n } catch (error) {\n summaryLogger.sendErrorEvent({\n eventName: \"HandleSummaryAckError\",\n referenceSequenceNumber: refSequenceNumber,\n handle: ack?.summaryOp?.contents?.handle,\n ackHandle: ack?.summaryAck?.contents?.handle,\n }, error);\n }\n refSequenceNumber++;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"summarizer.js","sourceRoot":"","sources":["../src/summarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAW,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM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C/C,EAAE,KAAK,CAAC,CAAC;aACb;YACD,iBAAiB,EAAE,CAAC;SACvB;IACL,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { Deferred } from \"@fluidframework/common-utils\";\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ILoader, LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { UsageError } from \"@fluidframework/container-utils\";\nimport { DriverErrorType, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { requestFluidObject } from \"@fluidframework/runtime-utils\";\nimport {\n ChildLogger,\n IFluidErrorBase,\n isFluidError,\n LoggingError,\n wrapErrorAndLog,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n FluidObject,\n IFluidHandleContext,\n IFluidHandle,\n IRequest,\n} from \"@fluidframework/core-interfaces\";\nimport { ISummaryConfiguration } from \"./containerRuntime\";\nimport { ICancellableSummarizerController } from \"./runWhileConnectedCoordinator\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\nimport { IAckedSummary, SummaryCollection } from \"./summaryCollection\";\nimport { SummarizerHandle } from \"./summarizerHandle\";\nimport { RunningSummarizer } from \"./runningSummarizer\";\nimport {\n ISummarizer,\n ISummarizerInternalsProvider,\n ISummarizerRuntime,\n ISummarizingWarning,\n SummarizerStopReason,\n} from \"./summarizerTypes\";\nimport { SummarizeHeuristicData } from \"./summarizerHeuristics\";\nimport { SummarizeResultBuilder } from \"./summaryGenerator\";\nimport { IConnectableRuntime } from \".\";\n\nconst summarizingError = \"summarizingError\";\n\nexport class SummarizingWarning extends LoggingError implements ISummarizingWarning, IFluidErrorBase {\n readonly errorType = summarizingError;\n readonly canRetry = true;\n\n constructor(\n errorMessage: string,\n readonly logged: boolean = false,\n ) {\n super(errorMessage);\n }\n\n static wrap(error: any, logged: boolean = false, logger: ITelemetryLogger) {\n const newErrorFn = (errMsg: string) => new SummarizingWarning(errMsg, logged);\n return wrapErrorAndLog<SummarizingWarning>(error, newErrorFn, logger);\n }\n}\n\nexport const createSummarizingWarning =\n (errorMessage: string, logged: boolean) => new SummarizingWarning(errorMessage, logged);\n\n/**\n * Summarizer is responsible for coordinating when to generate and send summaries.\n * It is the main entry point for summary work.\n * It is created only by summarizing container (i.e. one with clientType === \"summarizer\")\n */\nexport class Summarizer extends EventEmitter implements ISummarizer {\n public get IFluidLoadable() { return this; }\n public get ISummarizer() { return this; }\n\n private readonly logger: ITelemetryLogger;\n private runningSummarizer?: RunningSummarizer;\n private _disposed: boolean = false;\n private starting: boolean = false;\n\n private readonly innerHandle: IFluidHandle<this>;\n\n public get handle(): IFluidHandle<this> { return this.innerHandle; }\n private readonly stopDeferred = new Deferred<SummarizerStopReason>();\n\n constructor(\n url: string,\n /** Reference to runtime that created this object.\n * i.e. runtime with clientType === \"summarizer\"\n */\n private readonly runtime: ISummarizerRuntime,\n private readonly configurationGetter: () => ISummaryConfiguration,\n /** Represents an object that can generate summary.\n * In practical terms, it's same runtime (this.runtime) with clientType === \"summarizer\".\n */\n private readonly internalsProvider: ISummarizerInternalsProvider,\n handleContext: IFluidHandleContext,\n public readonly summaryCollection: SummaryCollection,\n private readonly runCoordinatorCreateFn:\n (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>,\n ) {\n super();\n this.logger = ChildLogger.create(this.runtime.logger, \"Summarizer\");\n this.innerHandle = new SummarizerHandle(this, url, handleContext);\n }\n\n /**\n * Creates a Summarizer and its underlying client.\n * Note that different implementations of ILoader will handle the URL differently.\n * ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's\n * starting with \"/\" as relative to the Container. The general ILoader\n * interface will expect an absolute URL and will not handle \"/\".\n * @param loader - the loader that resolves the request\n * @param url - the URL used to resolve the container\n */\n public static async create(\n loader: ILoader,\n url: string): Promise<ISummarizer> {\n const request: IRequest = {\n headers: {\n [LoaderHeader.cache]: false,\n [LoaderHeader.clientDetails]: {\n capabilities: { interactive: false },\n type: summarizerClientType,\n },\n [DriverHeader.summarizingClient]: true,\n [LoaderHeader.reconnect]: false,\n },\n url,\n };\n\n const resolvedContainer = await loader.resolve(request);\n const fluidObject =\n await requestFluidObject<FluidObject<ISummarizer>>(resolvedContainer, { url: \"_summarizer\" });\n if (fluidObject.ISummarizer === undefined) {\n throw new UsageError(\"Fluid object does not implement ISummarizer\");\n }\n return fluidObject.ISummarizer;\n }\n\n public async run(onBehalfOf: string): Promise<SummarizerStopReason> {\n try {\n return await this.runCore(onBehalfOf);\n } catch (error) {\n this.stop(\"summarizerException\");\n throw SummarizingWarning.wrap(error, false /* logged */, this.logger);\n } finally {\n this.close();\n }\n }\n\n /**\n * Stops the summarizer from running. This will complete\n * the run promise, and also close the container.\n * @param reason - reason code for stopping\n */\n public stop(reason: SummarizerStopReason) {\n this.stopDeferred.resolve(reason);\n }\n\n public close() {\n // This will result in \"summarizerClientDisconnected\" stop reason recorded in telemetry,\n // unless stop() was called earlier\n this.dispose();\n (this.runtime.disposeFn ?? this.runtime.closeFn)();\n }\n\n private async runCore(onBehalfOf: string): Promise<SummarizerStopReason> {\n const runCoordinator: ICancellableSummarizerController = await this.runCoordinatorCreateFn(this.runtime);\n\n // Wait for either external signal to cancel, or loss of connectivity.\n const stopP = Promise.race([runCoordinator.waitCancelled, this.stopDeferred.promise]);\n void stopP.then((reason) => {\n this.logger.sendTelemetryEvent({\n eventName: \"StoppingSummarizer\",\n onBehalfOf,\n reason,\n });\n });\n\n if (runCoordinator.cancelled) {\n return runCoordinator.waitCancelled;\n }\n\n const runningSummarizer = await this.start(onBehalfOf, runCoordinator);\n\n // Wait for either external signal to cancel, or loss of connectivity.\n const stopReason = await stopP;\n\n // There are two possible approaches here:\n // 1. Propagate cancellation from this.stopDeferred to runCoordinator. This will ensure that we move to the exit\n // faster, including breaking out of the RunningSummarizer.trySummarize() faster.\n // We could create new coordinator and pass it to waitStop() -> trySummarizeOnce(\"lastSummary\") flow.\n // The con of this approach is that we might cancel active summary, and lastSummary will fail because it\n // did not wait for ack/nack from previous summary. Plus we disregard any 429 kind of info from service\n // that way (i.e. trySummarize() loop might have been waiting for 5 min because storage told us so).\n // In general, it's more wasted resources.\n // 2. We can not do it and make waitStop() do last summary only if there was no active summary. This ensures\n // that client behaves properly (from server POV) and we do not waste resources. But, it may mean we wait\n // substantially longer for trySummarize() retries to play out and thus this summary loop may run into\n // conflict with new summarizer client starting on different client.\n // As of now, #2 is implemented. It's more forward looking, as issue #7279 suggests changing design for new\n // summarizer client to not be created until current summarizer fully moves to exit, and that would reduce\n // cons of #2 substantially.\n\n // Cleanup after running\n await runningSummarizer.waitStop(\n !runCoordinator.cancelled && Summarizer.stopReasonCanRunLastSummary(stopReason));\n\n // Propagate reason and ensure that if someone is waiting for cancellation token, they are moving to exit\n runCoordinator.stop(stopReason);\n\n return stopReason;\n }\n\n /**\n * Should we try to run a last summary for the given stop reason?\n * Currently only allows \"parentNotConnected\"\n * @param stopReason - SummarizerStopReason\n * @returns - true if the stop reason can run a last summary\n */\n public static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean {\n return stopReason === \"parentNotConnected\";\n }\n\n /**\n * Put the summarizer in a started state, including creating and initializing the RunningSummarizer.\n * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user\n * (in the on-demand case).\n * @param onBehalfOf - ID of the client that requested that the summarizer start\n * @param runCoordinator - cancellation token\n * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.\n * @returns - Promise that is fulfilled when the RunningSummarizer is ready\n */\n private async start(\n onBehalfOf: string,\n runCoordinator: ICancellableSummarizerController): Promise<RunningSummarizer> {\n if (this.runningSummarizer) {\n if (this.runningSummarizer.disposed) {\n throw new UsageError(\"Starting a disposed summarizer\");\n }\n return this.runningSummarizer;\n }\n if (this.starting) {\n throw new UsageError(\"Attempting to start a summarizer that is already starting\");\n }\n this.starting = true;\n // Initialize values and first ack (time is not exact)\n this.logger.sendTelemetryEvent({\n eventName: \"RunningSummarizer\",\n onBehalfOf,\n initSummarySeqNumber: this.runtime.deltaManager.initialSequenceNumber,\n config: JSON.stringify(this.configurationGetter()),\n });\n\n // Summarizing container ID (with clientType === \"summarizer\")\n const clientId = this.runtime.clientId;\n if (clientId === undefined) {\n throw new UsageError(\"clientId should be defined if connected.\");\n }\n\n const runningSummarizer = await RunningSummarizer.start(\n this.logger,\n this.summaryCollection.createWatcher(clientId),\n this.configurationGetter(),\n async (...args) => this.internalsProvider.submitSummary(...args), // submitSummaryCallback\n new SummarizeHeuristicData(\n this.runtime.deltaManager.lastSequenceNumber,\n { /** summary attempt baseline for heuristics */\n refSequenceNumber: this.runtime.deltaManager.initialSequenceNumber,\n summaryTime: Date.now(),\n } as const,\n ),\n (errorMessage: string) => {\n if (!this._disposed) {\n this.logger.sendErrorEvent({ eventName: \"summarizingError\" },\n createSummarizingWarning(errorMessage, true));\n }\n },\n this.summaryCollection,\n runCoordinator /* cancellationToken */,\n (reason) => runCoordinator.stop(reason), /* stopSummarizerCallback */\n this.runtime,\n );\n this.runningSummarizer = runningSummarizer;\n this.starting = false;\n\n // Handle summary acks\n // Note: no exceptions are thrown from handleSummaryAcks handler as it handles all exceptions\n this.handleSummaryAcks().catch((error) => {\n this.logger.sendErrorEvent({ eventName: \"HandleSummaryAckFatalError\" }, error);\n });\n\n return runningSummarizer;\n }\n\n /**\n * Disposes of resources after running. This cleanup will\n * clear any outstanding timers and reset some of the state\n * properties.\n * Called by ContainerRuntime when it is disposed, as well as at the end the run().\n */\n public dispose() {\n // Given that the call can come from own ContainerRuntime, ensure that we stop all the processes.\n this.stop(\"summarizerClientDisconnected\");\n\n this._disposed = true;\n if (this.runningSummarizer) {\n this.runningSummarizer.dispose();\n this.runningSummarizer = undefined;\n }\n }\n\n public readonly summarizeOnDemand: ISummarizer[\"summarizeOnDemand\"] = (...args) => {\n try {\n if (this._disposed || this.runningSummarizer?.disposed) {\n throw new UsageError(\"Summarizer is already disposed.\");\n }\n if (this.runtime.summarizerClientId !== undefined &&\n this.runtime.summarizerClientId !== this.runtime.clientId) {\n // If there is an elected summarizer, and it's not this one, don't allow on-demand summary.\n // This is to prevent the on-demand summary and heuristic-based summary from stepping on\n // each other.\n throw new UsageError(\"On-demand summary attempted while an elected summarizer is present\");\n }\n const builder = new SummarizeResultBuilder();\n if (this.runningSummarizer) {\n // Summarizer is already running. Go ahead and start.\n return this.runningSummarizer.summarizeOnDemand(builder, ...args);\n }\n\n // Summarizer isn't running, so we need to start it, which is an async operation.\n // Manage the promise related to creating the cancellation token here.\n // The promises related to starting, summarizing,\n // and submitting are communicated to the caller through the results builder.\n const coordinatorCreateP = this.runCoordinatorCreateFn(this.runtime);\n\n coordinatorCreateP.then((runCoordinator) => {\n // Successfully created the cancellation token. Start the summarizer.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const startP = this.start(this.runtime.clientId!, runCoordinator);\n startP.then(async (runningSummarizer) => {\n // Successfully started the summarizer. Run it.\n runningSummarizer.summarizeOnDemand(builder, ...args);\n // Wait for a command to stop or loss of connectivity before tearing down the summarizer and client.\n const stopReason = await Promise.race([this.stopDeferred.promise, runCoordinator.waitCancelled]);\n await runningSummarizer.waitStop(false);\n runCoordinator.stop(stopReason);\n this.close();\n }).catch((reason) => {\n builder.fail(\"Failed to start summarizer\", reason);\n });\n }).catch((reason) => {\n builder.fail(\"Failed to create cancellation token\", reason);\n });\n\n return builder.build();\n } catch (error) {\n throw SummarizingWarning.wrap(error, false /* logged */, this.logger);\n }\n };\n\n public readonly enqueueSummarize: ISummarizer[\"enqueueSummarize\"] = (...args) => {\n if (this._disposed || this.runningSummarizer === undefined || this.runningSummarizer.disposed) {\n throw new UsageError(\"Summarizer is not running or already disposed.\");\n }\n return this.runningSummarizer.enqueueSummarize(...args);\n };\n\n private async handleSummaryAcks() {\n let refSequenceNumber = this.runtime.deltaManager.initialSequenceNumber;\n let ack: IAckedSummary | undefined;\n while (this.runningSummarizer) {\n const summaryLogger = this.runningSummarizer.tryGetCorrelatedLogger(refSequenceNumber) ?? this.logger;\n try {\n // Initialize ack with undefined if exception happens inside of waitSummaryAck on second iteration,\n // we record undefined, not previous handles.\n ack = undefined;\n ack = await this.summaryCollection.waitSummaryAck(refSequenceNumber);\n refSequenceNumber = ack.summaryOp.referenceSequenceNumber;\n const summaryOpHandle = ack.summaryOp.contents.handle;\n const summaryAckHandle = ack.summaryAck.contents.handle;\n // Make sure we block any summarizer from being executed/enqueued while\n // executing the refreshLatestSummaryAck.\n // https://dev.azure.com/fluidframework/internal/_workitems/edit/779\n await this.runningSummarizer.lockedRefreshSummaryAckAction(async () =>\n this.internalsProvider.refreshLatestSummaryAck({\n proposalHandle: summaryOpHandle,\n ackHandle: summaryAckHandle,\n summaryRefSeq: refSequenceNumber,\n summaryLogger },\n ).catch(async (error) => {\n // If the error is 404, so maybe the fetched version no longer exists on server. We just\n // ignore this error in that case, as that means we will have another summaryAck for the\n // latest version with which we will refresh the state. However in case of single commit\n // summary, we might me missing a summary ack, so in that case we are still fine as the\n // code in `submitSummary` function in container runtime, will refresh the latest state\n // by calling `refreshLatestSummaryAckFromServer` and we will be fine.\n if (isFluidError(error)\n && error.errorType === DriverErrorType.fileNotFoundOrAccessDeniedError) {\n summaryLogger.sendTelemetryEvent({\n eventName: \"HandleSummaryAckErrorIgnored\",\n referenceSequenceNumber: refSequenceNumber,\n proposalHandle: summaryOpHandle,\n ackHandle: summaryAckHandle,\n }, error);\n } else {\n throw error;\n }\n }),\n );\n } catch (error) {\n summaryLogger.sendErrorEvent({\n eventName: \"HandleSummaryAckError\",\n referenceSequenceNumber: refSequenceNumber,\n handle: ack?.summaryOp?.contents?.handle,\n ackHandle: ack?.summaryAck?.contents?.handle,\n }, error);\n }\n refSequenceNumber++;\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-runtime",
|
|
3
|
-
"version": "2.0.0-internal.2.
|
|
3
|
+
"version": "2.0.0-internal.2.4.0",
|
|
4
4
|
"description": "Fluid container runtime",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -65,32 +65,32 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
67
67
|
"@fluidframework/common-utils": "^1.0.0",
|
|
68
|
-
"@fluidframework/container-definitions": ">=2.0.0-internal.2.
|
|
69
|
-
"@fluidframework/container-runtime-definitions": ">=2.0.0-internal.2.
|
|
70
|
-
"@fluidframework/container-utils": ">=2.0.0-internal.2.
|
|
71
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.
|
|
72
|
-
"@fluidframework/datastore": ">=2.0.0-internal.2.
|
|
73
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.
|
|
74
|
-
"@fluidframework/driver-utils": ">=2.0.0-internal.2.
|
|
75
|
-
"@fluidframework/garbage-collector": ">=2.0.0-internal.2.
|
|
68
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
69
|
+
"@fluidframework/container-runtime-definitions": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
70
|
+
"@fluidframework/container-utils": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
71
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
72
|
+
"@fluidframework/datastore": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
73
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
74
|
+
"@fluidframework/driver-utils": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
75
|
+
"@fluidframework/garbage-collector": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
76
76
|
"@fluidframework/protocol-base": "^0.1038.2000",
|
|
77
77
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
78
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-internal.2.
|
|
79
|
-
"@fluidframework/runtime-utils": ">=2.0.0-internal.2.
|
|
80
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-internal.2.
|
|
78
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
79
|
+
"@fluidframework/runtime-utils": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
80
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
81
81
|
"double-ended-queue": "^2.1.0-0",
|
|
82
82
|
"events": "^3.1.0",
|
|
83
83
|
"lz4js": "^0.2.0",
|
|
84
84
|
"uuid": "^8.3.1"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@fluid-tools/build-cli": "^0.
|
|
87
|
+
"@fluid-tools/build-cli": "^0.8.0",
|
|
88
88
|
"@fluidframework/build-common": "^1.1.0",
|
|
89
|
-
"@fluidframework/build-tools": "^0.
|
|
89
|
+
"@fluidframework/build-tools": "^0.8.0",
|
|
90
90
|
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.0.0-internal.2.2.0",
|
|
91
91
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
92
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.
|
|
93
|
-
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.2.
|
|
92
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
93
|
+
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
94
94
|
"@microsoft/api-extractor": "^7.22.2",
|
|
95
95
|
"@rushstack/eslint-config": "^2.5.1",
|
|
96
96
|
"@types/double-ended-queue": "^2.1.0",
|
package/src/blobManager.ts
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "@fluidframework/runtime-definitions";
|
|
25
25
|
import { Throttler, formExponentialFn, IThrottler } from "./throttler";
|
|
26
26
|
import { summarizerClientType } from "./summarizerClientElection";
|
|
27
|
-
import {
|
|
27
|
+
import { throwOnTombstoneLoadKey } from "./garbageCollectionConstants";
|
|
28
28
|
import { sendGCTombstoneEvent } from "./garbageCollectionTombstoneUtils";
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -101,12 +101,17 @@ enum PendingBlobStatus {
|
|
|
101
101
|
OfflinePendingOp,
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
type ICreateBlobResponseWithTTL = ICreateBlobResponse & Partial<Record<"minTTLInSeconds", number>>;
|
|
105
|
+
|
|
104
106
|
interface PendingBlob {
|
|
105
107
|
blob: ArrayBufferLike;
|
|
106
108
|
status: PendingBlobStatus;
|
|
107
109
|
storageId?: string;
|
|
108
110
|
handleP: Deferred<IFluidHandle<ArrayBufferLike>>;
|
|
109
111
|
uploadP: Promise<ICreateBlobResponse>;
|
|
112
|
+
localUploadTime?: number;
|
|
113
|
+
serverUploadTime?: number;
|
|
114
|
+
minTTLInSeconds?: number;
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
export interface IPendingBlobs { [id: string]: { blob: string; }; }
|
|
@@ -151,7 +156,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
151
156
|
));
|
|
152
157
|
|
|
153
158
|
/** If true, throw an error when a tombstone attachment blob is retrieved. */
|
|
154
|
-
private readonly
|
|
159
|
+
private readonly throwOnTombstoneLoad: boolean;
|
|
155
160
|
/**
|
|
156
161
|
* This stores IDs of tombstoned blobs.
|
|
157
162
|
* Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.
|
|
@@ -179,12 +184,13 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
179
184
|
private readonly addedBlobReference: (fromNodePath: string, toNodePath: string) => void,
|
|
180
185
|
private readonly runtime: IBlobManagerRuntime,
|
|
181
186
|
stashedBlobs: IPendingBlobs = {},
|
|
187
|
+
private readonly getCurrentReferenceTimestampMs: () => number | undefined,
|
|
182
188
|
) {
|
|
183
189
|
super();
|
|
184
190
|
this.mc = loggerToMonitoringContext(ChildLogger.create(this.runtime.logger, "BlobManager"));
|
|
185
191
|
// Read the feature flag that tells whether to throw when a tombstone blob is requested.
|
|
186
|
-
this.
|
|
187
|
-
this.mc.config.getBoolean(
|
|
192
|
+
this.throwOnTombstoneLoad =
|
|
193
|
+
this.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&
|
|
188
194
|
this.runtime.clientDetails.type !== summarizerClientType;
|
|
189
195
|
|
|
190
196
|
this.runtime.on("disconnected", () => this.onDisconnected());
|
|
@@ -274,13 +280,18 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
274
280
|
public async getBlob(blobId: string): Promise<ArrayBufferLike> {
|
|
275
281
|
const request = { url: blobId };
|
|
276
282
|
if (this.tombstonedBlobs.has(blobId) ) {
|
|
277
|
-
const error = responseToException(createResponseError(404, "Blob
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
283
|
+
const error = responseToException(createResponseError(404, "Blob was deleted", request), request);
|
|
284
|
+
sendGCTombstoneEvent(
|
|
285
|
+
this.mc,
|
|
286
|
+
{
|
|
287
|
+
eventName: "GC_Tombstone_Blob_Requested",
|
|
288
|
+
category: this.throwOnTombstoneLoad ? "error" : "generic",
|
|
289
|
+
isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
|
|
290
|
+
},
|
|
291
|
+
[BlobManager.basePath],
|
|
292
|
+
error,
|
|
293
|
+
);
|
|
294
|
+
if (this.throwOnTombstoneLoad) {
|
|
284
295
|
throw error;
|
|
285
296
|
}
|
|
286
297
|
}
|
|
@@ -393,12 +404,15 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
393
404
|
}
|
|
394
405
|
}
|
|
395
406
|
|
|
396
|
-
private onUploadResolve(localId: string, response:
|
|
407
|
+
private onUploadResolve(localId: string, response: ICreateBlobResponseWithTTL) {
|
|
397
408
|
const entry = this.pendingBlobs.get(localId);
|
|
398
409
|
assert(entry?.status === PendingBlobStatus.OnlinePendingUpload ||
|
|
399
410
|
entry?.status === PendingBlobStatus.OfflinePendingUpload,
|
|
400
411
|
0x386 /* Must have pending blob entry for uploaded blob */);
|
|
401
412
|
entry.storageId = response.id;
|
|
413
|
+
entry.localUploadTime = Date.now();
|
|
414
|
+
entry.minTTLInSeconds = response.minTTLInSeconds;
|
|
415
|
+
entry.serverUploadTime = this.getCurrentReferenceTimestampMs();
|
|
402
416
|
if (this.runtime.connected) {
|
|
403
417
|
if (entry.status === PendingBlobStatus.OnlinePendingUpload) {
|
|
404
418
|
// Send a blob attach op. This serves two purposes:
|
|
@@ -406,6 +420,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
406
420
|
// until its storage ID is added to the next summary.
|
|
407
421
|
// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the
|
|
408
422
|
// blob from the server via the storage ID.
|
|
423
|
+
this.logTimeInfo(entry, "sendBlobAttachResolveTTL");
|
|
409
424
|
this.sendBlobAttachOp(localId, response.id);
|
|
410
425
|
if (this.storageIds.has(response.id)) {
|
|
411
426
|
// The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is
|
|
@@ -467,6 +482,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
467
482
|
* is called on reconnection.
|
|
468
483
|
*/
|
|
469
484
|
if (entry.status !== PendingBlobStatus.OnlinePendingOp) {
|
|
485
|
+
this.logTimeInfo(entry, "sendBlobAttachTransitionOfflineTTL");
|
|
470
486
|
this.sendBlobAttachOp(localId, entry.storageId);
|
|
471
487
|
}
|
|
472
488
|
|
|
@@ -486,9 +502,12 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
486
502
|
assert(!!metadata, 0x38b /* Resubmitted ops must have metadata */);
|
|
487
503
|
const { localId, blobId }: { localId?: string; blobId?: string } = metadata;
|
|
488
504
|
assert(localId !== undefined, 0x50d /* local ID not available on reSubmit */);
|
|
505
|
+
const pendingEntry = this.pendingBlobs.get(localId);
|
|
506
|
+
if (pendingEntry) {
|
|
507
|
+
this.logTimeInfo(pendingEntry, "sendBlobAttachResubmitTTL");
|
|
508
|
+
}
|
|
489
509
|
if (!blobId) {
|
|
490
510
|
// We submitted this op while offline. The blob should have been uploaded by now.
|
|
491
|
-
const pendingEntry = this.pendingBlobs.get(localId);
|
|
492
511
|
assert(pendingEntry?.status === PendingBlobStatus.OfflinePendingOp &&
|
|
493
512
|
!!pendingEntry?.storageId, 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);
|
|
494
513
|
return this.sendBlobAttachOp(localId, pendingEntry.storageId);
|
|
@@ -496,6 +515,31 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
496
515
|
return this.sendBlobAttachOp(localId, blobId);
|
|
497
516
|
}
|
|
498
517
|
|
|
518
|
+
private logTimeInfo(pendingEntry: PendingBlob, eventName: string) {
|
|
519
|
+
let timeLapseSinceLocalUpload: number = 0;
|
|
520
|
+
let timeLapseSinceServerUpload: number = 0;
|
|
521
|
+
let expiredUsingLocalTime;
|
|
522
|
+
let expiredUsingServerTime;
|
|
523
|
+
if(pendingEntry.localUploadTime){
|
|
524
|
+
timeLapseSinceLocalUpload = (Date.now() - pendingEntry.localUploadTime) / 1000;
|
|
525
|
+
expiredUsingLocalTime = (pendingEntry.minTTLInSeconds?? 0) - timeLapseSinceLocalUpload < 0 ? true : false;
|
|
526
|
+
}
|
|
527
|
+
if(pendingEntry.serverUploadTime){
|
|
528
|
+
timeLapseSinceServerUpload = (Date.now() - pendingEntry.serverUploadTime) / 1000;
|
|
529
|
+
expiredUsingServerTime = (pendingEntry.minTTLInSeconds?? 0) - timeLapseSinceServerUpload < 0 ? true : false;
|
|
530
|
+
}
|
|
531
|
+
this.mc.logger.sendTelemetryEvent({
|
|
532
|
+
eventName,
|
|
533
|
+
entryStatus: pendingEntry.status,
|
|
534
|
+
timeLapseSinceLocalUpload,
|
|
535
|
+
timeLapseSinceServerUpload,
|
|
536
|
+
minTTLInSeconds: pendingEntry.minTTLInSeconds,
|
|
537
|
+
expiredUsingLocalTime,
|
|
538
|
+
expiredUsingServerTime,
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
}
|
|
542
|
+
|
|
499
543
|
public processBlobAttachOp(message: ISequencedDocumentMessage, local: boolean) {
|
|
500
544
|
const localId = message.metadata?.localId;
|
|
501
545
|
const blobId = message.metadata?.blobId;
|