@fluidframework/container-runtime 2.62.0-356644 → 2.62.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/.eslintrc.cjs +4 -72
- package/CHANGELOG.md +4 -0
- package/container-runtime.test-files.tar +0 -0
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +10 -7
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
- package/dist/channelCollection.js +2 -2
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +1 -2
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +93 -96
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +2 -2
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/deltaScheduler.js +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +3 -1
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.js +3 -1
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +4 -3
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/inboundBatchAggregator.js +1 -1
- package/dist/inboundBatchAggregator.js.map +1 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +2 -1
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +2 -2
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +8 -3
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js +3 -2
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.js +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js +1 -1
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +10 -7
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
- package/lib/channelCollection.js +2 -2
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +1 -2
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +22 -25
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +2 -2
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/deltaScheduler.js +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +3 -1
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.js +3 -1
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +4 -3
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/inboundBatchAggregator.js +1 -1
- package/lib/inboundBatchAggregator.js.map +1 -1
- package/lib/metadata.d.ts.map +1 -1
- package/lib/metadata.js +2 -1
- package/lib/metadata.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +2 -2
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +8 -3
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js +3 -2
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.js +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js +1 -1
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
- package/package.json +18 -18
- package/src/blobManager/blobManager.ts +12 -7
- package/src/blobManager/blobManagerSnapSum.ts +1 -1
- package/src/channelCollection.ts +3 -3
- package/src/containerRuntime.ts +58 -65
- package/src/dataStoreContext.ts +3 -3
- package/src/deltaScheduler.ts +1 -1
- package/src/gc/garbageCollection.ts +5 -2
- package/src/gc/gcConfigs.ts +3 -3
- package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
- package/src/gc/gcTelemetry.ts +4 -5
- package/src/inboundBatchAggregator.ts +1 -1
- package/src/metadata.ts +2 -1
- package/src/opLifecycle/opGroupingManager.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +11 -5
- package/src/summary/summaryDelayLoadedModule/runningSummarizer.ts +3 -2
- package/src/summary/summaryDelayLoadedModule/summarizer.ts +1 -1
- package/src/summary/summaryDelayLoadedModule/summaryGenerator.ts +1 -1
package/.eslintrc.cjs
CHANGED
|
@@ -4,87 +4,19 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
extends: [require.resolve("@fluidframework/eslint-config-fluid"), "prettier"],
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/recommended"), "prettier"],
|
|
8
8
|
parserOptions: {
|
|
9
9
|
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
10
|
},
|
|
11
|
-
rules: {
|
|
12
|
-
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
13
|
-
|
|
14
|
-
// TODO: fix violations and remove overrides
|
|
15
|
-
"@fluid-internal/fluid/no-unchecked-record-access": "warn",
|
|
16
|
-
"require-atomic-updates": "warn",
|
|
17
|
-
"unicorn/no-array-reduce": "warn",
|
|
18
|
-
|
|
19
|
-
// False positives on non-array `push` methods.
|
|
20
|
-
// TODO:AB#28686: remove this override once this rule has been disabled in the root config.
|
|
21
|
-
"unicorn/no-array-push-push": "off",
|
|
22
|
-
|
|
23
|
-
// #region TODO:AB#3027: remove overrides and upgrade config to `recommended`
|
|
24
|
-
|
|
25
|
-
"@typescript-eslint/explicit-function-return-type": [
|
|
26
|
-
"error",
|
|
27
|
-
{
|
|
28
|
-
allowExpressions: true,
|
|
29
|
-
allowTypedFunctionExpressions: true,
|
|
30
|
-
allowHigherOrderFunctions: true,
|
|
31
|
-
allowDirectConstAssertionInArrowFunctions: true,
|
|
32
|
-
allowConciseArrowFunctionExpressionsStartingWithVoid: false,
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
"@typescript-eslint/explicit-module-boundary-types": "error",
|
|
36
|
-
"@typescript-eslint/no-explicit-any": [
|
|
37
|
-
"error",
|
|
38
|
-
{
|
|
39
|
-
/**
|
|
40
|
-
* For certain cases, like rest parameters, any is required to allow arbitrary argument types.
|
|
41
|
-
* @see https://typescript-eslint.io/rules/no-explicit-any/#ignorerestargs
|
|
42
|
-
*/
|
|
43
|
-
ignoreRestArgs: true,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
"@typescript-eslint/no-unsafe-argument": "error",
|
|
47
|
-
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
48
|
-
"@typescript-eslint/no-unsafe-call": "error",
|
|
49
|
-
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
50
|
-
"@typescript-eslint/no-unsafe-return": "error",
|
|
51
|
-
|
|
52
|
-
"jsdoc/multiline-blocks": ["error", { noSingleLineBlocks: true }],
|
|
53
|
-
"jsdoc/require-description": ["error", { checkConstructors: false }],
|
|
54
|
-
|
|
55
|
-
"unicorn/catch-error-name": "error",
|
|
56
|
-
"unicorn/consistent-destructuring": "error",
|
|
57
|
-
"unicorn/consistent-function-scoping": "error",
|
|
58
|
-
"unicorn/error-message": "error",
|
|
59
|
-
"unicorn/explicit-length-check": "error",
|
|
60
|
-
"unicorn/new-for-builtins": "error",
|
|
61
|
-
"unicorn/no-array-callback-reference": "error",
|
|
62
|
-
"unicorn/no-array-for-each": "error",
|
|
63
|
-
"unicorn/no-lonely-if": "error",
|
|
64
|
-
"unicorn/no-negated-condition": "error",
|
|
65
|
-
"unicorn/no-new-array": "error",
|
|
66
|
-
"unicorn/no-null": "error",
|
|
67
|
-
"unicorn/no-zero-fractions": "error",
|
|
68
|
-
"unicorn/prefer-includes": "error",
|
|
69
|
-
"unicorn/prefer-node-protocol": "error",
|
|
70
|
-
"unicorn/prefer-number-properties": "error",
|
|
71
|
-
"unicorn/prefer-optional-catch-binding": "error",
|
|
72
|
-
"unicorn/prefer-spread": "error",
|
|
73
|
-
"unicorn/prefer-string-slice": "error",
|
|
74
|
-
"unicorn/switch-case-braces": "error",
|
|
75
|
-
"unicorn/throw-new-error": "error",
|
|
76
|
-
|
|
77
|
-
// #endregion
|
|
78
|
-
},
|
|
11
|
+
rules: {},
|
|
79
12
|
overrides: [
|
|
80
13
|
{
|
|
81
14
|
// Rules only for test files
|
|
82
15
|
files: ["*.spec.ts", "src/test/**"],
|
|
83
16
|
rules: {
|
|
84
17
|
// TODO: remove these overrides and fix violations
|
|
85
|
-
"@typescript-eslint/explicit-function-return-type": "
|
|
86
|
-
"unicorn/consistent-function-scoping": "
|
|
87
|
-
"unicorn/error-message": "warn",
|
|
18
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
19
|
+
"unicorn/consistent-function-scoping": "off",
|
|
88
20
|
|
|
89
21
|
// Test files are run in node only so additional node libraries can be used.
|
|
90
22
|
"import/no-nodejs-modules": ["error", { allow: ["node:assert", "node:crypto"] }],
|
package/CHANGELOG.md
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManager.d.ts","sourceRoot":"","sources":["../../src/blobManager/blobManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,KAAK,wBAAwB,EAC7B,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,iBAAiB,EACjB,uBAAuB,EACvB,MAAM,wDAAwD,CAAC;AAChE,OAAO,KAAK,EAEX,cAAc,EACd,mBAAmB,EACnB,kCAAkC,EAClC,iBAAiB,EACjB,uBAAuB,EACvB,UAAU,EACV,YAAY,EACZ,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EACX,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,eAAe,EAIf,MAAM,wCAAwC,CAAC;AAYhD,OAAO,EAIN,KAAK,oBAAoB,EACzB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,qBAAa,UACZ,SAAQ,eAAe,CAAC,eAAe,CACvC,YACC,iBAAiB,CAAC,eAAe,CAAC,EAClC,kCAAkC,CAAC,eAAe,CAAC;aAgCnC,IAAI,EAAE,MAAM;aACZ,YAAY,EAAE,mBAAmB;IAC1C,GAAG,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC;aAC1B,cAAc,EAAE,OAAO;IACvC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IAlChC,OAAO,CAAC,QAAQ,CAAkB;IAElC,IAAW,UAAU,IAAI,OAAO,CAE/B;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C;CAGrC;AAmBD;;GAEG;AACH,eAAO,MAAM,UAAU,SAAU,MAAM,gCACL,CAAC"}
|
|
@@ -118,7 +118,8 @@ class BlobManager {
|
|
|
118
118
|
this.sendBlobAttachOp = (localId, storageId) => {
|
|
119
119
|
const pendingEntry = this.pendingBlobs.get(localId);
|
|
120
120
|
(0, internal_2.assert)(pendingEntry !== undefined, 0x725 /* Must have pending blob entry for upcoming op */);
|
|
121
|
-
if (pendingEntry?.uploadTime
|
|
121
|
+
if (pendingEntry?.uploadTime !== undefined &&
|
|
122
|
+
pendingEntry?.minTTLInSeconds !== undefined) {
|
|
122
123
|
const secondsSinceUpload = (Date.now() - pendingEntry.uploadTime) / 1000;
|
|
123
124
|
const expired = pendingEntry.minTTLInSeconds - secondsSinceUpload < 0;
|
|
124
125
|
this.mc.logger.sendTelemetryEvent({
|
|
@@ -210,6 +211,8 @@ class BlobManager {
|
|
|
210
211
|
// eventually and wait. We do this even if the local client doesn't have the blob payloadPending flag
|
|
211
212
|
// enabled, in case a remote client does have it enabled. This wait may be infinite if the uploading
|
|
212
213
|
// client failed the upload and doesn't exist anymore.
|
|
214
|
+
// TODO: Fix this violation and remove the disable
|
|
215
|
+
// eslint-disable-next-line require-atomic-updates
|
|
213
216
|
storageId = await new Promise((resolve) => {
|
|
214
217
|
const onProcessBlobAttach = (_localId, _storageId) => {
|
|
215
218
|
if (_localId === localId) {
|
|
@@ -269,7 +272,7 @@ class BlobManager {
|
|
|
269
272
|
: this.createBlobLegacy(blob, signal);
|
|
270
273
|
}
|
|
271
274
|
async createBlobLegacy(blob, signal) {
|
|
272
|
-
if (signal?.aborted) {
|
|
275
|
+
if (signal?.aborted === true) {
|
|
273
276
|
throw this.createAbortError();
|
|
274
277
|
}
|
|
275
278
|
// Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to
|
|
@@ -286,7 +289,7 @@ class BlobManager {
|
|
|
286
289
|
};
|
|
287
290
|
this.pendingBlobs.set(localId, pendingEntry);
|
|
288
291
|
const abortListener = () => {
|
|
289
|
-
if (
|
|
292
|
+
if (pendingEntry.acked !== true) {
|
|
290
293
|
pendingEntry.handleP.reject(this.createAbortError(pendingEntry));
|
|
291
294
|
}
|
|
292
295
|
};
|
|
@@ -379,7 +382,7 @@ class BlobManager {
|
|
|
379
382
|
deletePendingBlobMaybe(localId) {
|
|
380
383
|
if (this.pendingBlobs.has(localId)) {
|
|
381
384
|
const entry = this.pendingBlobs.get(localId);
|
|
382
|
-
if (entry?.attached && entry?.acked) {
|
|
385
|
+
if (entry?.attached === true && entry?.acked === true) {
|
|
383
386
|
this.deletePendingBlob(localId);
|
|
384
387
|
}
|
|
385
388
|
}
|
|
@@ -392,7 +395,7 @@ class BlobManager {
|
|
|
392
395
|
onUploadResolve(localId, response) {
|
|
393
396
|
const entry = this.pendingBlobs.get(localId);
|
|
394
397
|
(0, internal_2.assert)(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);
|
|
395
|
-
if (entry.abortSignal?.aborted === true &&
|
|
398
|
+
if (entry.abortSignal?.aborted === true && entry.opsent !== true) {
|
|
396
399
|
this.mc.logger.sendTelemetryEvent({
|
|
397
400
|
eventName: "BlobAborted",
|
|
398
401
|
localId,
|
|
@@ -409,7 +412,7 @@ class BlobManager {
|
|
|
409
412
|
// until its storage ID is added to the next summary.
|
|
410
413
|
// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the
|
|
411
414
|
// blob from the server via the storage ID.
|
|
412
|
-
if (
|
|
415
|
+
if (entry.opsent !== true) {
|
|
413
416
|
this.sendBlobAttachOp(localId, response.id);
|
|
414
417
|
}
|
|
415
418
|
const storageIds = (0, blobManagerSnapSum_js_1.getStorageIds)(this.redirectTable);
|
|
@@ -460,7 +463,7 @@ class BlobManager {
|
|
|
460
463
|
(0, internal_2.assert)((0, metadata_js_1.isBlobMetadata)(message.metadata), 0xc02 /* Expected blob metadata for a BlobAttach op */);
|
|
461
464
|
const { localId, blobId: storageId } = message.metadata;
|
|
462
465
|
const pendingEntry = this.pendingBlobs.get(localId);
|
|
463
|
-
if (pendingEntry?.abortSignal?.aborted) {
|
|
466
|
+
if (pendingEntry?.abortSignal?.aborted === true) {
|
|
464
467
|
this.deletePendingBlob(localId);
|
|
465
468
|
return;
|
|
466
469
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../../src/blobManager/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA6D;AAC7D,6EAGwD;AAexD,kEAAuE;AAQvE,qEAKgD;AAChD,uEAMkD;AAClD,+BAAkC;AAElC,gDAAgD;AAEhD,mEAKiC;AAEjC;;;;;;GAMG;AACH,MAAa,UACZ,SAAQ,0BAAgC;IAOxC,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC;IACtD,CAAC;IAKD,IAAW,MAAM;QAChB,OAAO,CAAC,IAAI,CAAC,OAAO,KAAK,IAAA,4BAAa,GAA2B,CAAC,CAAC;IACpE,CAAC;IAGD,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAOD,IAAW,iBAAiB;QAC3B,OAAO,IAAI,CAAC,kBAAkB,CAAC;IAChC,CAAC;IAID,YACiB,IAAY,EACZ,YAAiC,EAC1C,GAAmC,EAC1B,cAAuB,EACtB,aAA0B;QAE3C,KAAK,EAAE,CAAC;QANQ,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAqB;QAC1C,QAAG,GAAH,GAAG,CAAgC;QAC1B,mBAAc,GAAd,cAAc,CAAS;QACtB,kBAAa,GAAb,aAAa,CAAa;QAlCpC,aAAQ,GAAY,KAAK,CAAC;QAa1B,WAAM,GAAiB,SAAS,CAAC;QA2BzB,iBAAY,GAAG,GAAS,EAAE;YACzC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,IAAI,CAAC,OAA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B,GAAG,CAAC,QAAgB,EAAU,EAAE;IAC7D,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,IAAA,iBAAM,EAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACxE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC;AAEF;;GAEG;AACI,MAAM,UAAU,GAAG,CAAC,IAAY,EAAsD,EAAE,CAC9F,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AADtB,QAAA,UAAU,cACY;AAEnC,MAAM,gBAAgB,GAAG,CACxB,SAAmB,EACqC,EAAE,CAC1D,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,2BAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tAttachState,\n\ttype IContainerStorageService,\n} from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tIContainerRuntime,\n\tIContainerRuntimeEvents,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tIEmitter,\n\tIEventProvider,\n\tIFluidHandleContext,\n\tIFluidHandleInternalPayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tListenable,\n\tPayloadState,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, Deferred } from \"@fluidframework/core-utils/internal\";\nimport type { ICreateBlobResponse } from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tISequencedMessageEnvelope,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tFluidHandleBase,\n\tcreateResponseError,\n\tgenerateHandleContextPath,\n\tresponseToException,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tLoggingError,\n\ttype MonitoringContext,\n\tPerformanceEvent,\n\tUsageError,\n\tcreateChildMonitoringContext,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { isBlobMetadata } from \"../metadata.js\";\n\nimport {\n\tgetStorageIds,\n\tsummarizeBlobManagerState,\n\ttoRedirectTable,\n\ttype IBlobManagerLoadInfo,\n} from \"./blobManagerSnapSum.js\";\n\n/**\n * This class represents blob (long string)\n * This object is used only when creating (writing) new blob and serialization purposes.\n * De-serialization process goes through FluidObjectHandle and request flow:\n * DataObject.request() recognizes requests in the form of `/blobs/<id>`\n * and loads blob.\n */\nexport class BlobHandle\n\textends FluidHandleBase<ArrayBufferLike>\n\timplements\n\t\tILocalFluidHandle<ArrayBufferLike>,\n\t\tIFluidHandleInternalPayloadPending<ArrayBufferLike>\n{\n\tprivate attached: boolean = false;\n\n\tpublic get isAttached(): boolean {\n\t\treturn this.routeContext.isAttached && this.attached;\n\t}\n\n\tprivate _events:\n\t\t| (Listenable<ILocalFluidHandleEvents> & IEmitter<ILocalFluidHandleEvents>)\n\t\t| undefined;\n\tpublic get events(): Listenable<ILocalFluidHandleEvents> {\n\t\treturn (this._events ??= createEmitter<ILocalFluidHandleEvents>());\n\t}\n\n\tprivate _state: PayloadState = \"pending\";\n\tpublic get payloadState(): PayloadState {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * The error property starts undefined, signalling that there has been no error yet.\n\t * If an error occurs, the property will contain the error.\n\t */\n\tprivate _payloadShareError: unknown;\n\tpublic get payloadShareError(): unknown {\n\t\treturn this._payloadShareError;\n\t}\n\n\tpublic readonly absolutePath: string;\n\n\tpublic constructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic get: () => Promise<ArrayBufferLike>,\n\t\tpublic readonly payloadPending: boolean,\n\t\tprivate readonly onAttachGraph?: () => void,\n\t) {\n\t\tsuper();\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\tpublic readonly notifyShared = (): void => {\n\t\tthis._state = \"shared\";\n\t\tthis._events?.emit(\"payloadShared\");\n\t};\n\n\tpublic readonly notifyFailed = (error: unknown): void => {\n\t\tthis._payloadShareError = error;\n\t\tthis._events?.emit(\"payloadShareFailed\", error);\n\t};\n\n\tpublic attachGraph(): void {\n\t\tif (!this.attached) {\n\t\t\tthis.attached = true;\n\t\t\tthis.onAttachGraph?.();\n\t\t}\n\t}\n}\n\n// Restrict the IContainerRuntime interface to the subset required by BlobManager. This helps to make\n// the contract explicit and reduces the amount of mocking required for tests.\nexport type IBlobManagerRuntime = Pick<\n\tIContainerRuntime,\n\t\"attachState\" | \"baseLogger\" | \"disposed\"\n> &\n\tIEventProvider<IContainerRuntimeEvents>;\n\ntype ICreateBlobResponseWithTTL = ICreateBlobResponse &\n\tPartial<Record<\"minTTLInSeconds\", number>>;\n\ninterface PendingBlob {\n\tblob: ArrayBufferLike;\n\topsent?: boolean;\n\tstorageId?: string;\n\thandleP: Deferred<BlobHandle>;\n\tuploadP?: Promise<void>;\n\tuploadTime?: number;\n\tminTTLInSeconds?: number;\n\tattached?: boolean;\n\tacked?: boolean;\n\tabortSignal?: AbortSignal;\n}\n\nexport interface IPendingBlobs {\n\t[localId: string]: {\n\t\tblob: string;\n\t\tstorageId?: string;\n\t\tuploadTime?: number;\n\t\tminTTLInSeconds?: number;\n\t\tacked?: boolean;\n\t};\n}\n\nexport interface IBlobManagerEvents {\n\tnoPendingBlobs: () => void;\n}\n\ninterface IBlobManagerInternalEvents {\n\tuploadFailed: (localId: string, error: unknown) => void;\n\thandleAttached: (pending: PendingBlob) => void;\n\tprocessedBlobAttach: (localId: string, storageId: string) => void;\n}\n\nexport const blobManagerBasePath = \"_blobs\" as const;\n\nexport class BlobManager {\n\tprivate readonly mc: MonitoringContext;\n\n\tprivate readonly publicEvents = createEmitter<IBlobManagerEvents>();\n\tpublic get events(): Listenable<IBlobManagerEvents> {\n\t\treturn this.publicEvents;\n\t}\n\tprivate readonly internalEvents = createEmitter<IBlobManagerInternalEvents>();\n\n\t/**\n\t * Map of local IDs to storage IDs. Also includes identity mappings of storage ID to storage ID for all known\n\t * storage IDs. All requested IDs must be a key in this map. Blobs created while the container is detached are\n\t * stored in IDetachedBlobStorage which gives pseudo storage IDs; the real storage IDs are filled in at attach\n\t * time via setRedirectTable().\n\t */\n\tprivate readonly redirectTable: Map<string, string>;\n\n\t/**\n\t * Blobs which we have not yet seen a BlobAttach op round-trip and not yet attached to a DDS.\n\t */\n\tprivate readonly pendingBlobs: Map<string, PendingBlob> = new Map();\n\n\t/**\n\t * Track ops in flight for online flow. This is used for optimizations where if we receive an ack for a storage ID,\n\t * we can resolve all pending blobs with the same storage ID even though they may have different local IDs. That's\n\t * because we know that the server will not delete the blob corresponding to that storage ID.\n\t */\n\tprivate readonly opsInFlight: Map<string, Set<string>> = new Map();\n\n\tprivate readonly sendBlobAttachOp: (localId: string, storageId: string) => void;\n\n\tprivate readonly routeContext: IFluidHandleContext;\n\tprivate readonly storage: Pick<IContainerStorageService, \"createBlob\" | \"readBlob\">;\n\t// Called when a blob node is requested. blobPath is the path of the blob's node in GC's graph.\n\t// blobPath's format - `/<basePath>/<localId>`.\n\tprivate readonly blobRequested: (blobPath: string) => void;\n\t// Called to check if a blob has been deleted by GC.\n\t// blobPath's format - `/<basePath>/<localId>`.\n\tprivate readonly isBlobDeleted: (blobPath: string) => boolean;\n\tprivate readonly runtime: IBlobManagerRuntime;\n\tprivate readonly localIdGenerator: () => string;\n\n\tprivate readonly createBlobPayloadPending: boolean;\n\n\tpublic constructor(props: {\n\t\treadonly routeContext: IFluidHandleContext;\n\n\t\tblobManagerLoadInfo: IBlobManagerLoadInfo;\n\t\treadonly storage: Pick<IContainerStorageService, \"createBlob\" | \"readBlob\">;\n\t\t/**\n\t\t * Submit a BlobAttach op. When a blob is uploaded, there is a short grace period before which the blob is\n\t\t * deleted. The BlobAttach op notifies the server that blob is in use. The server will then not delete the\n\t\t * the blob as long as it is listed as referenced in future summaries. The summarizing client will know to\n\t\t * include the storage ID in the summary when it sees the op.\n\t\t *\n\t\t * The op will also include a local ID to inform all clients of the relation to the storage ID, without\n\t\t * knowledge of which they cannot request the blob from storage. It's important that this op is sequenced\n\t\t * before any ops that reference the local ID, otherwise, an invalid handle could be added to the document.\n\t\t */\n\t\tsendBlobAttachOp: (localId: string, storageId: string) => void;\n\t\t// Called when a blob node is requested. blobPath is the path of the blob's node in GC's graph.\n\t\t// blobPath's format - `/<basePath>/<localId>`.\n\t\treadonly blobRequested: (blobPath: string) => void;\n\t\t// Called to check if a blob has been deleted by GC.\n\t\t// blobPath's format - `/<basePath>/<localId>`.\n\t\treadonly isBlobDeleted: (blobPath: string) => boolean;\n\t\treadonly runtime: IBlobManagerRuntime;\n\t\tstashedBlobs: IPendingBlobs | undefined;\n\t\treadonly localIdGenerator?: (() => string) | undefined;\n\t\treadonly createBlobPayloadPending: boolean;\n\t}) {\n\t\tconst {\n\t\t\trouteContext,\n\t\t\tblobManagerLoadInfo,\n\t\t\tstorage,\n\t\t\tsendBlobAttachOp,\n\t\t\tblobRequested,\n\t\t\tisBlobDeleted,\n\t\t\truntime,\n\t\t\tlocalIdGenerator,\n\t\t\tcreateBlobPayloadPending,\n\t\t} = props;\n\t\tthis.routeContext = routeContext;\n\t\tthis.storage = storage;\n\t\tthis.blobRequested = blobRequested;\n\t\tthis.isBlobDeleted = isBlobDeleted;\n\t\tthis.runtime = runtime;\n\t\tthis.localIdGenerator = localIdGenerator ?? uuid;\n\t\tthis.createBlobPayloadPending = createBlobPayloadPending;\n\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: this.runtime.baseLogger,\n\t\t\tnamespace: \"BlobManager\",\n\t\t});\n\n\t\tthis.redirectTable = toRedirectTable(blobManagerLoadInfo, this.mc.logger);\n\n\t\tthis.sendBlobAttachOp = (localId: string, storageId: string) => {\n\t\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined,\n\t\t\t\t0x725 /* Must have pending blob entry for upcoming op */,\n\t\t\t);\n\t\t\tif (pendingEntry?.uploadTime && pendingEntry?.minTTLInSeconds) {\n\t\t\t\tconst secondsSinceUpload = (Date.now() - pendingEntry.uploadTime) / 1000;\n\t\t\t\tconst expired = pendingEntry.minTTLInSeconds - secondsSinceUpload < 0;\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"sendBlobAttach\",\n\t\t\t\t\tsecondsSinceUpload,\n\t\t\t\t\tminTTLInSeconds: pendingEntry.minTTLInSeconds,\n\t\t\t\t\texpired,\n\t\t\t\t});\n\t\t\t\tif (expired) {\n\t\t\t\t\t// reupload blob and reset previous fields\n\t\t\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\t\t\t...pendingEntry,\n\t\t\t\t\t\tstorageId: undefined,\n\t\t\t\t\t\tuploadTime: undefined,\n\t\t\t\t\t\tminTTLInSeconds: undefined,\n\t\t\t\t\t\topsent: false,\n\t\t\t\t\t\tuploadP: this.uploadBlob(localId, pendingEntry.blob),\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpendingEntry.opsent = true;\n\t\t\tsendBlobAttachOp(localId, storageId);\n\t\t};\n\t}\n\n\tpublic get allBlobsAttached(): boolean {\n\t\tfor (const entry of this.pendingBlobs.values()) {\n\t\t\tif (entry.attached === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic get hasPendingBlobs(): boolean {\n\t\treturn (\n\t\t\t(this.runtime.attachState !== AttachState.Attached && this.redirectTable.size > 0) ||\n\t\t\tthis.pendingBlobs.size > 0\n\t\t);\n\t}\n\n\tprivate createAbortError(pending?: PendingBlob): LoggingError {\n\t\treturn new LoggingError(\"uploadBlob aborted\", {\n\t\t\tacked: pending?.acked,\n\t\t\tuploadTime: pending?.uploadTime,\n\t\t});\n\t}\n\n\tpublic hasBlob(localId: string): boolean {\n\t\treturn this.redirectTable.get(localId) !== undefined;\n\t}\n\n\t/**\n\t * Lookup the blob storage ID for a given local blob id.\n\t * @param localId - The local blob id. Likely coming from a handle.\n\t * @returns The storage ID if found and the blob is not pending, undefined otherwise.\n\t * @remarks\n\t * For blobs with pending payloads (localId exists but upload hasn't finished), this is expected to return undefined.\n\t * Consumers should use the observability APIs on the handle (handle.payloadState, payloadShared event)\n\t * to understand/wait for storage ID availability.\n\t * Similarly, when the runtime is detached, this will return undefined as no blobs have been uploaded to storage.\n\t */\n\tpublic lookupTemporaryBlobStorageId(localId: string): string | undefined {\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Get the storage ID from the redirect table\n\t\treturn this.redirectTable.get(localId);\n\t}\n\n\t/**\n\t * Retrieve the blob with the given local blob id.\n\t * @param localId - The local blob id. Likely coming from a handle.\n\t * @param payloadPending - Whether we suspect the payload may be pending and not available yet.\n\t * @returns A promise which resolves to the blob contents\n\t */\n\tpublic async getBlob(localId: string, payloadPending: boolean): Promise<ArrayBufferLike> {\n\t\t// Verify that the blob is not deleted, i.e., it has not been garbage collected. If it is, this will throw\n\t\t// an error, failing the call.\n\t\tthis.verifyBlobNotDeleted(localId);\n\t\t// Let runtime know that the corresponding GC node was requested.\n\t\t// Note that this will throw if the blob is inactive or tombstoned and throwing on incorrect usage\n\t\t// is configured.\n\t\tthis.blobRequested(getGCNodePathFromLocalId(localId));\n\n\t\tconst pending = this.pendingBlobs.get(localId);\n\t\tif (pending) {\n\t\t\treturn pending.blob;\n\t\t}\n\n\t\tlet storageId = this.redirectTable.get(localId);\n\t\tif (storageId === undefined) {\n\t\t\t// Only blob handles explicitly marked with pending payload are permitted to exist without\n\t\t\t// yet knowing their storage id. Otherwise they must already be associated with a storage id.\n\t\t\t// Handles for detached blobs are not payload pending.\n\t\t\tassert(payloadPending, 0x11f /* \"requesting unknown blobs\" */);\n\t\t\t// If we didn't find it in the redirectTable and it's payloadPending, assume the attach op is coming\n\t\t\t// eventually and wait. We do this even if the local client doesn't have the blob payloadPending flag\n\t\t\t// enabled, in case a remote client does have it enabled. This wait may be infinite if the uploading\n\t\t\t// client failed the upload and doesn't exist anymore.\n\t\t\tstorageId = await new Promise<string>((resolve) => {\n\t\t\t\tconst onProcessBlobAttach = (_localId: string, _storageId: string): void => {\n\t\t\t\t\tif (_localId === localId) {\n\t\t\t\t\t\tthis.internalEvents.off(\"processedBlobAttach\", onProcessBlobAttach);\n\t\t\t\t\t\tresolve(_storageId);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis.internalEvents.on(\"processedBlobAttach\", onProcessBlobAttach);\n\t\t\t});\n\t\t}\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"AttachmentReadBlob\", id: storageId },\n\t\t\tasync (event) => {\n\t\t\t\treturn this.storage.readBlob(storageId).catch((error) => {\n\t\t\t\t\tif (this.runtime.disposed) {\n\t\t\t\t\t\t// If the runtime is disposed, this is not an error we care to track, it's expected behavior.\n\t\t\t\t\t\tevent.cancel({ category: \"generic\" });\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t},\n\t\t\t{ end: true, cancel: \"error\" },\n\t\t);\n\t}\n\n\tprivate getBlobHandle(localId: string): BlobHandle {\n\t\tassert(\n\t\t\tthis.redirectTable.has(localId) || this.pendingBlobs.has(localId),\n\t\t\t0x384 /* requesting handle for unknown blob */,\n\t\t);\n\t\tconst pending = this.pendingBlobs.get(localId);\n\t\t// Create a callback function for once the handle has been attached\n\t\tconst callback = pending\n\t\t\t? () => {\n\t\t\t\t\tpending.attached = true;\n\t\t\t\t\t// Notify listeners (e.g. serialization process) that handle has been attached\n\t\t\t\t\tthis.internalEvents.emit(\"handleAttached\", pending);\n\t\t\t\t\tthis.deletePendingBlobMaybe(localId);\n\t\t\t\t}\n\t\t\t: undefined;\n\t\treturn new BlobHandle(\n\t\t\tgetGCNodePathFromLocalId(localId),\n\t\t\tthis.routeContext,\n\t\t\tasync () => this.getBlob(localId, false),\n\t\t\tfalse, // payloadPending\n\t\t\tcallback,\n\t\t);\n\t}\n\n\tprivate async createBlobDetached(\n\t\tblob: ArrayBufferLike,\n\t): Promise<IFluidHandleInternalPayloadPending<ArrayBufferLike>> {\n\t\tconst localId = this.localIdGenerator();\n\t\t// Blobs created while the container is detached are stored in IDetachedBlobStorage.\n\t\t// The 'IContainerStorageService.createBlob()' call below will respond with a pseudo storage ID.\n\t\t// That pseudo storage ID will be replaced with the real storage ID at attach time.\n\t\tconst { id: detachedStorageId } = await this.storage.createBlob(blob);\n\t\tthis.setRedirection(localId, detachedStorageId);\n\t\treturn this.getBlobHandle(localId);\n\t}\n\n\tpublic async createBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternalPayloadPending<ArrayBufferLike>> {\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\treturn this.createBlobDetached(blob);\n\t\t}\n\t\tif (this.runtime.attachState === AttachState.Attaching) {\n\t\t\t// blob upload is not supported in \"Attaching\" state\n\t\t\tthis.mc.logger.sendTelemetryEvent({ eventName: \"CreateBlobWhileAttaching\" });\n\t\t\tawait new Promise<void>((resolve) => this.runtime.once(\"attached\", resolve));\n\t\t}\n\t\tassert(\n\t\t\tthis.runtime.attachState === AttachState.Attached,\n\t\t\t0x385 /* For clarity and paranoid defense against adding future attachment states */,\n\t\t);\n\n\t\treturn this.createBlobPayloadPending\n\t\t\t? this.createBlobWithPayloadPending(blob)\n\t\t\t: this.createBlobLegacy(blob, signal);\n\t}\n\n\tprivate async createBlobLegacy(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternalPayloadPending<ArrayBufferLike>> {\n\t\tif (signal?.aborted) {\n\t\t\tthrow this.createAbortError();\n\t\t}\n\n\t\t// Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to\n\t\t// storage ID mapping is created.\n\t\tconst localId = this.localIdGenerator();\n\t\tconst pendingEntry: PendingBlob = {\n\t\t\tblob,\n\t\t\thandleP: new Deferred(),\n\t\t\tuploadP: this.uploadBlob(localId, blob),\n\t\t\tattached: false,\n\t\t\tacked: false,\n\t\t\tabortSignal: signal,\n\t\t\topsent: false,\n\t\t};\n\t\tthis.pendingBlobs.set(localId, pendingEntry);\n\n\t\tconst abortListener = (): void => {\n\t\t\tif (!pendingEntry.acked) {\n\t\t\t\tpendingEntry.handleP.reject(this.createAbortError(pendingEntry));\n\t\t\t}\n\t\t};\n\t\tsignal?.addEventListener(\"abort\", abortListener, { once: true });\n\n\t\treturn pendingEntry.handleP.promise.finally(() => {\n\t\t\tsignal?.removeEventListener(\"abort\", abortListener);\n\t\t});\n\t}\n\n\tprivate createBlobWithPayloadPending(\n\t\tblob: ArrayBufferLike,\n\t): IFluidHandleInternalPayloadPending<ArrayBufferLike> {\n\t\tconst localId = this.localIdGenerator();\n\n\t\tconst blobHandle = new BlobHandle(\n\t\t\tgetGCNodePathFromLocalId(localId),\n\t\t\tthis.routeContext,\n\t\t\tasync () => blob,\n\t\t\ttrue, // payloadPending\n\t\t\t() => {\n\t\t\t\tconst pendingEntry: PendingBlob = {\n\t\t\t\t\tblob,\n\t\t\t\t\thandleP: new Deferred(),\n\t\t\t\t\tuploadP: this.uploadBlob(localId, blob),\n\t\t\t\t\tattached: true,\n\t\t\t\t\tacked: false,\n\t\t\t\t\topsent: false,\n\t\t\t\t};\n\t\t\t\tthis.pendingBlobs.set(localId, pendingEntry);\n\t\t\t},\n\t\t);\n\n\t\tconst onProcessedBlobAttach = (_localId: string, _storageId: string): void => {\n\t\t\tif (_localId === localId) {\n\t\t\t\tthis.internalEvents.off(\"processedBlobAttach\", onProcessedBlobAttach);\n\t\t\t\tblobHandle.notifyShared();\n\t\t\t}\n\t\t};\n\t\tthis.internalEvents.on(\"processedBlobAttach\", onProcessedBlobAttach);\n\n\t\tconst onUploadFailed = (_localId: string, error: unknown): void => {\n\t\t\tif (_localId === localId) {\n\t\t\t\tthis.internalEvents.off(\"uploadFailed\", onUploadFailed);\n\t\t\t\tblobHandle.notifyFailed(error);\n\t\t\t}\n\t\t};\n\t\tthis.internalEvents.on(\"uploadFailed\", onUploadFailed);\n\n\t\treturn blobHandle;\n\t}\n\n\t/**\n\t * Upload a blob to the storage service.\n\t * @returns A promise that resolves when the upload is complete and a blob attach op has been sent (but not ack'd).\n\t *\n\t * @privateRemarks This method must not reject, as there is no error handling for it in current tracking.\n\t */\n\tprivate async uploadBlob(localId: string, blob: ArrayBufferLike): Promise<void> {\n\t\tlet response: ICreateBlobResponseWithTTL;\n\t\ttry {\n\t\t\tresponse = await this.storage.createBlob(blob);\n\t\t} catch (error) {\n\t\t\tconst entry = this.pendingBlobs.get(localId);\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"UploadBlobReject\",\n\t\t\t\t// TODO: better typing\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n\t\t\t\terror: error as any,\n\t\t\t\tmessage: entry === undefined ? \"Missing pendingBlob\" : undefined,\n\t\t\t\tlocalId,\n\t\t\t});\n\t\t\t// We probably should assert the pendingBlobs entry here, but we don't currently have any error handling\n\t\t\t// for the uploadP - a promise rejection would be unhandled anyway. For now we can detect this with the\n\t\t\t// message on the UploadBlobReject telemetry.\n\t\t\tif (entry !== undefined) {\n\t\t\t\tentry.handleP.reject(error);\n\t\t\t\tthis.deletePendingBlob(localId);\n\t\t\t}\n\t\t\tthis.internalEvents.emit(\"uploadFailed\", localId, error);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis.onUploadResolve(localId, response);\n\t\t} catch (error) {\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"OnUploadResolveError\",\n\t\t\t\t// TODO: better typing\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n\t\t\t\terror: error as any,\n\t\t\t\tlocalId,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added\n\t * which is required for GC.\n\t */\n\tprivate setRedirection(fromId: string, toId: string): void {\n\t\tthis.redirectTable.set(fromId, toId);\n\t}\n\n\tprivate deletePendingBlobMaybe(localId: string): void {\n\t\tif (this.pendingBlobs.has(localId)) {\n\t\t\tconst entry = this.pendingBlobs.get(localId);\n\t\t\tif (entry?.attached && entry?.acked) {\n\t\t\t\tthis.deletePendingBlob(localId);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate deletePendingBlob(id: string): void {\n\t\tif (this.pendingBlobs.delete(id) && !this.hasPendingBlobs) {\n\t\t\tthis.publicEvents.emit(\"noPendingBlobs\");\n\t\t}\n\t}\n\n\tprivate onUploadResolve(\n\t\tlocalId: string,\n\t\tresponse: ICreateBlobResponseWithTTL,\n\t): ICreateBlobResponseWithTTL | undefined {\n\t\tconst entry = this.pendingBlobs.get(localId);\n\n\t\tassert(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);\n\t\tif (entry.abortSignal?.aborted === true && !entry.opsent) {\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"BlobAborted\",\n\t\t\t\tlocalId,\n\t\t\t});\n\t\t\tthis.deletePendingBlob(localId);\n\t\t\treturn;\n\t\t}\n\t\tassert(\n\t\t\tentry.storageId === undefined,\n\t\t\t0x386 /* Must have pending blob entry for uploaded blob */,\n\t\t);\n\t\tentry.storageId = response.id;\n\t\tentry.uploadTime = Date.now();\n\t\tentry.minTTLInSeconds = response.minTTLInSeconds;\n\t\t// Send a blob attach op. This serves two purposes:\n\t\t// 1. If its a new blob, i.e., it isn't de-duped, the server will keep the blob alive if it sees this op\n\t\t// until its storage ID is added to the next summary.\n\t\t// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the\n\t\t// blob from the server via the storage ID.\n\t\tif (!entry.opsent) {\n\t\t\tthis.sendBlobAttachOp(localId, response.id);\n\t\t}\n\t\tconst storageIds = getStorageIds(this.redirectTable);\n\t\tif (storageIds.has(response.id)) {\n\t\t\t// The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is\n\t\t\t// an existing blob, we don't have to wait for the op to be ack'd since this step has already\n\t\t\t// happened before and so, the server won't delete it.\n\t\t\tthis.setRedirection(localId, response.id);\n\t\t\tconst blobHandle = this.getBlobHandle(localId);\n\t\t\tblobHandle.notifyShared();\n\t\t\tentry.handleP.resolve(blobHandle);\n\t\t\tthis.deletePendingBlobMaybe(localId);\n\t\t} else {\n\t\t\t// If there is already an op for this storage ID, append the local ID to the list. Once any op for\n\t\t\t// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the\n\t\t\t// blob alive in storage.\n\t\t\tlet setForRemoteId = this.opsInFlight.get(response.id);\n\t\t\tif (setForRemoteId === undefined) {\n\t\t\t\tsetForRemoteId = new Set();\n\t\t\t\tthis.opsInFlight.set(response.id, setForRemoteId);\n\t\t\t}\n\t\t\t// seeing the same localId twice can happen if a blob is being reuploaded and stashed.\n\t\t\t// TODO: review stashing logic and see if we can avoid this, as well in tests.\n\t\t\tsetForRemoteId.add(localId);\n\t\t}\n\t\treturn response;\n\t}\n\n\t/**\n\t * Resubmit a BlobAttach op. Used to add storage IDs to ops that were\n\t * submitted to runtime while disconnected.\n\t * @param metadata - op metadata containing storage and/or local IDs\n\t */\n\tpublic reSubmit(metadata: Record<string, unknown> | undefined): void {\n\t\tassert(isBlobMetadata(metadata), 0xc01 /* Expected blob metadata for a BlobAttach op */);\n\t\tconst { localId, blobId: storageId } = metadata;\n\t\t// Any blob that we're actively trying to advance to attached state must have a\n\t\t// pendingBlobs entry. Decline to resubmit for anything else.\n\t\t// For example, we might be asked to resubmit stashed ops for blobs that never had\n\t\t// their handle attached - these won't have a pendingBlobs entry and we shouldn't\n\t\t// try to attach them since they won't be accessible to the customer and would just\n\t\t// be considered garbage immediately.\n\t\tif (this.pendingBlobs.has(localId)) {\n\t\t\tthis.sendBlobAttachOp(localId, storageId);\n\t\t}\n\t}\n\n\tpublic processBlobAttachMessage(message: ISequencedMessageEnvelope, local: boolean): void {\n\t\tassert(\n\t\t\tisBlobMetadata(message.metadata),\n\t\t\t0xc02 /* Expected blob metadata for a BlobAttach op */,\n\t\t);\n\t\tconst { localId, blobId: storageId } = message.metadata;\n\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\t\tif (pendingEntry?.abortSignal?.aborted) {\n\t\t\tthis.deletePendingBlob(localId);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setRedirection(localId, storageId);\n\t\t// set identity (id -> id) entry\n\t\tthis.setRedirection(storageId, storageId);\n\n\t\tif (local) {\n\t\t\tconst waitingBlobs = this.opsInFlight.get(storageId);\n\t\t\tif (waitingBlobs !== undefined) {\n\t\t\t\t// For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.\n\t\t\t\t// This is safe because the server will keep the blob alive and the op containing the local ID to\n\t\t\t\t// storage ID is already in flight and any op containing this local ID will be sequenced after that.\n\t\t\t\tfor (const pendingLocalId of waitingBlobs) {\n\t\t\t\t\tconst entry = this.pendingBlobs.get(pendingLocalId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tentry !== undefined,\n\t\t\t\t\t\t0x38f /* local online BlobAttach op with no pending blob entry */,\n\t\t\t\t\t);\n\t\t\t\t\tthis.setRedirection(pendingLocalId, storageId);\n\t\t\t\t\tentry.acked = true;\n\t\t\t\t\tconst blobHandle = this.getBlobHandle(pendingLocalId);\n\t\t\t\t\tblobHandle.notifyShared();\n\t\t\t\t\tentry.handleP.resolve(blobHandle);\n\t\t\t\t\tthis.deletePendingBlobMaybe(pendingLocalId);\n\t\t\t\t}\n\t\t\t\tthis.opsInFlight.delete(storageId);\n\t\t\t}\n\t\t\tconst localEntry = this.pendingBlobs.get(localId);\n\t\t\tif (localEntry) {\n\t\t\t\tlocalEntry.acked = true;\n\t\t\t\tconst blobHandle = this.getBlobHandle(localId);\n\t\t\t\tblobHandle.notifyShared();\n\t\t\t\tlocalEntry.handleP.resolve(blobHandle);\n\t\t\t\tthis.deletePendingBlobMaybe(localId);\n\t\t\t}\n\t\t}\n\t\tthis.internalEvents.emit(\"processedBlobAttach\", localId, storageId);\n\t}\n\n\tpublic summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\treturn summarizeBlobManagerState(this.redirectTable);\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be\n\t * individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care\n\t * about this for now because the data is a simple list of blob ids.\n\t */\n\tpublic getGCData(fullGC: boolean = false): IGarbageCollectionData {\n\t\tconst gcData: IGarbageCollectionData = { gcNodes: {} };\n\t\tfor (const [localId, storageId] of this.redirectTable) {\n\t\t\t// Don't report the identity mappings to GC - these exist to service old handles that referenced the storage\n\t\t\t// IDs directly. We'll implicitly clean them up if all of their localId references get GC'd first.\n\t\t\tif (localId !== storageId) {\n\t\t\t\t// The outbound routes are empty because a blob node cannot reference other nodes. It can only be referenced\n\t\t\t\t// by adding its handle to a referenced DDS.\n\t\t\t\tgcData.gcNodes[getGCNodePathFromLocalId(localId)] = [];\n\t\t\t}\n\t\t}\n\t\treturn gcData;\n\t}\n\n\t/**\n\t * Delete attachment blobs that are sweep ready.\n\t * @param sweepReadyBlobRoutes - The routes of blobs that are sweep ready and should be deleted. These routes will\n\t * be based off of local ids.\n\t * @returns The routes of blobs that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(sweepReadyBlobRoutes: readonly string[]): readonly string[] {\n\t\tthis.deleteBlobsFromRedirectTable(sweepReadyBlobRoutes);\n\t\treturn [...sweepReadyBlobRoutes];\n\t}\n\n\t/**\n\t * Delete blobs with the given routes from the redirect table.\n\t *\n\t * @remarks\n\t * The routes are GC nodes paths of format -`/<blobManagerBasePath>/<localId>`.\n\t * Deleting the blobs involves 2 steps:\n\t *\n\t * 1. The redirect table entry for the local ids are deleted.\n\t *\n\t * 2. If the storage ids corresponding to the deleted local ids are not referenced by any further local ids, the\n\t * identity mappings in the redirect table are deleted as well.\n\t *\n\t * Note that this does not delete the blobs from storage service immediately. Deleting the blobs from redirect table\n\t * will ensure we don't create an attachment blob for them at the next summary. The service would then delete them\n\t * some time in the future.\n\t */\n\tprivate deleteBlobsFromRedirectTable(blobRoutes: readonly string[]): void {\n\t\t// maybeUnusedStorageIds is used to compute the set of storage IDs that *used to have a local ID*, but that\n\t\t// local ID is being deleted.\n\t\tconst maybeUnusedStorageIds: Set<string> = new Set();\n\t\tfor (const route of blobRoutes) {\n\t\t\tconst localId = getLocalIdFromGCNodePath(route);\n\t\t\t// If the blob hasn't already been deleted, log an error because this should never happen.\n\t\t\t// If the blob has already been deleted, log a telemetry event. This can happen because multiple GC\n\t\t\t// sweep ops can contain the same data store. It would be interesting to track how often this happens.\n\t\t\tconst alreadyDeleted = this.isBlobDeleted(route);\n\t\t\tconst storageId = this.redirectTable.get(localId);\n\t\t\tif (storageId === undefined) {\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"DeletedAttachmentBlobNotFound\",\n\t\t\t\t\tcategory: alreadyDeleted ? \"generic\" : \"error\",\n\t\t\t\t\tblobId: localId,\n\t\t\t\t\tdetails: { alreadyDeleted },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmaybeUnusedStorageIds.add(storageId);\n\t\t\tthis.redirectTable.delete(localId);\n\t\t}\n\n\t\t// Remove any storage IDs that still have local IDs referring to them (excluding the identity mapping).\n\t\tfor (const [localId, storageId] of this.redirectTable) {\n\t\t\tif (localId !== storageId) {\n\t\t\t\tmaybeUnusedStorageIds.delete(storageId);\n\t\t\t}\n\t\t}\n\n\t\t// Now delete any identity mappings (storage ID -> storage ID) from the redirect table that used to be\n\t\t// referenced by a distinct local ID. This way they'll be absent from the next summary, and the service\n\t\t// is free to delete them from storage.\n\t\t// WARNING: This can potentially delete identity mappings that are still referenced, if storage deduping\n\t\t// has let us add a local ID -> storage ID mapping that is later deleted. AB#47337 tracks this issue\n\t\t// and possible solutions.\n\t\tfor (const storageId of maybeUnusedStorageIds) {\n\t\t\tthis.redirectTable.delete(storageId);\n\t\t}\n\t}\n\n\t/**\n\t * Verifies that the blob with given id is not deleted, i.e., it has not been garbage collected. If the blob is GC'd,\n\t * log an error and throw if necessary.\n\t */\n\tprivate verifyBlobNotDeleted(localId: string): void {\n\t\tif (!this.isBlobDeleted(getGCNodePathFromLocalId(localId))) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst request = { url: localId };\n\t\tconst error = responseToException(\n\t\t\tcreateResponseError(404, `Blob was deleted`, request),\n\t\t\trequest,\n\t\t);\n\t\t// Only log deleted events. Tombstone events are logged by garbage collector.\n\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t{\n\t\t\t\teventName: \"GC_Deleted_Blob_Requested\",\n\t\t\t\tpkg: blobManagerBasePath,\n\t\t\t},\n\t\t\terror,\n\t\t);\n\t\tthrow error;\n\t}\n\n\t/**\n\t * Called in detached state just prior to attaching, this will update the redirect table by\n\t * converting the pseudo storage IDs into real storage IDs using the provided detachedStorageTable.\n\t * The provided table must have exactly the same set of pseudo storage IDs as are found in the redirect table.\n\t * @param detachedStorageTable - A map of pseudo storage IDs to real storage IDs.\n\t */\n\tpublic readonly patchRedirectTable = (detachedStorageTable: Map<string, string>): void => {\n\t\tassert(\n\t\t\tthis.runtime.attachState === AttachState.Detached,\n\t\t\t0x252 /* \"redirect table can only be set in detached container\" */,\n\t\t);\n\t\t// The values of the redirect table are the pseudo storage IDs, which are the keys of the\n\t\t// detachedStorageTable. We expect to have a many:1 mapping from local IDs to pseudo\n\t\t// storage IDs (many in the case that the storage dedupes the blob).\n\t\tassert(\n\t\t\tnew Set(this.redirectTable.values()).size === detachedStorageTable.size,\n\t\t\t0x391 /* Redirect table size must match BlobManager's local ID count */,\n\t\t);\n\t\t// Taking a snapshot of the redirect table entries before iterating, because\n\t\t// we will be adding identity mappings to the the redirect table as we iterate\n\t\t// and we don't want to include those in the iteration.\n\t\tconst redirectTableEntries = [...this.redirectTable.entries()];\n\t\tfor (const [localId, detachedStorageId] of redirectTableEntries) {\n\t\t\tconst newStorageId = detachedStorageTable.get(detachedStorageId);\n\t\t\tassert(newStorageId !== undefined, 0xc53 /* Couldn't find a matching storage ID */);\n\t\t\tthis.setRedirection(localId, newStorageId);\n\t\t\t// set identity (id -> id) entry\n\t\t\tthis.setRedirection(newStorageId, newStorageId);\n\t\t}\n\t};\n\n\t/**\n\t * To be used in getPendingLocalState flow. Get a serializable record of the blobs that are\n\t * pending upload and/or their BlobAttach op, which can be given to a new BlobManager to\n\t * resume work.\n\t *\n\t * @privateRemarks\n\t * For now, we don't track any pending blobs since the getPendingBlobs flow doesn't enable\n\t * restoring to a state where an accessible handle has been stored by the customer (and we'll\n\t * just drop any BlobAttach ops on the ground during reSubmit). However, once we add support\n\t * for payload-pending handles, this will return the blobs associated with those handles.\n\t */\n\tpublic getPendingBlobs(): IPendingBlobs | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Part of container serialization when imminent closure is enabled (Currently when calling closeAndGetPendingLocalState).\n\t * This asynchronous function resolves all pending createBlob calls and waits for each blob\n\t * to be attached. It will also send BlobAttach ops for each pending blob that hasn't sent it\n\t * yet so that serialized container can resubmit them when rehydrated.\n\t *\n\t * @param stopBlobAttachingSignal - Optional signal to abort the blob attaching process.\n\t * @returns - A promise that resolves with the details of the attached blobs,\n\t * or undefined if no blobs were processed.\n\t */\n\tpublic async attachAndGetPendingBlobs(\n\t\tstopBlobAttachingSignal?: AbortSignal,\n\t): Promise<IPendingBlobs | undefined> {\n\t\tthrow new UsageError(\"attachAndGetPendingBlobs is no longer supported\");\n\t}\n}\n\n/**\n * For a localId, returns its path in GC's graph. The node path is of the format `/<blobManagerBasePath>/<localId>`.\n * This path must match the path of the blob handle returned by the createBlob API because blobs are marked\n * referenced by storing these handles in a referenced DDS.\n */\nconst getGCNodePathFromLocalId = (localId: string): string =>\n\t`/${blobManagerBasePath}/${localId}`;\n\n/**\n * For a given GC node path, return the localId. The node path is of the format `/<basePath>/<localId>`.\n */\nconst getLocalIdFromGCNodePath = (nodePath: string): string => {\n\tconst pathParts = nodePath.split(\"/\");\n\tassert(areBlobPathParts(pathParts), 0x5bd /* Invalid blob node path */);\n\treturn pathParts[2];\n};\n\n/**\n * Returns whether a given path is for attachment blobs that are in the format - \"/blobManagerBasePath/...\".\n */\nexport const isBlobPath = (path: string): path is `/${typeof blobManagerBasePath}/${string}` =>\n\tareBlobPathParts(path.split(\"/\"));\n\nconst areBlobPathParts = (\n\tpathParts: string[],\n): pathParts is [\"\", typeof blobManagerBasePath, string] =>\n\tpathParts.length === 3 && pathParts[1] === blobManagerBasePath;\n"]}
|
|
1
|
+
{"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../../src/blobManager/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA6D;AAC7D,6EAGwD;AAexD,kEAAuE;AAQvE,qEAKgD;AAChD,uEAMkD;AAClD,+BAAkC;AAElC,gDAAgD;AAEhD,mEAKiC;AAEjC;;;;;;GAMG;AACH,MAAa,UACZ,SAAQ,0BAAgC;IAOxC,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC;IACtD,CAAC;IAKD,IAAW,MAAM;QAChB,OAAO,CAAC,IAAI,CAAC,OAAO,KAAK,IAAA,4BAAa,GAA2B,CAAC,CAAC;IACpE,CAAC;IAGD,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAOD,IAAW,iBAAiB;QAC3B,OAAO,IAAI,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,OAAO,CAAC,EACrD,OAAO,CACP,CAAC;QACF,6EAA6E;QAC7E,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,CAC5B;YACC,SAAS,EAAE,2BAA2B;YACtC,GAAG,EAAE,2BAAmB;SACxB,EACD,KAAK,CACL,CAAC;QACF,MAAM,KAAK,CAAC;IACb,CAAC;IAiCD;;;;;;;;;;OAUG;IACI,eAAe;QACrB,OAAO,SAAS,CAAC;IAClB,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,wBAAwB,CACpC,uBAAqC;QAErC,MAAM,IAAI,qBAAU,CAAC,iDAAiD,CAAC,CAAC;IACzE,CAAC;CACD;AAtuBD,kCAsuBC;AAED;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,CAAC,OAAe,EAAU,EAAE,CAC5D,IAAI,2BAAmB,IAAI,OAAO,EAAE,CAAC;AAEtC;;GAEG;AACH,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAU,EAAE;IAC7D,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,IAAA,iBAAM,EAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACxE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC;AAEF;;GAEG;AACI,MAAM,UAAU,GAAG,CAAC,IAAY,EAAsD,EAAE,CAC9F,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AADtB,QAAA,UAAU,cACY;AAEnC,MAAM,gBAAgB,GAAG,CACxB,SAAmB,EACqC,EAAE,CAC1D,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,2BAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tAttachState,\n\ttype IContainerStorageService,\n} from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tIContainerRuntime,\n\tIContainerRuntimeEvents,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tIEmitter,\n\tIEventProvider,\n\tIFluidHandleContext,\n\tIFluidHandleInternalPayloadPending,\n\tILocalFluidHandle,\n\tILocalFluidHandleEvents,\n\tListenable,\n\tPayloadState,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, Deferred } from \"@fluidframework/core-utils/internal\";\nimport type { ICreateBlobResponse } from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tISequencedMessageEnvelope,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tFluidHandleBase,\n\tcreateResponseError,\n\tgenerateHandleContextPath,\n\tresponseToException,\n} from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tLoggingError,\n\ttype MonitoringContext,\n\tPerformanceEvent,\n\tUsageError,\n\tcreateChildMonitoringContext,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { isBlobMetadata } from \"../metadata.js\";\n\nimport {\n\tgetStorageIds,\n\tsummarizeBlobManagerState,\n\ttoRedirectTable,\n\ttype IBlobManagerLoadInfo,\n} from \"./blobManagerSnapSum.js\";\n\n/**\n * This class represents blob (long string)\n * This object is used only when creating (writing) new blob and serialization purposes.\n * De-serialization process goes through FluidObjectHandle and request flow:\n * DataObject.request() recognizes requests in the form of `/blobs/<id>`\n * and loads blob.\n */\nexport class BlobHandle\n\textends FluidHandleBase<ArrayBufferLike>\n\timplements\n\t\tILocalFluidHandle<ArrayBufferLike>,\n\t\tIFluidHandleInternalPayloadPending<ArrayBufferLike>\n{\n\tprivate attached: boolean = false;\n\n\tpublic get isAttached(): boolean {\n\t\treturn this.routeContext.isAttached && this.attached;\n\t}\n\n\tprivate _events:\n\t\t| (Listenable<ILocalFluidHandleEvents> & IEmitter<ILocalFluidHandleEvents>)\n\t\t| undefined;\n\tpublic get events(): Listenable<ILocalFluidHandleEvents> {\n\t\treturn (this._events ??= createEmitter<ILocalFluidHandleEvents>());\n\t}\n\n\tprivate _state: PayloadState = \"pending\";\n\tpublic get payloadState(): PayloadState {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * The error property starts undefined, signalling that there has been no error yet.\n\t * If an error occurs, the property will contain the error.\n\t */\n\tprivate _payloadShareError: unknown;\n\tpublic get payloadShareError(): unknown {\n\t\treturn this._payloadShareError;\n\t}\n\n\tpublic readonly absolutePath: string;\n\n\tpublic constructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic get: () => Promise<ArrayBufferLike>,\n\t\tpublic readonly payloadPending: boolean,\n\t\tprivate readonly onAttachGraph?: () => void,\n\t) {\n\t\tsuper();\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\tpublic readonly notifyShared = (): void => {\n\t\tthis._state = \"shared\";\n\t\tthis._events?.emit(\"payloadShared\");\n\t};\n\n\tpublic readonly notifyFailed = (error: unknown): void => {\n\t\tthis._payloadShareError = error;\n\t\tthis._events?.emit(\"payloadShareFailed\", error);\n\t};\n\n\tpublic attachGraph(): void {\n\t\tif (!this.attached) {\n\t\t\tthis.attached = true;\n\t\t\tthis.onAttachGraph?.();\n\t\t}\n\t}\n}\n\n// Restrict the IContainerRuntime interface to the subset required by BlobManager. This helps to make\n// the contract explicit and reduces the amount of mocking required for tests.\nexport type IBlobManagerRuntime = Pick<\n\tIContainerRuntime,\n\t\"attachState\" | \"baseLogger\" | \"disposed\"\n> &\n\tIEventProvider<IContainerRuntimeEvents>;\n\ntype ICreateBlobResponseWithTTL = ICreateBlobResponse &\n\tPartial<Record<\"minTTLInSeconds\", number>>;\n\ninterface PendingBlob {\n\tblob: ArrayBufferLike;\n\topsent?: boolean;\n\tstorageId?: string;\n\thandleP: Deferred<BlobHandle>;\n\tuploadP?: Promise<void>;\n\tuploadTime?: number;\n\tminTTLInSeconds?: number;\n\tattached?: boolean;\n\tacked?: boolean;\n\tabortSignal?: AbortSignal;\n}\n\nexport interface IPendingBlobs {\n\t[localId: string]: {\n\t\tblob: string;\n\t\tstorageId?: string;\n\t\tuploadTime?: number;\n\t\tminTTLInSeconds?: number;\n\t\tacked?: boolean;\n\t};\n}\n\nexport interface IBlobManagerEvents {\n\tnoPendingBlobs: () => void;\n}\n\ninterface IBlobManagerInternalEvents {\n\tuploadFailed: (localId: string, error: unknown) => void;\n\thandleAttached: (pending: PendingBlob) => void;\n\tprocessedBlobAttach: (localId: string, storageId: string) => void;\n}\n\nexport const blobManagerBasePath = \"_blobs\" as const;\n\nexport class BlobManager {\n\tprivate readonly mc: MonitoringContext;\n\n\tprivate readonly publicEvents = createEmitter<IBlobManagerEvents>();\n\tpublic get events(): Listenable<IBlobManagerEvents> {\n\t\treturn this.publicEvents;\n\t}\n\tprivate readonly internalEvents = createEmitter<IBlobManagerInternalEvents>();\n\n\t/**\n\t * Map of local IDs to storage IDs. Also includes identity mappings of storage ID to storage ID for all known\n\t * storage IDs. All requested IDs must be a key in this map. Blobs created while the container is detached are\n\t * stored in IDetachedBlobStorage which gives pseudo storage IDs; the real storage IDs are filled in at attach\n\t * time via setRedirectTable().\n\t */\n\tprivate readonly redirectTable: Map<string, string>;\n\n\t/**\n\t * Blobs which we have not yet seen a BlobAttach op round-trip and not yet attached to a DDS.\n\t */\n\tprivate readonly pendingBlobs: Map<string, PendingBlob> = new Map();\n\n\t/**\n\t * Track ops in flight for online flow. This is used for optimizations where if we receive an ack for a storage ID,\n\t * we can resolve all pending blobs with the same storage ID even though they may have different local IDs. That's\n\t * because we know that the server will not delete the blob corresponding to that storage ID.\n\t */\n\tprivate readonly opsInFlight: Map<string, Set<string>> = new Map();\n\n\tprivate readonly sendBlobAttachOp: (localId: string, storageId: string) => void;\n\n\tprivate readonly routeContext: IFluidHandleContext;\n\tprivate readonly storage: Pick<IContainerStorageService, \"createBlob\" | \"readBlob\">;\n\t// Called when a blob node is requested. blobPath is the path of the blob's node in GC's graph.\n\t// blobPath's format - `/<basePath>/<localId>`.\n\tprivate readonly blobRequested: (blobPath: string) => void;\n\t// Called to check if a blob has been deleted by GC.\n\t// blobPath's format - `/<basePath>/<localId>`.\n\tprivate readonly isBlobDeleted: (blobPath: string) => boolean;\n\tprivate readonly runtime: IBlobManagerRuntime;\n\tprivate readonly localIdGenerator: () => string;\n\n\tprivate readonly createBlobPayloadPending: boolean;\n\n\tpublic constructor(props: {\n\t\treadonly routeContext: IFluidHandleContext;\n\n\t\tblobManagerLoadInfo: IBlobManagerLoadInfo;\n\t\treadonly storage: Pick<IContainerStorageService, \"createBlob\" | \"readBlob\">;\n\t\t/**\n\t\t * Submit a BlobAttach op. When a blob is uploaded, there is a short grace period before which the blob is\n\t\t * deleted. The BlobAttach op notifies the server that blob is in use. The server will then not delete the\n\t\t * the blob as long as it is listed as referenced in future summaries. The summarizing client will know to\n\t\t * include the storage ID in the summary when it sees the op.\n\t\t *\n\t\t * The op will also include a local ID to inform all clients of the relation to the storage ID, without\n\t\t * knowledge of which they cannot request the blob from storage. It's important that this op is sequenced\n\t\t * before any ops that reference the local ID, otherwise, an invalid handle could be added to the document.\n\t\t */\n\t\tsendBlobAttachOp: (localId: string, storageId: string) => void;\n\t\t// Called when a blob node is requested. blobPath is the path of the blob's node in GC's graph.\n\t\t// blobPath's format - `/<basePath>/<localId>`.\n\t\treadonly blobRequested: (blobPath: string) => void;\n\t\t// Called to check if a blob has been deleted by GC.\n\t\t// blobPath's format - `/<basePath>/<localId>`.\n\t\treadonly isBlobDeleted: (blobPath: string) => boolean;\n\t\treadonly runtime: IBlobManagerRuntime;\n\t\tstashedBlobs: IPendingBlobs | undefined;\n\t\treadonly localIdGenerator?: (() => string) | undefined;\n\t\treadonly createBlobPayloadPending: boolean;\n\t}) {\n\t\tconst {\n\t\t\trouteContext,\n\t\t\tblobManagerLoadInfo,\n\t\t\tstorage,\n\t\t\tsendBlobAttachOp,\n\t\t\tblobRequested,\n\t\t\tisBlobDeleted,\n\t\t\truntime,\n\t\t\tlocalIdGenerator,\n\t\t\tcreateBlobPayloadPending,\n\t\t} = props;\n\t\tthis.routeContext = routeContext;\n\t\tthis.storage = storage;\n\t\tthis.blobRequested = blobRequested;\n\t\tthis.isBlobDeleted = isBlobDeleted;\n\t\tthis.runtime = runtime;\n\t\tthis.localIdGenerator = localIdGenerator ?? uuid;\n\t\tthis.createBlobPayloadPending = createBlobPayloadPending;\n\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: this.runtime.baseLogger,\n\t\t\tnamespace: \"BlobManager\",\n\t\t});\n\n\t\tthis.redirectTable = toRedirectTable(blobManagerLoadInfo, this.mc.logger);\n\n\t\tthis.sendBlobAttachOp = (localId: string, storageId: string) => {\n\t\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined,\n\t\t\t\t0x725 /* Must have pending blob entry for upcoming op */,\n\t\t\t);\n\t\t\tif (\n\t\t\t\tpendingEntry?.uploadTime !== undefined &&\n\t\t\t\tpendingEntry?.minTTLInSeconds !== undefined\n\t\t\t) {\n\t\t\t\tconst secondsSinceUpload = (Date.now() - pendingEntry.uploadTime) / 1000;\n\t\t\t\tconst expired = pendingEntry.minTTLInSeconds - secondsSinceUpload < 0;\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"sendBlobAttach\",\n\t\t\t\t\tsecondsSinceUpload,\n\t\t\t\t\tminTTLInSeconds: pendingEntry.minTTLInSeconds,\n\t\t\t\t\texpired,\n\t\t\t\t});\n\t\t\t\tif (expired) {\n\t\t\t\t\t// reupload blob and reset previous fields\n\t\t\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\t\t\t...pendingEntry,\n\t\t\t\t\t\tstorageId: undefined,\n\t\t\t\t\t\tuploadTime: undefined,\n\t\t\t\t\t\tminTTLInSeconds: undefined,\n\t\t\t\t\t\topsent: false,\n\t\t\t\t\t\tuploadP: this.uploadBlob(localId, pendingEntry.blob),\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpendingEntry.opsent = true;\n\t\t\tsendBlobAttachOp(localId, storageId);\n\t\t};\n\t}\n\n\tpublic get allBlobsAttached(): boolean {\n\t\tfor (const entry of this.pendingBlobs.values()) {\n\t\t\tif (entry.attached === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic get hasPendingBlobs(): boolean {\n\t\treturn (\n\t\t\t(this.runtime.attachState !== AttachState.Attached && this.redirectTable.size > 0) ||\n\t\t\tthis.pendingBlobs.size > 0\n\t\t);\n\t}\n\n\tprivate createAbortError(pending?: PendingBlob): LoggingError {\n\t\treturn new LoggingError(\"uploadBlob aborted\", {\n\t\t\tacked: pending?.acked,\n\t\t\tuploadTime: pending?.uploadTime,\n\t\t});\n\t}\n\n\tpublic hasBlob(localId: string): boolean {\n\t\treturn this.redirectTable.get(localId) !== undefined;\n\t}\n\n\t/**\n\t * Lookup the blob storage ID for a given local blob id.\n\t * @param localId - The local blob id. Likely coming from a handle.\n\t * @returns The storage ID if found and the blob is not pending, undefined otherwise.\n\t * @remarks\n\t * For blobs with pending payloads (localId exists but upload hasn't finished), this is expected to return undefined.\n\t * Consumers should use the observability APIs on the handle (handle.payloadState, payloadShared event)\n\t * to understand/wait for storage ID availability.\n\t * Similarly, when the runtime is detached, this will return undefined as no blobs have been uploaded to storage.\n\t */\n\tpublic lookupTemporaryBlobStorageId(localId: string): string | undefined {\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Get the storage ID from the redirect table\n\t\treturn this.redirectTable.get(localId);\n\t}\n\n\t/**\n\t * Retrieve the blob with the given local blob id.\n\t * @param localId - The local blob id. Likely coming from a handle.\n\t * @param payloadPending - Whether we suspect the payload may be pending and not available yet.\n\t * @returns A promise which resolves to the blob contents\n\t */\n\tpublic async getBlob(localId: string, payloadPending: boolean): Promise<ArrayBufferLike> {\n\t\t// Verify that the blob is not deleted, i.e., it has not been garbage collected. If it is, this will throw\n\t\t// an error, failing the call.\n\t\tthis.verifyBlobNotDeleted(localId);\n\t\t// Let runtime know that the corresponding GC node was requested.\n\t\t// Note that this will throw if the blob is inactive or tombstoned and throwing on incorrect usage\n\t\t// is configured.\n\t\tthis.blobRequested(getGCNodePathFromLocalId(localId));\n\n\t\tconst pending = this.pendingBlobs.get(localId);\n\t\tif (pending) {\n\t\t\treturn pending.blob;\n\t\t}\n\n\t\tlet storageId = this.redirectTable.get(localId);\n\t\tif (storageId === undefined) {\n\t\t\t// Only blob handles explicitly marked with pending payload are permitted to exist without\n\t\t\t// yet knowing their storage id. Otherwise they must already be associated with a storage id.\n\t\t\t// Handles for detached blobs are not payload pending.\n\t\t\tassert(payloadPending, 0x11f /* \"requesting unknown blobs\" */);\n\t\t\t// If we didn't find it in the redirectTable and it's payloadPending, assume the attach op is coming\n\t\t\t// eventually and wait. We do this even if the local client doesn't have the blob payloadPending flag\n\t\t\t// enabled, in case a remote client does have it enabled. This wait may be infinite if the uploading\n\t\t\t// client failed the upload and doesn't exist anymore.\n\t\t\t// TODO: Fix this violation and remove the disable\n\t\t\t// eslint-disable-next-line require-atomic-updates\n\t\t\tstorageId = await new Promise<string>((resolve) => {\n\t\t\t\tconst onProcessBlobAttach = (_localId: string, _storageId: string): void => {\n\t\t\t\t\tif (_localId === localId) {\n\t\t\t\t\t\tthis.internalEvents.off(\"processedBlobAttach\", onProcessBlobAttach);\n\t\t\t\t\t\tresolve(_storageId);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis.internalEvents.on(\"processedBlobAttach\", onProcessBlobAttach);\n\t\t\t});\n\t\t}\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"AttachmentReadBlob\", id: storageId },\n\t\t\tasync (event) => {\n\t\t\t\treturn this.storage.readBlob(storageId).catch((error) => {\n\t\t\t\t\tif (this.runtime.disposed) {\n\t\t\t\t\t\t// If the runtime is disposed, this is not an error we care to track, it's expected behavior.\n\t\t\t\t\t\tevent.cancel({ category: \"generic\" });\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t},\n\t\t\t{ end: true, cancel: \"error\" },\n\t\t);\n\t}\n\n\tprivate getBlobHandle(localId: string): BlobHandle {\n\t\tassert(\n\t\t\tthis.redirectTable.has(localId) || this.pendingBlobs.has(localId),\n\t\t\t0x384 /* requesting handle for unknown blob */,\n\t\t);\n\t\tconst pending = this.pendingBlobs.get(localId);\n\t\t// Create a callback function for once the handle has been attached\n\t\tconst callback = pending\n\t\t\t? () => {\n\t\t\t\t\tpending.attached = true;\n\t\t\t\t\t// Notify listeners (e.g. serialization process) that handle has been attached\n\t\t\t\t\tthis.internalEvents.emit(\"handleAttached\", pending);\n\t\t\t\t\tthis.deletePendingBlobMaybe(localId);\n\t\t\t\t}\n\t\t\t: undefined;\n\t\treturn new BlobHandle(\n\t\t\tgetGCNodePathFromLocalId(localId),\n\t\t\tthis.routeContext,\n\t\t\tasync () => this.getBlob(localId, false),\n\t\t\tfalse, // payloadPending\n\t\t\tcallback,\n\t\t);\n\t}\n\n\tprivate async createBlobDetached(\n\t\tblob: ArrayBufferLike,\n\t): Promise<IFluidHandleInternalPayloadPending<ArrayBufferLike>> {\n\t\tconst localId = this.localIdGenerator();\n\t\t// Blobs created while the container is detached are stored in IDetachedBlobStorage.\n\t\t// The 'IContainerStorageService.createBlob()' call below will respond with a pseudo storage ID.\n\t\t// That pseudo storage ID will be replaced with the real storage ID at attach time.\n\t\tconst { id: detachedStorageId } = await this.storage.createBlob(blob);\n\t\tthis.setRedirection(localId, detachedStorageId);\n\t\treturn this.getBlobHandle(localId);\n\t}\n\n\tpublic async createBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternalPayloadPending<ArrayBufferLike>> {\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\treturn this.createBlobDetached(blob);\n\t\t}\n\t\tif (this.runtime.attachState === AttachState.Attaching) {\n\t\t\t// blob upload is not supported in \"Attaching\" state\n\t\t\tthis.mc.logger.sendTelemetryEvent({ eventName: \"CreateBlobWhileAttaching\" });\n\t\t\tawait new Promise<void>((resolve) => this.runtime.once(\"attached\", resolve));\n\t\t}\n\t\tassert(\n\t\t\tthis.runtime.attachState === AttachState.Attached,\n\t\t\t0x385 /* For clarity and paranoid defense against adding future attachment states */,\n\t\t);\n\n\t\treturn this.createBlobPayloadPending\n\t\t\t? this.createBlobWithPayloadPending(blob)\n\t\t\t: this.createBlobLegacy(blob, signal);\n\t}\n\n\tprivate async createBlobLegacy(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternalPayloadPending<ArrayBufferLike>> {\n\t\tif (signal?.aborted === true) {\n\t\t\tthrow this.createAbortError();\n\t\t}\n\n\t\t// Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to\n\t\t// storage ID mapping is created.\n\t\tconst localId = this.localIdGenerator();\n\t\tconst pendingEntry: PendingBlob = {\n\t\t\tblob,\n\t\t\thandleP: new Deferred(),\n\t\t\tuploadP: this.uploadBlob(localId, blob),\n\t\t\tattached: false,\n\t\t\tacked: false,\n\t\t\tabortSignal: signal,\n\t\t\topsent: false,\n\t\t};\n\t\tthis.pendingBlobs.set(localId, pendingEntry);\n\n\t\tconst abortListener = (): void => {\n\t\t\tif (pendingEntry.acked !== true) {\n\t\t\t\tpendingEntry.handleP.reject(this.createAbortError(pendingEntry));\n\t\t\t}\n\t\t};\n\t\tsignal?.addEventListener(\"abort\", abortListener, { once: true });\n\n\t\treturn pendingEntry.handleP.promise.finally(() => {\n\t\t\tsignal?.removeEventListener(\"abort\", abortListener);\n\t\t});\n\t}\n\n\tprivate createBlobWithPayloadPending(\n\t\tblob: ArrayBufferLike,\n\t): IFluidHandleInternalPayloadPending<ArrayBufferLike> {\n\t\tconst localId = this.localIdGenerator();\n\n\t\tconst blobHandle = new BlobHandle(\n\t\t\tgetGCNodePathFromLocalId(localId),\n\t\t\tthis.routeContext,\n\t\t\tasync () => blob,\n\t\t\ttrue, // payloadPending\n\t\t\t() => {\n\t\t\t\tconst pendingEntry: PendingBlob = {\n\t\t\t\t\tblob,\n\t\t\t\t\thandleP: new Deferred(),\n\t\t\t\t\tuploadP: this.uploadBlob(localId, blob),\n\t\t\t\t\tattached: true,\n\t\t\t\t\tacked: false,\n\t\t\t\t\topsent: false,\n\t\t\t\t};\n\t\t\t\tthis.pendingBlobs.set(localId, pendingEntry);\n\t\t\t},\n\t\t);\n\n\t\tconst onProcessedBlobAttach = (_localId: string, _storageId: string): void => {\n\t\t\tif (_localId === localId) {\n\t\t\t\tthis.internalEvents.off(\"processedBlobAttach\", onProcessedBlobAttach);\n\t\t\t\tblobHandle.notifyShared();\n\t\t\t}\n\t\t};\n\t\tthis.internalEvents.on(\"processedBlobAttach\", onProcessedBlobAttach);\n\n\t\tconst onUploadFailed = (_localId: string, error: unknown): void => {\n\t\t\tif (_localId === localId) {\n\t\t\t\tthis.internalEvents.off(\"uploadFailed\", onUploadFailed);\n\t\t\t\tblobHandle.notifyFailed(error);\n\t\t\t}\n\t\t};\n\t\tthis.internalEvents.on(\"uploadFailed\", onUploadFailed);\n\n\t\treturn blobHandle;\n\t}\n\n\t/**\n\t * Upload a blob to the storage service.\n\t * @returns A promise that resolves when the upload is complete and a blob attach op has been sent (but not ack'd).\n\t *\n\t * @privateRemarks This method must not reject, as there is no error handling for it in current tracking.\n\t */\n\tprivate async uploadBlob(localId: string, blob: ArrayBufferLike): Promise<void> {\n\t\tlet response: ICreateBlobResponseWithTTL;\n\t\ttry {\n\t\t\tresponse = await this.storage.createBlob(blob);\n\t\t} catch (error) {\n\t\t\tconst entry = this.pendingBlobs.get(localId);\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"UploadBlobReject\",\n\t\t\t\t// TODO: better typing\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n\t\t\t\terror: error as any,\n\t\t\t\tmessage: entry === undefined ? \"Missing pendingBlob\" : undefined,\n\t\t\t\tlocalId,\n\t\t\t});\n\t\t\t// We probably should assert the pendingBlobs entry here, but we don't currently have any error handling\n\t\t\t// for the uploadP - a promise rejection would be unhandled anyway. For now we can detect this with the\n\t\t\t// message on the UploadBlobReject telemetry.\n\t\t\tif (entry !== undefined) {\n\t\t\t\tentry.handleP.reject(error);\n\t\t\t\tthis.deletePendingBlob(localId);\n\t\t\t}\n\t\t\tthis.internalEvents.emit(\"uploadFailed\", localId, error);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis.onUploadResolve(localId, response);\n\t\t} catch (error) {\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"OnUploadResolveError\",\n\t\t\t\t// TODO: better typing\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n\t\t\t\terror: error as any,\n\t\t\t\tlocalId,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added\n\t * which is required for GC.\n\t */\n\tprivate setRedirection(fromId: string, toId: string): void {\n\t\tthis.redirectTable.set(fromId, toId);\n\t}\n\n\tprivate deletePendingBlobMaybe(localId: string): void {\n\t\tif (this.pendingBlobs.has(localId)) {\n\t\t\tconst entry = this.pendingBlobs.get(localId);\n\t\t\tif (entry?.attached === true && entry?.acked === true) {\n\t\t\t\tthis.deletePendingBlob(localId);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate deletePendingBlob(id: string): void {\n\t\tif (this.pendingBlobs.delete(id) && !this.hasPendingBlobs) {\n\t\t\tthis.publicEvents.emit(\"noPendingBlobs\");\n\t\t}\n\t}\n\n\tprivate onUploadResolve(\n\t\tlocalId: string,\n\t\tresponse: ICreateBlobResponseWithTTL,\n\t): ICreateBlobResponseWithTTL | undefined {\n\t\tconst entry = this.pendingBlobs.get(localId);\n\n\t\tassert(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);\n\t\tif (entry.abortSignal?.aborted === true && entry.opsent !== true) {\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"BlobAborted\",\n\t\t\t\tlocalId,\n\t\t\t});\n\t\t\tthis.deletePendingBlob(localId);\n\t\t\treturn;\n\t\t}\n\t\tassert(\n\t\t\tentry.storageId === undefined,\n\t\t\t0x386 /* Must have pending blob entry for uploaded blob */,\n\t\t);\n\t\tentry.storageId = response.id;\n\t\tentry.uploadTime = Date.now();\n\t\tentry.minTTLInSeconds = response.minTTLInSeconds;\n\t\t// Send a blob attach op. This serves two purposes:\n\t\t// 1. If its a new blob, i.e., it isn't de-duped, the server will keep the blob alive if it sees this op\n\t\t// until its storage ID is added to the next summary.\n\t\t// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the\n\t\t// blob from the server via the storage ID.\n\t\tif (entry.opsent !== true) {\n\t\t\tthis.sendBlobAttachOp(localId, response.id);\n\t\t}\n\t\tconst storageIds = getStorageIds(this.redirectTable);\n\t\tif (storageIds.has(response.id)) {\n\t\t\t// The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is\n\t\t\t// an existing blob, we don't have to wait for the op to be ack'd since this step has already\n\t\t\t// happened before and so, the server won't delete it.\n\t\t\tthis.setRedirection(localId, response.id);\n\t\t\tconst blobHandle = this.getBlobHandle(localId);\n\t\t\tblobHandle.notifyShared();\n\t\t\tentry.handleP.resolve(blobHandle);\n\t\t\tthis.deletePendingBlobMaybe(localId);\n\t\t} else {\n\t\t\t// If there is already an op for this storage ID, append the local ID to the list. Once any op for\n\t\t\t// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the\n\t\t\t// blob alive in storage.\n\t\t\tlet setForRemoteId = this.opsInFlight.get(response.id);\n\t\t\tif (setForRemoteId === undefined) {\n\t\t\t\tsetForRemoteId = new Set();\n\t\t\t\tthis.opsInFlight.set(response.id, setForRemoteId);\n\t\t\t}\n\t\t\t// seeing the same localId twice can happen if a blob is being reuploaded and stashed.\n\t\t\t// TODO: review stashing logic and see if we can avoid this, as well in tests.\n\t\t\tsetForRemoteId.add(localId);\n\t\t}\n\t\treturn response;\n\t}\n\n\t/**\n\t * Resubmit a BlobAttach op. Used to add storage IDs to ops that were\n\t * submitted to runtime while disconnected.\n\t * @param metadata - op metadata containing storage and/or local IDs\n\t */\n\tpublic reSubmit(metadata: Record<string, unknown> | undefined): void {\n\t\tassert(isBlobMetadata(metadata), 0xc01 /* Expected blob metadata for a BlobAttach op */);\n\t\tconst { localId, blobId: storageId } = metadata;\n\t\t// Any blob that we're actively trying to advance to attached state must have a\n\t\t// pendingBlobs entry. Decline to resubmit for anything else.\n\t\t// For example, we might be asked to resubmit stashed ops for blobs that never had\n\t\t// their handle attached - these won't have a pendingBlobs entry and we shouldn't\n\t\t// try to attach them since they won't be accessible to the customer and would just\n\t\t// be considered garbage immediately.\n\t\tif (this.pendingBlobs.has(localId)) {\n\t\t\tthis.sendBlobAttachOp(localId, storageId);\n\t\t}\n\t}\n\n\tpublic processBlobAttachMessage(message: ISequencedMessageEnvelope, local: boolean): void {\n\t\tassert(\n\t\t\tisBlobMetadata(message.metadata),\n\t\t\t0xc02 /* Expected blob metadata for a BlobAttach op */,\n\t\t);\n\t\tconst { localId, blobId: storageId } = message.metadata;\n\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\t\tif (pendingEntry?.abortSignal?.aborted === true) {\n\t\t\tthis.deletePendingBlob(localId);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setRedirection(localId, storageId);\n\t\t// set identity (id -> id) entry\n\t\tthis.setRedirection(storageId, storageId);\n\n\t\tif (local) {\n\t\t\tconst waitingBlobs = this.opsInFlight.get(storageId);\n\t\t\tif (waitingBlobs !== undefined) {\n\t\t\t\t// For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.\n\t\t\t\t// This is safe because the server will keep the blob alive and the op containing the local ID to\n\t\t\t\t// storage ID is already in flight and any op containing this local ID will be sequenced after that.\n\t\t\t\tfor (const pendingLocalId of waitingBlobs) {\n\t\t\t\t\tconst entry = this.pendingBlobs.get(pendingLocalId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\tentry !== undefined,\n\t\t\t\t\t\t0x38f /* local online BlobAttach op with no pending blob entry */,\n\t\t\t\t\t);\n\t\t\t\t\tthis.setRedirection(pendingLocalId, storageId);\n\t\t\t\t\tentry.acked = true;\n\t\t\t\t\tconst blobHandle = this.getBlobHandle(pendingLocalId);\n\t\t\t\t\tblobHandle.notifyShared();\n\t\t\t\t\tentry.handleP.resolve(blobHandle);\n\t\t\t\t\tthis.deletePendingBlobMaybe(pendingLocalId);\n\t\t\t\t}\n\t\t\t\tthis.opsInFlight.delete(storageId);\n\t\t\t}\n\t\t\tconst localEntry = this.pendingBlobs.get(localId);\n\t\t\tif (localEntry) {\n\t\t\t\tlocalEntry.acked = true;\n\t\t\t\tconst blobHandle = this.getBlobHandle(localId);\n\t\t\t\tblobHandle.notifyShared();\n\t\t\t\tlocalEntry.handleP.resolve(blobHandle);\n\t\t\t\tthis.deletePendingBlobMaybe(localId);\n\t\t\t}\n\t\t}\n\t\tthis.internalEvents.emit(\"processedBlobAttach\", localId, storageId);\n\t}\n\n\tpublic summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\treturn summarizeBlobManagerState(this.redirectTable);\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be\n\t * individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care\n\t * about this for now because the data is a simple list of blob ids.\n\t */\n\tpublic getGCData(fullGC: boolean = false): IGarbageCollectionData {\n\t\tconst gcData: IGarbageCollectionData = { gcNodes: {} };\n\t\tfor (const [localId, storageId] of this.redirectTable) {\n\t\t\t// Don't report the identity mappings to GC - these exist to service old handles that referenced the storage\n\t\t\t// IDs directly. We'll implicitly clean them up if all of their localId references get GC'd first.\n\t\t\tif (localId !== storageId) {\n\t\t\t\t// The outbound routes are empty because a blob node cannot reference other nodes. It can only be referenced\n\t\t\t\t// by adding its handle to a referenced DDS.\n\t\t\t\tgcData.gcNodes[getGCNodePathFromLocalId(localId)] = [];\n\t\t\t}\n\t\t}\n\t\treturn gcData;\n\t}\n\n\t/**\n\t * Delete attachment blobs that are sweep ready.\n\t * @param sweepReadyBlobRoutes - The routes of blobs that are sweep ready and should be deleted. These routes will\n\t * be based off of local ids.\n\t * @returns The routes of blobs that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(sweepReadyBlobRoutes: readonly string[]): readonly string[] {\n\t\tthis.deleteBlobsFromRedirectTable(sweepReadyBlobRoutes);\n\t\treturn [...sweepReadyBlobRoutes];\n\t}\n\n\t/**\n\t * Delete blobs with the given routes from the redirect table.\n\t *\n\t * @remarks\n\t * The routes are GC nodes paths of format -`/<blobManagerBasePath>/<localId>`.\n\t * Deleting the blobs involves 2 steps:\n\t *\n\t * 1. The redirect table entry for the local ids are deleted.\n\t *\n\t * 2. If the storage ids corresponding to the deleted local ids are not referenced by any further local ids, the\n\t * identity mappings in the redirect table are deleted as well.\n\t *\n\t * Note that this does not delete the blobs from storage service immediately. Deleting the blobs from redirect table\n\t * will ensure we don't create an attachment blob for them at the next summary. The service would then delete them\n\t * some time in the future.\n\t */\n\tprivate deleteBlobsFromRedirectTable(blobRoutes: readonly string[]): void {\n\t\t// maybeUnusedStorageIds is used to compute the set of storage IDs that *used to have a local ID*, but that\n\t\t// local ID is being deleted.\n\t\tconst maybeUnusedStorageIds: Set<string> = new Set();\n\t\tfor (const route of blobRoutes) {\n\t\t\tconst localId = getLocalIdFromGCNodePath(route);\n\t\t\t// If the blob hasn't already been deleted, log an error because this should never happen.\n\t\t\t// If the blob has already been deleted, log a telemetry event. This can happen because multiple GC\n\t\t\t// sweep ops can contain the same data store. It would be interesting to track how often this happens.\n\t\t\tconst alreadyDeleted = this.isBlobDeleted(route);\n\t\t\tconst storageId = this.redirectTable.get(localId);\n\t\t\tif (storageId === undefined) {\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"DeletedAttachmentBlobNotFound\",\n\t\t\t\t\tcategory: alreadyDeleted ? \"generic\" : \"error\",\n\t\t\t\t\tblobId: localId,\n\t\t\t\t\tdetails: { alreadyDeleted },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmaybeUnusedStorageIds.add(storageId);\n\t\t\tthis.redirectTable.delete(localId);\n\t\t}\n\n\t\t// Remove any storage IDs that still have local IDs referring to them (excluding the identity mapping).\n\t\tfor (const [localId, storageId] of this.redirectTable) {\n\t\t\tif (localId !== storageId) {\n\t\t\t\tmaybeUnusedStorageIds.delete(storageId);\n\t\t\t}\n\t\t}\n\n\t\t// Now delete any identity mappings (storage ID -> storage ID) from the redirect table that used to be\n\t\t// referenced by a distinct local ID. This way they'll be absent from the next summary, and the service\n\t\t// is free to delete them from storage.\n\t\t// WARNING: This can potentially delete identity mappings that are still referenced, if storage deduping\n\t\t// has let us add a local ID -> storage ID mapping that is later deleted. AB#47337 tracks this issue\n\t\t// and possible solutions.\n\t\tfor (const storageId of maybeUnusedStorageIds) {\n\t\t\tthis.redirectTable.delete(storageId);\n\t\t}\n\t}\n\n\t/**\n\t * Verifies that the blob with given id is not deleted, i.e., it has not been garbage collected. If the blob is GC'd,\n\t * log an error and throw if necessary.\n\t */\n\tprivate verifyBlobNotDeleted(localId: string): void {\n\t\tif (!this.isBlobDeleted(getGCNodePathFromLocalId(localId))) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst request = { url: localId };\n\t\tconst error = responseToException(\n\t\t\tcreateResponseError(404, `Blob was deleted`, request),\n\t\t\trequest,\n\t\t);\n\t\t// Only log deleted events. Tombstone events are logged by garbage collector.\n\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t{\n\t\t\t\teventName: \"GC_Deleted_Blob_Requested\",\n\t\t\t\tpkg: blobManagerBasePath,\n\t\t\t},\n\t\t\terror,\n\t\t);\n\t\tthrow error;\n\t}\n\n\t/**\n\t * Called in detached state just prior to attaching, this will update the redirect table by\n\t * converting the pseudo storage IDs into real storage IDs using the provided detachedStorageTable.\n\t * The provided table must have exactly the same set of pseudo storage IDs as are found in the redirect table.\n\t * @param detachedStorageTable - A map of pseudo storage IDs to real storage IDs.\n\t */\n\tpublic readonly patchRedirectTable = (detachedStorageTable: Map<string, string>): void => {\n\t\tassert(\n\t\t\tthis.runtime.attachState === AttachState.Detached,\n\t\t\t0x252 /* \"redirect table can only be set in detached container\" */,\n\t\t);\n\t\t// The values of the redirect table are the pseudo storage IDs, which are the keys of the\n\t\t// detachedStorageTable. We expect to have a many:1 mapping from local IDs to pseudo\n\t\t// storage IDs (many in the case that the storage dedupes the blob).\n\t\tassert(\n\t\t\tnew Set(this.redirectTable.values()).size === detachedStorageTable.size,\n\t\t\t0x391 /* Redirect table size must match BlobManager's local ID count */,\n\t\t);\n\t\t// Taking a snapshot of the redirect table entries before iterating, because\n\t\t// we will be adding identity mappings to the the redirect table as we iterate\n\t\t// and we don't want to include those in the iteration.\n\t\tconst redirectTableEntries = [...this.redirectTable.entries()];\n\t\tfor (const [localId, detachedStorageId] of redirectTableEntries) {\n\t\t\tconst newStorageId = detachedStorageTable.get(detachedStorageId);\n\t\t\tassert(newStorageId !== undefined, 0xc53 /* Couldn't find a matching storage ID */);\n\t\t\tthis.setRedirection(localId, newStorageId);\n\t\t\t// set identity (id -> id) entry\n\t\t\tthis.setRedirection(newStorageId, newStorageId);\n\t\t}\n\t};\n\n\t/**\n\t * To be used in getPendingLocalState flow. Get a serializable record of the blobs that are\n\t * pending upload and/or their BlobAttach op, which can be given to a new BlobManager to\n\t * resume work.\n\t *\n\t * @privateRemarks\n\t * For now, we don't track any pending blobs since the getPendingBlobs flow doesn't enable\n\t * restoring to a state where an accessible handle has been stored by the customer (and we'll\n\t * just drop any BlobAttach ops on the ground during reSubmit). However, once we add support\n\t * for payload-pending handles, this will return the blobs associated with those handles.\n\t */\n\tpublic getPendingBlobs(): IPendingBlobs | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Part of container serialization when imminent closure is enabled (Currently when calling closeAndGetPendingLocalState).\n\t * This asynchronous function resolves all pending createBlob calls and waits for each blob\n\t * to be attached. It will also send BlobAttach ops for each pending blob that hasn't sent it\n\t * yet so that serialized container can resubmit them when rehydrated.\n\t *\n\t * @param stopBlobAttachingSignal - Optional signal to abort the blob attaching process.\n\t * @returns - A promise that resolves with the details of the attached blobs,\n\t * or undefined if no blobs were processed.\n\t */\n\tpublic async attachAndGetPendingBlobs(\n\t\tstopBlobAttachingSignal?: AbortSignal,\n\t): Promise<IPendingBlobs | undefined> {\n\t\tthrow new UsageError(\"attachAndGetPendingBlobs is no longer supported\");\n\t}\n}\n\n/**\n * For a localId, returns its path in GC's graph. The node path is of the format `/<blobManagerBasePath>/<localId>`.\n * This path must match the path of the blob handle returned by the createBlob API because blobs are marked\n * referenced by storing these handles in a referenced DDS.\n */\nconst getGCNodePathFromLocalId = (localId: string): string =>\n\t`/${blobManagerBasePath}/${localId}`;\n\n/**\n * For a given GC node path, return the localId. The node path is of the format `/<basePath>/<localId>`.\n */\nconst getLocalIdFromGCNodePath = (nodePath: string): string => {\n\tconst pathParts = nodePath.split(\"/\");\n\tassert(areBlobPathParts(pathParts), 0x5bd /* Invalid blob node path */);\n\treturn pathParts[2];\n};\n\n/**\n * Returns whether a given path is for attachment blobs that are in the format - \"/blobManagerBasePath/...\".\n */\nexport const isBlobPath = (path: string): path is `/${typeof blobManagerBasePath}/${string}` =>\n\tareBlobPathParts(path.split(\"/\"));\n\nconst areBlobPathParts = (\n\tpathParts: string[],\n): pathParts is [\"\", typeof blobManagerBasePath, string] =>\n\tpathParts.length === 3 && pathParts[1] === blobManagerBasePath;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManagerSnapSum.js","sourceRoot":"","sources":["../../src/blobManager/blobManagerSnapSum.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,oEAAqE;AAErE,qEAA4E;AAY/D,QAAA,qBAAqB,GAAG,gBAAgB,CAAC;AAEtD;;GAEG;AACU,QAAA,aAAa,GAAG,QAAQ,CAAC;AAEtC;;;GAGG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAC3C,OAA4E,EAC5C,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAFvC,QAAA,uBAAuB,2BAEgB;AAEpD,MAAM,MAAM,GAAG,KAAK,EACnB,OAA4E,EAC5C,EAAE;IAClC,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,qBAAa,CAAC,CAAC;IAE7D,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,IAAI,oBAAoB,GAAuB,EAAE,CAAC;IAClD,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"blobManagerSnapSum.js","sourceRoot":"","sources":["../../src/blobManager/blobManagerSnapSum.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,oEAAqE;AAErE,qEAA4E;AAY/D,QAAA,qBAAqB,GAAG,gBAAgB,CAAC;AAEtD;;GAEG;AACU,QAAA,aAAa,GAAG,QAAQ,CAAC;AAEtC;;;GAGG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAC3C,OAA4E,EAC5C,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAFvC,QAAA,uBAAuB,2BAEgB;AAEpD,MAAM,MAAM,GAAG,KAAK,EACnB,OAA4E,EAC5C,EAAE;IAClC,MAAM,SAA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microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerContext } from \"@fluidframework/container-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport type { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Information from a snapshot needed to load BlobManager\n * @internal\n */\nexport interface IBlobManagerLoadInfo {\n\tids?: string[];\n\tredirectTable?: [string, string][];\n}\n\nexport const redirectTableBlobName = \".redirectTable\";\n\n/**\n * @internal\n */\nexport const blobsTreeName = \".blobs\";\n\n/**\n * Reads blobs needed to load BlobManager from storage.\n *\n */\nexport const loadBlobManagerLoadInfo = async (\n\tcontext: Pick<IContainerContext, \"baseSnapshot\" | \"storage\" | \"attachState\">,\n): Promise<IBlobManagerLoadInfo> => loadV1(context);\n\nconst loadV1 = async (\n\tcontext: Pick<IContainerContext, \"baseSnapshot\" | \"storage\" | \"attachState\">,\n): Promise<IBlobManagerLoadInfo> => {\n\tconst blobsTree = context.baseSnapshot?.trees[blobsTreeName];\n\n\tif (!blobsTree) {\n\t\treturn {};\n\t}\n\tlet redirectTableEntries: [string, string][] = [];\n\tconst tableId: string | undefined = blobsTree.blobs[redirectTableBlobName];\n\tif (tableId) {\n\t\tredirectTableEntries = await readAndParse(context.storage, tableId);\n\t}\n\tconst ids = Object.entries(blobsTree.blobs)\n\t\t.filter(([k, _]) => k !== redirectTableBlobName)\n\t\t.map(([_, v]) => v);\n\n\treturn { ids, redirectTable: redirectTableEntries };\n};\n\nexport const toRedirectTable = (\n\tblobManagerLoadInfo: IBlobManagerLoadInfo,\n\tlogger: ITelemetryLoggerExt,\n): Map<string, string> => {\n\tlogger.sendTelemetryEvent({\n\t\teventName: \"AttachmentBlobsLoaded\",\n\t\tcount: blobManagerLoadInfo.ids?.length ?? 0,\n\t\tredirectTable: blobManagerLoadInfo.redirectTable?.length,\n\t});\n\tconst redirectTable = new Map<string, string>(blobManagerLoadInfo.redirectTable);\n\tif (blobManagerLoadInfo.ids !== undefined) {\n\t\tfor (const storageId of blobManagerLoadInfo.ids) {\n\t\t\t// Older versions of the runtime used the storage ID directly in the handle,\n\t\t\t// rather than routing through the redirectTable. To support old handles that\n\t\t\t// were created in this way but unify handling through the redirectTable, we\n\t\t\t// add identity mappings to the redirect table at load. These identity entries\n\t\t\t// will be excluded during summarization.\n\t\t\tredirectTable.set(storageId, storageId);\n\t\t}\n\t}\n\treturn redirectTable;\n};\n\nexport const summarizeBlobManagerState = (\n\tredirectTable: Map<string, string>,\n): ISummaryTreeWithStats => summarizeV1(redirectTable);\n\nconst summarizeV1 = (redirectTable: Map<string, string>): ISummaryTreeWithStats => {\n\tconst builder = new SummaryTreeBuilder();\n\tconst storageIds = getStorageIds(redirectTable);\n\tfor (const storageId of storageIds) {\n\t\t// The Attachment is inspectable by storage, which lets it detect that the blob is referenced\n\t\t// and therefore should not be GC'd.\n\t\tbuilder.addAttachment(storageId);\n\t}\n\n\t// Exclude identity mappings from the redirectTable summary. Note that\n\t// the storageIds of the identity mappings are still included in the Attachments\n\t// above, so we expect these identity mappings will be recreated at load\n\t// time in toRedirectTable even if there is no non-identity mapping in\n\t// the redirectTable.\n\tconst nonIdentityRedirectTableEntries = [...redirectTable.entries()].filter(\n\t\t([localId, storageId]) => localId !== storageId,\n\t);\n\tif (nonIdentityRedirectTableEntries.length > 0) {\n\t\tbuilder.addBlob(redirectTableBlobName, JSON.stringify(nonIdentityRedirectTableEntries));\n\t}\n\n\treturn builder.getSummaryTree();\n};\n\nexport const getStorageIds = (redirectTable: Map<string, string>): Set<string> => {\n\treturn new Set<string>(redirectTable.values());\n};\n"]}
|
|
@@ -353,7 +353,7 @@ class ChannelCollection {
|
|
|
353
353
|
}
|
|
354
354
|
// If message timestamp doesn't exist, this is called in a detached container. Don't notify GC in that case
|
|
355
355
|
// because it doesn't run in detached container and doesn't need to know about this route.
|
|
356
|
-
if (messageTimestampMs) {
|
|
356
|
+
if (messageTimestampMs !== undefined) {
|
|
357
357
|
this.parentContext.addedGCOutboundRoute("/", `/${internalId}`, messageTimestampMs);
|
|
358
358
|
}
|
|
359
359
|
this.aliasMap.set(alias, context.id);
|
|
@@ -1184,7 +1184,7 @@ function getSummaryForDatastores(snapshot, metadata) {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
if ((0, index_js_2.rootHasIsolatedChannels)(metadata)) {
|
|
1186
1186
|
const datastoresSnapshot = snapshot.trees[internal_4.channelsTreeName];
|
|
1187
|
-
(0, internal_1.assert)(
|
|
1187
|
+
(0, internal_1.assert)(datastoresSnapshot !== undefined, 0x168 /* Expected tree in snapshot not found */);
|
|
1188
1188
|
return datastoresSnapshot;
|
|
1189
1189
|
}
|
|
1190
1190
|
else {
|