@fluidframework/container-runtime 2.0.0-internal.2.3.0 → 2.0.0-internal.2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blobManager.d.ts +4 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +43 -10
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +15 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +28 -13
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +5 -8
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +3 -3
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +14 -14
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +15 -7
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +101 -40
- package/dist/garbageCollection.js.map +1 -1
- package/dist/garbageCollectionConstants.d.ts +1 -0
- package/dist/garbageCollectionConstants.d.ts.map +1 -1
- package/dist/garbageCollectionConstants.js +4 -2
- package/dist/garbageCollectionConstants.js.map +1 -1
- package/dist/garbageCollectionTombstoneUtils.d.ts +5 -4
- package/dist/garbageCollectionTombstoneUtils.d.ts.map +1 -1
- package/dist/garbageCollectionTombstoneUtils.js +8 -13
- package/dist/garbageCollectionTombstoneUtils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/summarizer.js.map +1 -1
- package/lib/blobManager.d.ts +4 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +44 -11
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +15 -0
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +27 -12
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +5 -8
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +3 -3
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +15 -15
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +15 -7
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +103 -42
- package/lib/garbageCollection.js.map +1 -1
- package/lib/garbageCollectionConstants.d.ts +1 -0
- package/lib/garbageCollectionConstants.d.ts.map +1 -1
- package/lib/garbageCollectionConstants.js +3 -1
- package/lib/garbageCollectionConstants.js.map +1 -1
- package/lib/garbageCollectionTombstoneUtils.d.ts +5 -4
- package/lib/garbageCollectionTombstoneUtils.d.ts.map +1 -1
- package/lib/garbageCollectionTombstoneUtils.js +9 -14
- package/lib/garbageCollectionTombstoneUtils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/summarizer.js.map +1 -1
- package/package.json +16 -16
- package/src/blobManager.ts +57 -13
- package/src/containerRuntime.ts +38 -9
- package/src/dataStoreContext.ts +13 -14
- package/src/dataStores.ts +25 -19
- package/src/garbageCollection.ts +115 -42
- package/src/garbageCollectionConstants.ts +3 -1
- package/src/garbageCollectionTombstoneUtils.ts +11 -14
- package/src/index.ts +2 -0
- package/src/packageVersion.ts +1 -1
- package/src/summarizer.ts +1 -1
package/dist/blobManager.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
60
60
|
private readonly blobRequested;
|
|
61
61
|
private readonly addedBlobReference;
|
|
62
62
|
private readonly runtime;
|
|
63
|
+
private readonly getCurrentReferenceTimestampMs;
|
|
63
64
|
static readonly basePath = "_blobs";
|
|
64
65
|
private static readonly redirectTableBlobName;
|
|
65
66
|
private readonly mc;
|
|
@@ -85,7 +86,7 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
85
86
|
private readonly opsInFlight;
|
|
86
87
|
private readonly retryThrottler;
|
|
87
88
|
/** If true, throw an error when a tombstone attachment blob is retrieved. */
|
|
88
|
-
private readonly
|
|
89
|
+
private readonly throwOnTombstoneLoad;
|
|
89
90
|
/**
|
|
90
91
|
* This stores IDs of tombstoned blobs.
|
|
91
92
|
* Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.
|
|
@@ -102,7 +103,7 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
102
103
|
* knowledge of which they cannot request the blob from storage. It's important that this op is sequenced
|
|
103
104
|
* before any ops that reference the local ID, otherwise, an invalid handle could be added to the document.
|
|
104
105
|
*/
|
|
105
|
-
sendBlobAttachOp: (localId: string, storageId?: string) => void, blobRequested: (blobPath: string) => void, addedBlobReference: (fromNodePath: string, toNodePath: string) => void, runtime: IBlobManagerRuntime, stashedBlobs
|
|
106
|
+
sendBlobAttachOp: (localId: string, storageId?: string) => void, blobRequested: (blobPath: string) => void, addedBlobReference: (fromNodePath: string, toNodePath: string) => void, runtime: IBlobManagerRuntime, stashedBlobs: IPendingBlobs | undefined, getCurrentReferenceTimestampMs: () => number | undefined);
|
|
106
107
|
private get pendingOfflineUploads();
|
|
107
108
|
get hasPendingOfflineUploads(): boolean;
|
|
108
109
|
get hasPendingBlobs(): boolean;
|
|
@@ -146,6 +147,7 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
146
147
|
* @param metadata - op metadata containing storage and/or local IDs
|
|
147
148
|
*/
|
|
148
149
|
reSubmit(metadata: Record<string, unknown> | undefined): void;
|
|
150
|
+
private logTimeInfo;
|
|
149
151
|
processBlobAttachOp(message: ISequencedDocumentMessage, local: boolean): void;
|
|
150
152
|
/**
|
|
151
153
|
* Reads blobs needed to load BlobManager from storage.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManager.d.ts","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAuB,yBAAyB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAOrH,OAAO,EAAoD,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACnH,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAG3G,OAAO,EACH,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,qCAAqC,CAAC;AAM7C;;;;;;GAMG;AACH,qBAAa,UAAW,YAAW,YAAY,CAAC,eAAe,CAAC;aAYxC,IAAI,EAAE,MAAM;aACZ,YAAY,EAAE,mBAAmB;IAC1C,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;IAblC,OAAO,CAAC,QAAQ,CAAkB;IAElC,IAAW,YAAY,IAAI,YAAY,CAAiB;IAExD,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,SAAgB,YAAY,EAAE,MAAM,CAAC;gBAGjB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB,EAC1C,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;IAK3B,WAAW;IAIX,IAAI,CAAC,MAAM,EAAE,YAAY;CAGnC;AAmBD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CACtC;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SAAS,EAAE,aAAa,GAAG,SAAS,EACpC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAC1D,OAAO,CAAC,oBAAoB,CAAC;IAchC;;OAEG;IACH,OAAO,CAAC,IAAI;IAgBZ;;;;;OAKG;IACI,SAAS,CAAC,MAAM,GAAE,OAAe,GAAG,sBAAsB;IASjE;;;OAGG;IACI,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAcvD;;;;OAIG;IACI,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,EAAE;IA0BjD,SAAS,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,GAAG,qBAAqB;IAqBtE,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAa3C,eAAe,IAAI,aAAa;CAO1C"}
|
package/dist/blobManager.js
CHANGED
|
@@ -81,7 +81,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
81
81
|
sendBlobAttachOp,
|
|
82
82
|
// To be called when a blob node is requested. blobPath is the path of the blob's node in GC's graph. It's
|
|
83
83
|
// of the format `/<BlobManager.basePath>/<blobId>`.
|
|
84
|
-
blobRequested, addedBlobReference, runtime, stashedBlobs = {}) {
|
|
84
|
+
blobRequested, addedBlobReference, runtime, stashedBlobs = {}, getCurrentReferenceTimestampMs) {
|
|
85
85
|
super();
|
|
86
86
|
this.routeContext = routeContext;
|
|
87
87
|
this.getStorage = getStorage;
|
|
@@ -89,6 +89,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
89
89
|
this.blobRequested = blobRequested;
|
|
90
90
|
this.addedBlobReference = addedBlobReference;
|
|
91
91
|
this.runtime = runtime;
|
|
92
|
+
this.getCurrentReferenceTimestampMs = getCurrentReferenceTimestampMs;
|
|
92
93
|
/**
|
|
93
94
|
* Blobs which have not been uploaded or for which we have not yet seen a BlobAttach op round-trip.
|
|
94
95
|
* Until we see the op round-trip, there is a possibility we may need to re-upload the blob, so
|
|
@@ -112,8 +113,8 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
112
113
|
this.tombstonedBlobs = new Set();
|
|
113
114
|
this.mc = (0, telemetry_utils_1.loggerToMonitoringContext)(telemetry_utils_1.ChildLogger.create(this.runtime.logger, "BlobManager"));
|
|
114
115
|
// Read the feature flag that tells whether to throw when a tombstone blob is requested.
|
|
115
|
-
this.
|
|
116
|
-
this.mc.config.getBoolean(garbageCollectionConstants_1.
|
|
116
|
+
this.throwOnTombstoneLoad =
|
|
117
|
+
this.mc.config.getBoolean(garbageCollectionConstants_1.throwOnTombstoneLoadKey) === true &&
|
|
117
118
|
this.runtime.clientDetails.type !== summarizerClientElection_1.summarizerClientType;
|
|
118
119
|
this.runtime.on("disconnected", () => this.onDisconnected());
|
|
119
120
|
this.redirectTable = this.load(snapshot);
|
|
@@ -187,13 +188,13 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
187
188
|
async getBlob(blobId) {
|
|
188
189
|
const request = { url: blobId };
|
|
189
190
|
if (this.tombstonedBlobs.has(blobId)) {
|
|
190
|
-
const error = (0, runtime_utils_1.responseToException)((0, runtime_utils_1.createResponseError)(404, "Blob
|
|
191
|
-
|
|
191
|
+
const error = (0, runtime_utils_1.responseToException)((0, runtime_utils_1.createResponseError)(404, "Blob was deleted", request), request);
|
|
192
|
+
(0, garbageCollectionTombstoneUtils_1.sendGCTombstoneEvent)(this.mc, {
|
|
192
193
|
eventName: "GC_Tombstone_Blob_Requested",
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (this.
|
|
194
|
+
category: this.throwOnTombstoneLoad ? "error" : "generic",
|
|
195
|
+
isSummarizerClient: this.runtime.clientDetails.type === summarizerClientElection_1.summarizerClientType,
|
|
196
|
+
}, [BlobManager.basePath], error);
|
|
197
|
+
if (this.throwOnTombstoneLoad) {
|
|
197
198
|
throw error;
|
|
198
199
|
}
|
|
199
200
|
}
|
|
@@ -281,6 +282,9 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
281
282
|
(0, common_utils_1.assert)((entry === null || entry === void 0 ? void 0 : entry.status) === PendingBlobStatus.OnlinePendingUpload ||
|
|
282
283
|
(entry === null || entry === void 0 ? void 0 : entry.status) === PendingBlobStatus.OfflinePendingUpload, 0x386 /* Must have pending blob entry for uploaded blob */);
|
|
283
284
|
entry.storageId = response.id;
|
|
285
|
+
entry.localUploadTime = Date.now();
|
|
286
|
+
entry.minTTLInSeconds = response.minTTLInSeconds;
|
|
287
|
+
entry.serverUploadTime = this.getCurrentReferenceTimestampMs();
|
|
284
288
|
if (this.runtime.connected) {
|
|
285
289
|
if (entry.status === PendingBlobStatus.OnlinePendingUpload) {
|
|
286
290
|
// Send a blob attach op. This serves two purposes:
|
|
@@ -288,6 +292,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
288
292
|
// until its storage ID is added to the next summary.
|
|
289
293
|
// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the
|
|
290
294
|
// blob from the server via the storage ID.
|
|
295
|
+
this.logTimeInfo(entry, "sendBlobAttachResolveTTL");
|
|
291
296
|
this.sendBlobAttachOp(localId, response.id);
|
|
292
297
|
if (this.storageIds.has(response.id)) {
|
|
293
298
|
// The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is
|
|
@@ -349,6 +354,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
349
354
|
* is called on reconnection.
|
|
350
355
|
*/
|
|
351
356
|
if (entry.status !== PendingBlobStatus.OnlinePendingOp) {
|
|
357
|
+
this.logTimeInfo(entry, "sendBlobAttachTransitionOfflineTTL");
|
|
352
358
|
this.sendBlobAttachOp(localId, entry.storageId);
|
|
353
359
|
}
|
|
354
360
|
entry.status = entry.status === PendingBlobStatus.OnlinePendingUpload
|
|
@@ -365,15 +371,42 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
365
371
|
(0, common_utils_1.assert)(!!metadata, 0x38b /* Resubmitted ops must have metadata */);
|
|
366
372
|
const { localId, blobId } = metadata;
|
|
367
373
|
(0, common_utils_1.assert)(localId !== undefined, 0x50d /* local ID not available on reSubmit */);
|
|
374
|
+
const pendingEntry = this.pendingBlobs.get(localId);
|
|
375
|
+
if (pendingEntry) {
|
|
376
|
+
this.logTimeInfo(pendingEntry, "sendBlobAttachResubmitTTL");
|
|
377
|
+
}
|
|
368
378
|
if (!blobId) {
|
|
369
379
|
// We submitted this op while offline. The blob should have been uploaded by now.
|
|
370
|
-
const pendingEntry = this.pendingBlobs.get(localId);
|
|
371
380
|
(0, common_utils_1.assert)((pendingEntry === null || pendingEntry === void 0 ? void 0 : pendingEntry.status) === PendingBlobStatus.OfflinePendingOp &&
|
|
372
381
|
!!(pendingEntry === null || pendingEntry === void 0 ? void 0 : pendingEntry.storageId), 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);
|
|
373
382
|
return this.sendBlobAttachOp(localId, pendingEntry.storageId);
|
|
374
383
|
}
|
|
375
384
|
return this.sendBlobAttachOp(localId, blobId);
|
|
376
385
|
}
|
|
386
|
+
logTimeInfo(pendingEntry, eventName) {
|
|
387
|
+
var _a, _b;
|
|
388
|
+
let timeLapseSinceLocalUpload = 0;
|
|
389
|
+
let timeLapseSinceServerUpload = 0;
|
|
390
|
+
let expiredUsingLocalTime;
|
|
391
|
+
let expiredUsingServerTime;
|
|
392
|
+
if (pendingEntry.localUploadTime) {
|
|
393
|
+
timeLapseSinceLocalUpload = (Date.now() - pendingEntry.localUploadTime) / 1000;
|
|
394
|
+
expiredUsingLocalTime = ((_a = pendingEntry.minTTLInSeconds) !== null && _a !== void 0 ? _a : 0) - timeLapseSinceLocalUpload < 0 ? true : false;
|
|
395
|
+
}
|
|
396
|
+
if (pendingEntry.serverUploadTime) {
|
|
397
|
+
timeLapseSinceServerUpload = (Date.now() - pendingEntry.serverUploadTime) / 1000;
|
|
398
|
+
expiredUsingServerTime = ((_b = pendingEntry.minTTLInSeconds) !== null && _b !== void 0 ? _b : 0) - timeLapseSinceServerUpload < 0 ? true : false;
|
|
399
|
+
}
|
|
400
|
+
this.mc.logger.sendTelemetryEvent({
|
|
401
|
+
eventName,
|
|
402
|
+
entryStatus: pendingEntry.status,
|
|
403
|
+
timeLapseSinceLocalUpload,
|
|
404
|
+
timeLapseSinceServerUpload,
|
|
405
|
+
minTTLInSeconds: pendingEntry.minTTLInSeconds,
|
|
406
|
+
expiredUsingLocalTime,
|
|
407
|
+
expiredUsingServerTime,
|
|
408
|
+
});
|
|
409
|
+
}
|
|
377
410
|
processBlobAttachOp(message, local) {
|
|
378
411
|
var _a, _b;
|
|
379
412
|
const localId = (_a = message.metadata) === null || _a === void 0 ? void 0 : _a.localId;
|
package/dist/blobManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AAIlC,iEAKuC;AACvC,+DAAmH;AAEnH,iFAAoE;AACpE,qEAA8H;AAM9H,2CAAuE;AACvE,yEAAkE;AAClE,6EAAwE;AACxE,uFAAyE;AAEzE;;;;;;GAMG;AACH,MAAa,UAAU;IAWnB,YACoB,IAAY,EACZ,YAAiC,EAC1C,GAAuB;QAFd,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAqB;QAC1C,QAAG,GAAH,GAAG,CAAoB;QAb1B,aAAQ,GAAY,KAAK,CAAC;QAe9B,IAAI,CAAC,YAAY,GAAG,IAAA,yCAAyB,EAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3E,CAAC;IAdD,IAAW,YAAY,KAAmB,OAAO,IAAI,CAAC,CAAC,CAAC;IAExD,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAYM,WAAW;QACd,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AC,EAAE,CAAC;SAC/D;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;;AA1jBL,kCA2jBC;AA1jB0B,oBAAQ,GAAG,QAAQ,CAAC;AACnB,iCAAqB,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ICreateBlobResponse, ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n createResponseError,\n generateHandleContextPath,\n responseToException,\n SummaryTreeBuilder,\n} from \"@fluidframework/runtime-utils\";\nimport { assert, bufferToString, Deferred, stringToBuffer, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { IContainerRuntime, IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { ChildLogger, loggerToMonitoringContext, MonitoringContext, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport {\n IGarbageCollectionData,\n ISummaryTreeWithStats,\n ITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { Throttler, formExponentialFn, IThrottler } from \"./throttler\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\nimport { throwOnTombstoneUsageKey } from \"./garbageCollectionConstants\";\nimport { sendGCTombstoneEvent } from \"./garbageCollectionTombstoneUtils\";\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 implements IFluidHandle<ArrayBufferLike> {\n private attached: boolean = false;\n\n public get IFluidHandle(): IFluidHandle { return this; }\n\n public get isAttached(): boolean {\n return this.attached;\n }\n\n public readonly absolutePath: string;\n\n constructor(\n public readonly path: string,\n public readonly routeContext: IFluidHandleContext,\n public get: () => Promise<any>,\n ) {\n this.absolutePath = generateHandleContextPath(path, this.routeContext);\n }\n\n public attachGraph() {\n this.attached = true;\n }\n\n public bind(handle: IFluidHandle) {\n throw new Error(\"Cannot bind to blob handle\");\n }\n}\n\nclass CancellableThrottler {\n constructor(private readonly throttler: IThrottler) { }\n private cancelP = new Deferred<void>();\n\n public async getDelay(): Promise<void> {\n return Promise.race([\n this.cancelP.promise,\n new Promise<void>((resolve) => setTimeout(resolve, this.throttler.getDelay())),\n ]);\n }\n\n public cancel() {\n this.cancelP.resolve();\n this.cancelP = new Deferred<void>();\n }\n}\n\n/**\n * Information from a snapshot needed to load BlobManager\n */\nexport interface IBlobManagerLoadInfo {\n ids?: string[];\n redirectTable?: [string, string][];\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 =\n Pick<IContainerRuntime, \"attachState\" | \"connected\" | \"logger\" | \"clientDetails\"> & TypedEventEmitter<IContainerRuntimeEvents>;\n\n// Note that while offline we \"submit\" an op before uploading the blob, but we always\n// expect blobs to be uploaded before we actually see the op round-trip\nenum PendingBlobStatus {\n OnlinePendingUpload,\n OnlinePendingOp,\n OfflinePendingUpload,\n OfflinePendingOp,\n}\n\ninterface PendingBlob {\n blob: ArrayBufferLike;\n status: PendingBlobStatus;\n storageId?: string;\n handleP: Deferred<IFluidHandle<ArrayBufferLike>>;\n uploadP: Promise<ICreateBlobResponse>;\n}\n\nexport interface IPendingBlobs { [id: string]: { blob: string; }; }\n\nexport interface IBlobManagerEvents {\n (event: \"noPendingBlobs\", listener: () => void);\n}\n\nexport class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {\n public static readonly basePath = \"_blobs\";\n private static readonly redirectTableBlobName = \".redirectTable\";\n private readonly mc: MonitoringContext;\n\n /**\n * Map of local IDs to storage IDs. Contains identity entries (id → id) for storage IDs. All requested IDs should\n * be a key in this map. Blobs created while the container is detached are stored in IDetachedBlobStorage which\n * gives local IDs; the storage IDs are filled in at attach time.\n * Note: It contains mappings from all clients, i.e., from remote clients as well. local ID comes from the client\n * that uploaded the blob but its mapping to storage ID is needed in all clients in order to retrieve the blob.\n */\n private readonly redirectTable: Map<string, string | undefined>;\n\n /**\n * Blobs which have not been uploaded or for which we have not yet seen a BlobAttach op round-trip.\n * Until we see the op round-trip, there is a possibility we may need to re-upload the blob, so\n * we must save it. This is true for both the online and offline flow.\n */\n private readonly pendingBlobs: Map<string, PendingBlob> = new Map();\n\n /**\n * Track ops in flight for online flow. This is used for optimizations where if we receive an ack for a storage ID,\n * we can resolve all pending blobs with the same storage ID even though they may have different local IDs. That's\n * because we know that the server will not delete the blob corresponding to that storage ID.\n */\n private readonly opsInFlight: Map<string, string[]> = new Map();\n\n private readonly retryThrottler = new CancellableThrottler(new Throttler(\n 60 * 1000, // 60 sec delay window\n 30 * 1000, // 30 sec max delay\n // throttling function increases exponentially (0ms, 40ms, 80ms, 160ms, etc)\n formExponentialFn({ coefficient: 20, initialDelay: 0 }),\n ));\n\n /** If true, throw an error when a tombstone attachment blob is retrieved. */\n private readonly throwOnTombstoneUsage: boolean;\n /**\n * This stores IDs of tombstoned blobs.\n * Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.\n */\n private readonly tombstonedBlobs: Set<string> = new Set();\n\n constructor(\n private readonly routeContext: IFluidHandleContext,\n snapshot: IBlobManagerLoadInfo,\n private readonly getStorage: () => IDocumentStorageService,\n /**\n * Submit a BlobAttach op. When a blob is uploaded, there is a short grace period before which the blob is\n * deleted. The BlobAttach op notifies the server that blob is in use. The server will then not delete the\n * the blob as long as it is listed as referenced in future summaries. The summarizing client will know to\n * include the storage ID in the summary when it sees the op.\n *\n * The op will also include a local ID to inform all clients of the relation to the storage ID, without\n * knowledge of which they cannot request the blob from storage. It's important that this op is sequenced\n * before any ops that reference the local ID, otherwise, an invalid handle could be added to the document.\n */\n private readonly sendBlobAttachOp: (localId: string, storageId?: string) => void,\n // To be called when a blob node is requested. blobPath is the path of the blob's node in GC's graph. It's\n // of the format `/<BlobManager.basePath>/<blobId>`.\n private readonly blobRequested: (blobPath: string) => void,\n private readonly addedBlobReference: (fromNodePath: string, toNodePath: string) => void,\n private readonly runtime: IBlobManagerRuntime,\n stashedBlobs: IPendingBlobs = {},\n ) {\n super();\n this.mc = loggerToMonitoringContext(ChildLogger.create(this.runtime.logger, \"BlobManager\"));\n // Read the feature flag that tells whether to throw when a tombstone blob is requested.\n this.throwOnTombstoneUsage =\n this.mc.config.getBoolean(throwOnTombstoneUsageKey) === true &&\n this.runtime.clientDetails.type !== summarizerClientType;\n\n this.runtime.on(\"disconnected\", () => this.onDisconnected());\n this.redirectTable = this.load(snapshot);\n\n // Begin uploading stashed blobs from previous container instance\n Object.entries(stashedBlobs).forEach(([localId, entry]) => {\n const blob = stringToBuffer(entry.blob, \"base64\");\n this.pendingBlobs.set(localId, {\n blob,\n status: PendingBlobStatus.OfflinePendingUpload,\n handleP: new Deferred(),\n uploadP: this.uploadBlob(localId, blob),\n });\n });\n }\n\n private get pendingOfflineUploads() {\n return Array.from(this.pendingBlobs.values())\n .filter((e) => e.status === PendingBlobStatus.OfflinePendingUpload);\n }\n\n public get hasPendingOfflineUploads(): boolean {\n return this.pendingOfflineUploads.length > 0;\n }\n\n public get hasPendingBlobs(): boolean {\n return (this.runtime.attachState !== AttachState.Attached && this.redirectTable.size > 0)\n || this.pendingBlobs.size > 0;\n }\n\n /**\n * Upload blobs added while offline. This must be completed before connecting and resubmitting ops.\n */\n public async onConnected() {\n this.retryThrottler.cancel();\n const pendingUploads = this.pendingOfflineUploads.map(async (e) => e.uploadP);\n await PerformanceEvent.timedExecAsync(this.mc.logger, {\n eventName: \"BlobUploadOnConnected\",\n count: pendingUploads.length,\n }, async () => Promise.all(pendingUploads),\n { start: true, end: true },\n );\n }\n\n /**\n * Transition online blobs waiting for BlobAttach op round-trip since we will not see the op until we are connected\n * again\n */\n private onDisconnected() {\n for (const [localId, entry] of this.pendingBlobs) {\n if (entry.status === PendingBlobStatus.OnlinePendingOp) {\n // This will submit another BlobAttach op for this blob. This is necessary because the one we sent\n // already didn't have the local ID.\n this.transitionToOffline(localId);\n }\n }\n }\n\n /**\n * For a blobId, returns its path in GC's graph. The node path is of the format `/<BlobManager.basePath>/<blobId>`\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 */\n private getBlobGCNodePath(blobId: string) {\n return `/${BlobManager.basePath}/${blobId}`;\n }\n\n /**\n * Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is\n * detached or there are no (non-pending) attachment blobs in the document\n */\n private get storageIds(): Set<string> {\n const ids = new Set<string | undefined>(this.redirectTable.values());\n\n // If we are detached, we will not have storage IDs, only undefined\n const undefinedValueInTable = ids.delete(undefined);\n\n // For a detached container, entries are inserted into the redirect table with an undefined storage ID.\n // For an attached container, entries are inserted w/storage ID after the BlobAttach op round-trips.\n assert(!undefinedValueInTable || this.runtime.attachState === AttachState.Detached && ids.size === 0,\n 0x382 /* 'redirectTable' must contain only undefined while detached / defined values while attached */);\n\n return ids as Set<string>;\n }\n\n public async getBlob(blobId: string): Promise<ArrayBufferLike> {\n const request = { url: blobId };\n if (this.tombstonedBlobs.has(blobId) ) {\n const error = responseToException(createResponseError(404, \"Blob removed by gc\", request), request);\n const event = {\n eventName: \"GC_Tombstone_Blob_Requested\",\n url: request.url,\n };\n sendGCTombstoneEvent(this.mc, event, this.runtime.clientDetails.type === summarizerClientType, [BlobManager.basePath], error);\n if (this.throwOnTombstoneUsage) {\n throw error;\n }\n }\n\n const pending = this.pendingBlobs.get(blobId);\n if (pending) {\n return pending.blob;\n }\n let storageId: string;\n if (this.runtime.attachState === AttachState.Detached) {\n assert(this.redirectTable.has(blobId), 0x383 /* requesting unknown blobs */);\n\n // Blobs created while the container is detached are stored in IDetachedBlobStorage.\n // The 'IDocumentStorageService.readBlob()' call below will retrieve these via localId.\n storageId = blobId;\n } else {\n const attachedStorageId = this.redirectTable.get(blobId);\n assert(!!attachedStorageId, 0x11f /* \"requesting unknown blobs\" */);\n storageId = attachedStorageId;\n }\n\n // Let runtime know that the corresponding GC node was requested.\n this.blobRequested(this.getBlobGCNodePath(blobId));\n\n return PerformanceEvent.timedExecAsync(\n this.mc.logger,\n { eventName: \"AttachmentReadBlob\", id: storageId },\n async () => {\n return this.getStorage().readBlob(storageId);\n },\n { end: true, cancel: \"error\" },\n );\n }\n\n private getBlobHandle(id: string): IFluidHandle<ArrayBufferLike> {\n assert(this.redirectTable.has(id) || this.pendingBlobs.has(id),\n 0x384 /* requesting handle for unknown blob */);\n return new BlobHandle(\n `${BlobManager.basePath}/${id}`,\n this.routeContext,\n async () => this.getBlob(id),\n );\n }\n\n private async createBlobDetached(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n // Blobs created while the container is detached are stored in IDetachedBlobStorage.\n // The 'IDocumentStorageService.createBlob()' call below will respond with a localId.\n const response = await this.getStorage().createBlob(blob);\n this.setRedirection(response.id, undefined);\n return this.getBlobHandle(response.id);\n }\n\n public async createBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n if (this.runtime.attachState === AttachState.Detached) {\n return this.createBlobDetached(blob);\n }\n if (this.runtime.attachState === AttachState.Attaching) {\n // blob upload is not supported in \"Attaching\" state\n this.mc.logger.sendTelemetryEvent({ eventName: \"CreateBlobWhileAttaching\" });\n await new Promise<void>((resolve) => this.runtime.once(\"attached\", resolve));\n }\n assert(this.runtime.attachState === AttachState.Attached,\n 0x385 /* For clarity and paranoid defense against adding future attachment states */);\n\n // Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to\n // storage ID mapping is created.\n const localId = uuid();\n const pendingEntry: PendingBlob = {\n blob,\n status: PendingBlobStatus.OnlinePendingUpload,\n handleP: new Deferred(),\n uploadP: this.uploadBlob(localId, blob),\n };\n this.pendingBlobs.set(localId, pendingEntry);\n\n return pendingEntry.handleP.promise;\n }\n\n private async uploadBlob(localId: string, blob: ArrayBufferLike): Promise<ICreateBlobResponse> {\n return PerformanceEvent.timedExecAsync(\n this.mc.logger,\n { eventName: \"createBlob\" },\n async () => this.getStorage().createBlob(blob),\n { end: true, cancel: this.runtime.connected ? \"error\" : \"generic\" },\n ).then(\n (response) => this.onUploadResolve(localId, response),\n async (err) => this.onUploadReject(localId, err),\n );\n }\n\n /**\n * Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added\n * which is required for GC.\n */\n private setRedirection(fromId: string, toId: string | undefined) {\n this.redirectTable.set(fromId, toId);\n // Notify runtime of a reference added if toId is not undefined. It can be undefined when a blob is uploaded in\n // detached mode. In this case, the entry will be updated when the blob is updated.\n if (toId !== undefined) {\n this.addedBlobReference(this.getBlobGCNodePath(fromId), this.getBlobGCNodePath(toId));\n }\n }\n\n private deleteAndEmitsIfEmpty(id: string) {\n if (this.pendingBlobs.has(id)) {\n this.pendingBlobs.delete(id);\n if (!this.hasPendingBlobs) {\n this.emit(\"noPendingBlobs\");\n }\n }\n }\n\n private onUploadResolve(localId: string, response: ICreateBlobResponse) {\n const entry = this.pendingBlobs.get(localId);\n assert(entry?.status === PendingBlobStatus.OnlinePendingUpload ||\n entry?.status === PendingBlobStatus.OfflinePendingUpload,\n 0x386 /* Must have pending blob entry for uploaded blob */);\n entry.storageId = response.id;\n if (this.runtime.connected) {\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n // Send a blob attach op. This serves two purposes:\n // 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 // until its storage ID is added to the next summary.\n // 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the\n // blob from the server via the storage ID.\n this.sendBlobAttachOp(localId, response.id);\n if (this.storageIds.has(response.id)) {\n // The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is\n // an existing blob, we don't have to wait for the op to be ack'd since this step has already\n // happened before and so, the server won't delete it.\n this.setRedirection(localId, response.id);\n entry.handleP.resolve(this.getBlobHandle(localId));\n this.deleteAndEmitsIfEmpty(localId);\n } else {\n // If there is already an op for this storage ID, append the local ID to the list. Once any op for\n // this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the\n // blob alive in storage.\n this.opsInFlight.set(response.id, (this.opsInFlight.get(response.id) ?? []).concat(localId));\n entry.status = PendingBlobStatus.OnlinePendingOp;\n }\n } else if (entry.status === PendingBlobStatus.OfflinePendingUpload) {\n // We already submitted a BlobAttach op for this blob when it was transitioned to offline flow\n entry.status = PendingBlobStatus.OfflinePendingOp;\n }\n } else {\n // connected to storage but not ordering service?\n this.mc.logger.sendTelemetryEvent({ eventName: \"BlobUploadSuccessWhileDisconnected\" });\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n this.transitionToOffline(localId);\n }\n entry.status = PendingBlobStatus.OfflinePendingOp;\n }\n return response;\n }\n\n private async onUploadReject(localId: string, error) {\n const entry = this.pendingBlobs.get(localId);\n assert(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);\n if (!this.runtime.connected) {\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n this.transitionToOffline(localId);\n }\n // we are probably not connected to storage but start another upload request in case we are\n entry.uploadP = this.retryThrottler.getDelay().then(async () => this.uploadBlob(localId, entry.blob));\n return entry.uploadP;\n } else {\n entry.handleP.reject(error);\n throw error;\n }\n }\n\n private transitionToOffline(localId: string) {\n assert(!this.runtime.connected, 0x388 /* Must only transition to offline flow while runtime is disconnected */);\n const entry = this.pendingBlobs.get(localId);\n assert(!!entry, 0x389 /* No pending blob entry */);\n assert([PendingBlobStatus.OnlinePendingUpload, PendingBlobStatus.OnlinePendingOp].includes(entry.status),\n 0x38a /* Blob must be in online flow to transition to offline flow */);\n\n /**\n * If we haven't already submitted a BlobAttach op for this entry, send it before returning the blob handle.\n * This will make sure that the BlobAttach op is sequenced prior to any ops referencing the handle. Otherwise,\n * an invalid handle could be added to the document.\n * storageId may be undefined but since we are not connected we will have a chance to add it when reSubmit()\n * is called on reconnection.\n */\n if (entry.status !== PendingBlobStatus.OnlinePendingOp) {\n this.sendBlobAttachOp(localId, entry.storageId);\n }\n\n entry.status = entry.status === PendingBlobStatus.OnlinePendingUpload\n ? PendingBlobStatus.OfflinePendingUpload\n : PendingBlobStatus.OfflinePendingOp;\n\n entry.handleP.resolve(this.getBlobHandle(localId));\n }\n\n /**\n * Resubmit a BlobAttach op. Used to add storage IDs to ops that were\n * submitted to runtime while disconnected.\n * @param metadata - op metadata containing storage and/or local IDs\n */\n public reSubmit(metadata: Record<string, unknown> | undefined) {\n assert(!!metadata, 0x38b /* Resubmitted ops must have metadata */);\n const { localId, blobId }: { localId?: string; blobId?: string } = metadata;\n assert(localId !== undefined, 0x50d /* local ID not available on reSubmit */);\n if (!blobId) {\n // We submitted this op while offline. The blob should have been uploaded by now.\n const pendingEntry = this.pendingBlobs.get(localId);\n assert(pendingEntry?.status === PendingBlobStatus.OfflinePendingOp &&\n !!pendingEntry?.storageId, 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);\n return this.sendBlobAttachOp(localId, pendingEntry.storageId);\n }\n return this.sendBlobAttachOp(localId, blobId);\n }\n\n public processBlobAttachOp(message: ISequencedDocumentMessage, local: boolean) {\n const localId = message.metadata?.localId;\n const blobId = message.metadata?.blobId;\n assert(blobId !== undefined, 0x12a /* \"Missing blob id on metadata\" */);\n\n // Set up a mapping from local ID to storage ID. This is crucial since without this the blob cannot be\n // requested from the server.\n // Note: The check for undefined is needed for back-compat when localId was not part of the BlobAttach op that\n // was sent when online.\n if (localId !== undefined) {\n this.setRedirection(localId, blobId);\n }\n // set identity (id -> id) entry\n this.setRedirection(blobId, blobId);\n\n if (local) {\n assert(localId !== undefined, 0x50e /* local ID not present in blob attach message */);\n const waitingBlobs = this.opsInFlight.get(blobId);\n if (waitingBlobs !== undefined) {\n // For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.\n // This is safe because the server will keep the blob alive and the op containing the local ID to\n // storage ID is already in flight and any op containing this local ID will be sequenced after that.\n waitingBlobs.forEach((pendingLocalId) => {\n const pendingBlobEntry = this.pendingBlobs.get(pendingLocalId);\n assert(\n pendingBlobEntry !== undefined,\n 0x38f, /* local online BlobAttach op with no pending blob entry */\n );\n\n // It's possible we transitioned to offline flow while waiting for this op.\n if (pendingBlobEntry.status === PendingBlobStatus.OnlinePendingOp) {\n this.setRedirection(pendingLocalId, blobId);\n pendingBlobEntry.handleP.resolve(this.getBlobHandle(pendingLocalId));\n this.deleteAndEmitsIfEmpty(pendingLocalId);\n }\n });\n this.opsInFlight.delete(blobId);\n }\n // For blobs that were transitioned to offline flow while waiting for this op, the entry should be deleted.\n this.deleteAndEmitsIfEmpty(localId);\n }\n }\n\n /**\n * Reads blobs needed to load BlobManager from storage.\n * @param blobsTree - Tree containing IDs of previously attached blobs. We\n * look for the IDs in the blob entries of the tree since the both the r11s\n * and SPO drivers replace the attachment types returned in snapshot() with blobs.\n */\n public static async load(\n blobsTree: ISnapshotTree | undefined,\n tryFetchBlob: (id: string) => Promise<[string, string][]>,\n ): Promise<IBlobManagerLoadInfo> {\n if (!blobsTree) {\n return {};\n }\n let redirectTable;\n const tableId = blobsTree.blobs[this.redirectTableBlobName];\n if (tableId) {\n redirectTable = await tryFetchBlob(tableId);\n }\n const ids = Object.entries(blobsTree.blobs)\n .filter(([k, _]) => k !== this.redirectTableBlobName).map(([_, v]) => v);\n return { ids, redirectTable };\n }\n\n /**\n * Load a set of previously attached blob IDs and redirect table from a previous snapshot.\n */\n private load(snapshot: IBlobManagerLoadInfo): Map<string, string | undefined> {\n this.mc.logger.sendTelemetryEvent({\n eventName: \"AttachmentBlobsLoaded\",\n count: snapshot.ids?.length ?? 0,\n redirectTable: snapshot.redirectTable?.length,\n });\n const table = new Map<string, string | undefined>(snapshot.redirectTable);\n if (snapshot.ids) {\n const detached = this.runtime.attachState === AttachState.Detached;\n // If we are detached, we don't have storage IDs yet, so set to undefined\n // Otherwise, set identity (id -> id) entries\n snapshot.ids.forEach((entry) => table.set(entry, detached ? undefined : entry));\n }\n return table;\n }\n\n /**\n * Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be\n * individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.\n * @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care\n * about this for now because the data is a simple list of blob ids.\n */\n public getGCData(fullGC: boolean = false): IGarbageCollectionData {\n const gcData: IGarbageCollectionData = { gcNodes: {} };\n for (const [localId, storageId] of this.redirectTable) {\n assert(!!storageId, 0x390 /* Must be attached to get GC data */);\n gcData.gcNodes[this.getBlobGCNodePath(localId)] = [this.getBlobGCNodePath(storageId)];\n }\n return gcData;\n }\n\n /**\n * This is called to update blobs whose routes are unused. The unused blobs are deleted.\n * @param unusedRoutes - The routes of the blob nodes that are unused.\n */\n public updateUnusedRoutes(unusedRoutes: string[]): void {\n // The routes or blob node paths are in the same format as returned in getGCData -\n // `/<BlobManager.basePath>/<blobId>`.\n for (const route of unusedRoutes) {\n const pathParts = route.split(\"/\");\n assert(\n pathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n 0x2d5 /* \"Invalid blob node id in unused routes.\" */,\n );\n const blobId = pathParts[2];\n this.redirectTable.delete(blobId);\n }\n }\n\n /**\n * This is called to update blobs whose routes are tombstones. Tombstoned blobs enable testing scenarios with\n * accessing deleted content without actually deleting content from summaries.\n * @param tombstonedRoutes - The routes of blob nodes that are tombstones.\n */\n public updateTombstonedRoutes(tombstonedRoutes: string[]) {\n const tombstonedBlobsSet: Set<string> = new Set();\n // The routes or blob node paths are in the same format as returned in getGCData -\n // `/<BlobManager.basePath>/<blobId>`.\n for (const route of tombstonedRoutes) {\n const pathParts = route.split(\"/\");\n assert(\n pathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n 0x50f /* Invalid blob node id in tombstoned routes. */,\n );\n tombstonedBlobsSet.add(pathParts[2]);\n }\n\n // Remove blobs from the tombstone list that were tombstoned but aren't anymore as per the tombstoneRoutes.\n for (const blobId of this.tombstonedBlobs) {\n if (!tombstonedBlobsSet.has(blobId)) {\n this.tombstonedBlobs.delete(blobId);\n }\n }\n\n // Mark blobs that are now tombstoned by adding them to the tombstone list.\n for (const blobId of tombstonedBlobsSet) {\n this.tombstonedBlobs.add(blobId);\n }\n }\n\n public summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n // if storageIds is empty, it means we are detached and have only local IDs, or that there are no blobs attached\n const blobIds = this.storageIds.size > 0 ? Array.from(this.storageIds) : Array.from(this.redirectTable.keys());\n const builder = new SummaryTreeBuilder();\n blobIds.forEach((blobId) => {\n builder.addAttachment(blobId);\n });\n\n // Any non-identity entries in the table need to be saved in the summary\n if (this.redirectTable.size > blobIds.length) {\n builder.addBlob(\n BlobManager.redirectTableBlobName,\n // filter out identity entries\n JSON.stringify(Array.from(this.redirectTable.entries())\n .filter(([localId, storageId]) => localId !== storageId)),\n );\n }\n\n return builder.getSummaryTree();\n }\n\n public setRedirectTable(table: Map<string, string>) {\n assert(this.runtime.attachState === AttachState.Detached,\n 0x252 /* \"redirect table can only be set in detached container\" */);\n assert(this.redirectTable.size === table.size,\n 0x391 /* Redirect table size must match BlobManager's local ID count */);\n for (const [localId, storageId] of table) {\n assert(this.redirectTable.has(localId), 0x254 /* \"unrecognized id in redirect table\" */);\n this.setRedirection(localId, storageId);\n // set identity (id -> id) entry\n this.setRedirection(storageId, storageId);\n }\n }\n\n public getPendingBlobs(): IPendingBlobs {\n const blobs = {};\n for (const [key, entry] of this.pendingBlobs) {\n blobs[key] = { blob: bufferToString(entry.blob, \"base64\") };\n }\n return blobs;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AAIlC,iEAKuC;AACvC,+DAAmH;AAEnH,iFAAoE;AACpE,qEAA8H;AAM9H,2CAAuE;AACvE,yEAAkE;AAClE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,QAAQ,EACpD,KAAK,CAAC,4DAA4D,CAAC,CAAC;QACxE,IAAA,qBAAM,EAAC,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EACzC,KAAK,CAAC,iEAAiE,CAAC,CAAC;QAC7E,KAAK,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,KAAK,EAAE;YACtC,IAAA,qBAAM,EAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,yCAAyC,CAAC,CAAC;YACzF,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YACxC,gCAAgC;YAChC,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;SAC7C;IACL,CAAC;IAEM,eAAe;QAClB,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE;YAC1C,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAA,6BAAc,EAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC;SAC/D;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;;AAjmBL,kCAkmBC;AAjmB0B,oBAAQ,GAAG,QAAQ,CAAC;AACnB,iCAAqB,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ICreateBlobResponse, ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n createResponseError,\n generateHandleContextPath,\n responseToException,\n SummaryTreeBuilder,\n} from \"@fluidframework/runtime-utils\";\nimport { assert, bufferToString, Deferred, stringToBuffer, TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { IContainerRuntime, IContainerRuntimeEvents } from \"@fluidframework/container-runtime-definitions\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { ChildLogger, loggerToMonitoringContext, MonitoringContext, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport {\n IGarbageCollectionData,\n ISummaryTreeWithStats,\n ITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { Throttler, formExponentialFn, IThrottler } from \"./throttler\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\nimport { throwOnTombstoneLoadKey } from \"./garbageCollectionConstants\";\nimport { sendGCTombstoneEvent } from \"./garbageCollectionTombstoneUtils\";\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 implements IFluidHandle<ArrayBufferLike> {\n private attached: boolean = false;\n\n public get IFluidHandle(): IFluidHandle { return this; }\n\n public get isAttached(): boolean {\n return this.attached;\n }\n\n public readonly absolutePath: string;\n\n constructor(\n public readonly path: string,\n public readonly routeContext: IFluidHandleContext,\n public get: () => Promise<any>,\n ) {\n this.absolutePath = generateHandleContextPath(path, this.routeContext);\n }\n\n public attachGraph() {\n this.attached = true;\n }\n\n public bind(handle: IFluidHandle) {\n throw new Error(\"Cannot bind to blob handle\");\n }\n}\n\nclass CancellableThrottler {\n constructor(private readonly throttler: IThrottler) { }\n private cancelP = new Deferred<void>();\n\n public async getDelay(): Promise<void> {\n return Promise.race([\n this.cancelP.promise,\n new Promise<void>((resolve) => setTimeout(resolve, this.throttler.getDelay())),\n ]);\n }\n\n public cancel() {\n this.cancelP.resolve();\n this.cancelP = new Deferred<void>();\n }\n}\n\n/**\n * Information from a snapshot needed to load BlobManager\n */\nexport interface IBlobManagerLoadInfo {\n ids?: string[];\n redirectTable?: [string, string][];\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 =\n Pick<IContainerRuntime, \"attachState\" | \"connected\" | \"logger\" | \"clientDetails\"> & TypedEventEmitter<IContainerRuntimeEvents>;\n\n// Note that while offline we \"submit\" an op before uploading the blob, but we always\n// expect blobs to be uploaded before we actually see the op round-trip\nenum PendingBlobStatus {\n OnlinePendingUpload,\n OnlinePendingOp,\n OfflinePendingUpload,\n OfflinePendingOp,\n}\n\ntype ICreateBlobResponseWithTTL = ICreateBlobResponse & Partial<Record<\"minTTLInSeconds\", number>>;\n\ninterface PendingBlob {\n blob: ArrayBufferLike;\n status: PendingBlobStatus;\n storageId?: string;\n handleP: Deferred<IFluidHandle<ArrayBufferLike>>;\n uploadP: Promise<ICreateBlobResponse>;\n localUploadTime?: number;\n serverUploadTime?: number;\n minTTLInSeconds?: number;\n}\n\nexport interface IPendingBlobs { [id: string]: { blob: string; }; }\n\nexport interface IBlobManagerEvents {\n (event: \"noPendingBlobs\", listener: () => void);\n}\n\nexport class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {\n public static readonly basePath = \"_blobs\";\n private static readonly redirectTableBlobName = \".redirectTable\";\n private readonly mc: MonitoringContext;\n\n /**\n * Map of local IDs to storage IDs. Contains identity entries (id → id) for storage IDs. All requested IDs should\n * be a key in this map. Blobs created while the container is detached are stored in IDetachedBlobStorage which\n * gives local IDs; the storage IDs are filled in at attach time.\n * Note: It contains mappings from all clients, i.e., from remote clients as well. local ID comes from the client\n * that uploaded the blob but its mapping to storage ID is needed in all clients in order to retrieve the blob.\n */\n private readonly redirectTable: Map<string, string | undefined>;\n\n /**\n * Blobs which have not been uploaded or for which we have not yet seen a BlobAttach op round-trip.\n * Until we see the op round-trip, there is a possibility we may need to re-upload the blob, so\n * we must save it. This is true for both the online and offline flow.\n */\n private readonly pendingBlobs: Map<string, PendingBlob> = new Map();\n\n /**\n * Track ops in flight for online flow. This is used for optimizations where if we receive an ack for a storage ID,\n * we can resolve all pending blobs with the same storage ID even though they may have different local IDs. That's\n * because we know that the server will not delete the blob corresponding to that storage ID.\n */\n private readonly opsInFlight: Map<string, string[]> = new Map();\n\n private readonly retryThrottler = new CancellableThrottler(new Throttler(\n 60 * 1000, // 60 sec delay window\n 30 * 1000, // 30 sec max delay\n // throttling function increases exponentially (0ms, 40ms, 80ms, 160ms, etc)\n formExponentialFn({ coefficient: 20, initialDelay: 0 }),\n ));\n\n /** If true, throw an error when a tombstone attachment blob is retrieved. */\n private readonly throwOnTombstoneLoad: boolean;\n /**\n * This stores IDs of tombstoned blobs.\n * Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.\n */\n private readonly tombstonedBlobs: Set<string> = new Set();\n\n constructor(\n private readonly routeContext: IFluidHandleContext,\n snapshot: IBlobManagerLoadInfo,\n private readonly getStorage: () => IDocumentStorageService,\n /**\n * Submit a BlobAttach op. When a blob is uploaded, there is a short grace period before which the blob is\n * deleted. The BlobAttach op notifies the server that blob is in use. The server will then not delete the\n * the blob as long as it is listed as referenced in future summaries. The summarizing client will know to\n * include the storage ID in the summary when it sees the op.\n *\n * The op will also include a local ID to inform all clients of the relation to the storage ID, without\n * knowledge of which they cannot request the blob from storage. It's important that this op is sequenced\n * before any ops that reference the local ID, otherwise, an invalid handle could be added to the document.\n */\n private readonly sendBlobAttachOp: (localId: string, storageId?: string) => void,\n // To be called when a blob node is requested. blobPath is the path of the blob's node in GC's graph. It's\n // of the format `/<BlobManager.basePath>/<blobId>`.\n private readonly blobRequested: (blobPath: string) => void,\n private readonly addedBlobReference: (fromNodePath: string, toNodePath: string) => void,\n private readonly runtime: IBlobManagerRuntime,\n stashedBlobs: IPendingBlobs = {},\n private readonly getCurrentReferenceTimestampMs: () => number | undefined,\n ) {\n super();\n this.mc = loggerToMonitoringContext(ChildLogger.create(this.runtime.logger, \"BlobManager\"));\n // Read the feature flag that tells whether to throw when a tombstone blob is requested.\n this.throwOnTombstoneLoad =\n this.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&\n this.runtime.clientDetails.type !== summarizerClientType;\n\n this.runtime.on(\"disconnected\", () => this.onDisconnected());\n this.redirectTable = this.load(snapshot);\n\n // Begin uploading stashed blobs from previous container instance\n Object.entries(stashedBlobs).forEach(([localId, entry]) => {\n const blob = stringToBuffer(entry.blob, \"base64\");\n this.pendingBlobs.set(localId, {\n blob,\n status: PendingBlobStatus.OfflinePendingUpload,\n handleP: new Deferred(),\n uploadP: this.uploadBlob(localId, blob),\n });\n });\n }\n\n private get pendingOfflineUploads() {\n return Array.from(this.pendingBlobs.values())\n .filter((e) => e.status === PendingBlobStatus.OfflinePendingUpload);\n }\n\n public get hasPendingOfflineUploads(): boolean {\n return this.pendingOfflineUploads.length > 0;\n }\n\n public get hasPendingBlobs(): boolean {\n return (this.runtime.attachState !== AttachState.Attached && this.redirectTable.size > 0)\n || this.pendingBlobs.size > 0;\n }\n\n /**\n * Upload blobs added while offline. This must be completed before connecting and resubmitting ops.\n */\n public async onConnected() {\n this.retryThrottler.cancel();\n const pendingUploads = this.pendingOfflineUploads.map(async (e) => e.uploadP);\n await PerformanceEvent.timedExecAsync(this.mc.logger, {\n eventName: \"BlobUploadOnConnected\",\n count: pendingUploads.length,\n }, async () => Promise.all(pendingUploads),\n { start: true, end: true },\n );\n }\n\n /**\n * Transition online blobs waiting for BlobAttach op round-trip since we will not see the op until we are connected\n * again\n */\n private onDisconnected() {\n for (const [localId, entry] of this.pendingBlobs) {\n if (entry.status === PendingBlobStatus.OnlinePendingOp) {\n // This will submit another BlobAttach op for this blob. This is necessary because the one we sent\n // already didn't have the local ID.\n this.transitionToOffline(localId);\n }\n }\n }\n\n /**\n * For a blobId, returns its path in GC's graph. The node path is of the format `/<BlobManager.basePath>/<blobId>`\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 */\n private getBlobGCNodePath(blobId: string) {\n return `/${BlobManager.basePath}/${blobId}`;\n }\n\n /**\n * Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is\n * detached or there are no (non-pending) attachment blobs in the document\n */\n private get storageIds(): Set<string> {\n const ids = new Set<string | undefined>(this.redirectTable.values());\n\n // If we are detached, we will not have storage IDs, only undefined\n const undefinedValueInTable = ids.delete(undefined);\n\n // For a detached container, entries are inserted into the redirect table with an undefined storage ID.\n // For an attached container, entries are inserted w/storage ID after the BlobAttach op round-trips.\n assert(!undefinedValueInTable || this.runtime.attachState === AttachState.Detached && ids.size === 0,\n 0x382 /* 'redirectTable' must contain only undefined while detached / defined values while attached */);\n\n return ids as Set<string>;\n }\n\n public async getBlob(blobId: string): Promise<ArrayBufferLike> {\n const request = { url: blobId };\n if (this.tombstonedBlobs.has(blobId) ) {\n const error = responseToException(createResponseError(404, \"Blob was deleted\", request), request);\n sendGCTombstoneEvent(\n this.mc,\n {\n eventName: \"GC_Tombstone_Blob_Requested\",\n category: this.throwOnTombstoneLoad ? \"error\" : \"generic\",\n isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,\n },\n [BlobManager.basePath],\n error,\n );\n if (this.throwOnTombstoneLoad) {\n throw error;\n }\n }\n\n const pending = this.pendingBlobs.get(blobId);\n if (pending) {\n return pending.blob;\n }\n let storageId: string;\n if (this.runtime.attachState === AttachState.Detached) {\n assert(this.redirectTable.has(blobId), 0x383 /* requesting unknown blobs */);\n\n // Blobs created while the container is detached are stored in IDetachedBlobStorage.\n // The 'IDocumentStorageService.readBlob()' call below will retrieve these via localId.\n storageId = blobId;\n } else {\n const attachedStorageId = this.redirectTable.get(blobId);\n assert(!!attachedStorageId, 0x11f /* \"requesting unknown blobs\" */);\n storageId = attachedStorageId;\n }\n\n // Let runtime know that the corresponding GC node was requested.\n this.blobRequested(this.getBlobGCNodePath(blobId));\n\n return PerformanceEvent.timedExecAsync(\n this.mc.logger,\n { eventName: \"AttachmentReadBlob\", id: storageId },\n async () => {\n return this.getStorage().readBlob(storageId);\n },\n { end: true, cancel: \"error\" },\n );\n }\n\n private getBlobHandle(id: string): IFluidHandle<ArrayBufferLike> {\n assert(this.redirectTable.has(id) || this.pendingBlobs.has(id),\n 0x384 /* requesting handle for unknown blob */);\n return new BlobHandle(\n `${BlobManager.basePath}/${id}`,\n this.routeContext,\n async () => this.getBlob(id),\n );\n }\n\n private async createBlobDetached(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n // Blobs created while the container is detached are stored in IDetachedBlobStorage.\n // The 'IDocumentStorageService.createBlob()' call below will respond with a localId.\n const response = await this.getStorage().createBlob(blob);\n this.setRedirection(response.id, undefined);\n return this.getBlobHandle(response.id);\n }\n\n public async createBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n if (this.runtime.attachState === AttachState.Detached) {\n return this.createBlobDetached(blob);\n }\n if (this.runtime.attachState === AttachState.Attaching) {\n // blob upload is not supported in \"Attaching\" state\n this.mc.logger.sendTelemetryEvent({ eventName: \"CreateBlobWhileAttaching\" });\n await new Promise<void>((resolve) => this.runtime.once(\"attached\", resolve));\n }\n assert(this.runtime.attachState === AttachState.Attached,\n 0x385 /* For clarity and paranoid defense against adding future attachment states */);\n\n // Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to\n // storage ID mapping is created.\n const localId = uuid();\n const pendingEntry: PendingBlob = {\n blob,\n status: PendingBlobStatus.OnlinePendingUpload,\n handleP: new Deferred(),\n uploadP: this.uploadBlob(localId, blob),\n };\n this.pendingBlobs.set(localId, pendingEntry);\n\n return pendingEntry.handleP.promise;\n }\n\n private async uploadBlob(localId: string, blob: ArrayBufferLike): Promise<ICreateBlobResponse> {\n return PerformanceEvent.timedExecAsync(\n this.mc.logger,\n { eventName: \"createBlob\" },\n async () => this.getStorage().createBlob(blob),\n { end: true, cancel: this.runtime.connected ? \"error\" : \"generic\" },\n ).then(\n (response) => this.onUploadResolve(localId, response),\n async (err) => this.onUploadReject(localId, err),\n );\n }\n\n /**\n * Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added\n * which is required for GC.\n */\n private setRedirection(fromId: string, toId: string | undefined) {\n this.redirectTable.set(fromId, toId);\n // Notify runtime of a reference added if toId is not undefined. It can be undefined when a blob is uploaded in\n // detached mode. In this case, the entry will be updated when the blob is updated.\n if (toId !== undefined) {\n this.addedBlobReference(this.getBlobGCNodePath(fromId), this.getBlobGCNodePath(toId));\n }\n }\n\n private deleteAndEmitsIfEmpty(id: string) {\n if (this.pendingBlobs.has(id)) {\n this.pendingBlobs.delete(id);\n if (!this.hasPendingBlobs) {\n this.emit(\"noPendingBlobs\");\n }\n }\n }\n\n private onUploadResolve(localId: string, response: ICreateBlobResponseWithTTL) {\n const entry = this.pendingBlobs.get(localId);\n assert(entry?.status === PendingBlobStatus.OnlinePendingUpload ||\n entry?.status === PendingBlobStatus.OfflinePendingUpload,\n 0x386 /* Must have pending blob entry for uploaded blob */);\n entry.storageId = response.id;\n entry.localUploadTime = Date.now();\n entry.minTTLInSeconds = response.minTTLInSeconds;\n entry.serverUploadTime = this.getCurrentReferenceTimestampMs();\n if (this.runtime.connected) {\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n // Send a blob attach op. This serves two purposes:\n // 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 // until its storage ID is added to the next summary.\n // 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the\n // blob from the server via the storage ID.\n this.logTimeInfo(entry, \"sendBlobAttachResolveTTL\");\n this.sendBlobAttachOp(localId, response.id);\n if (this.storageIds.has(response.id)) {\n // The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is\n // an existing blob, we don't have to wait for the op to be ack'd since this step has already\n // happened before and so, the server won't delete it.\n this.setRedirection(localId, response.id);\n entry.handleP.resolve(this.getBlobHandle(localId));\n this.deleteAndEmitsIfEmpty(localId);\n } else {\n // If there is already an op for this storage ID, append the local ID to the list. Once any op for\n // this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the\n // blob alive in storage.\n this.opsInFlight.set(response.id, (this.opsInFlight.get(response.id) ?? []).concat(localId));\n entry.status = PendingBlobStatus.OnlinePendingOp;\n }\n } else if (entry.status === PendingBlobStatus.OfflinePendingUpload) {\n // We already submitted a BlobAttach op for this blob when it was transitioned to offline flow\n entry.status = PendingBlobStatus.OfflinePendingOp;\n }\n } else {\n // connected to storage but not ordering service?\n this.mc.logger.sendTelemetryEvent({ eventName: \"BlobUploadSuccessWhileDisconnected\" });\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n this.transitionToOffline(localId);\n }\n entry.status = PendingBlobStatus.OfflinePendingOp;\n }\n return response;\n }\n\n private async onUploadReject(localId: string, error) {\n const entry = this.pendingBlobs.get(localId);\n assert(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);\n if (!this.runtime.connected) {\n if (entry.status === PendingBlobStatus.OnlinePendingUpload) {\n this.transitionToOffline(localId);\n }\n // we are probably not connected to storage but start another upload request in case we are\n entry.uploadP = this.retryThrottler.getDelay().then(async () => this.uploadBlob(localId, entry.blob));\n return entry.uploadP;\n } else {\n entry.handleP.reject(error);\n throw error;\n }\n }\n\n private transitionToOffline(localId: string) {\n assert(!this.runtime.connected, 0x388 /* Must only transition to offline flow while runtime is disconnected */);\n const entry = this.pendingBlobs.get(localId);\n assert(!!entry, 0x389 /* No pending blob entry */);\n assert([PendingBlobStatus.OnlinePendingUpload, PendingBlobStatus.OnlinePendingOp].includes(entry.status),\n 0x38a /* Blob must be in online flow to transition to offline flow */);\n\n /**\n * If we haven't already submitted a BlobAttach op for this entry, send it before returning the blob handle.\n * This will make sure that the BlobAttach op is sequenced prior to any ops referencing the handle. Otherwise,\n * an invalid handle could be added to the document.\n * storageId may be undefined but since we are not connected we will have a chance to add it when reSubmit()\n * is called on reconnection.\n */\n if (entry.status !== PendingBlobStatus.OnlinePendingOp) {\n this.logTimeInfo(entry, \"sendBlobAttachTransitionOfflineTTL\");\n this.sendBlobAttachOp(localId, entry.storageId);\n }\n\n entry.status = entry.status === PendingBlobStatus.OnlinePendingUpload\n ? PendingBlobStatus.OfflinePendingUpload\n : PendingBlobStatus.OfflinePendingOp;\n\n entry.handleP.resolve(this.getBlobHandle(localId));\n }\n\n /**\n * Resubmit a BlobAttach op. Used to add storage IDs to ops that were\n * submitted to runtime while disconnected.\n * @param metadata - op metadata containing storage and/or local IDs\n */\n public reSubmit(metadata: Record<string, unknown> | undefined) {\n assert(!!metadata, 0x38b /* Resubmitted ops must have metadata */);\n const { localId, blobId }: { localId?: string; blobId?: string } = metadata;\n assert(localId !== undefined, 0x50d /* local ID not available on reSubmit */);\n const pendingEntry = this.pendingBlobs.get(localId);\n if (pendingEntry) {\n this.logTimeInfo(pendingEntry, \"sendBlobAttachResubmitTTL\");\n }\n if (!blobId) {\n // We submitted this op while offline. The blob should have been uploaded by now.\n assert(pendingEntry?.status === PendingBlobStatus.OfflinePendingOp &&\n !!pendingEntry?.storageId, 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);\n return this.sendBlobAttachOp(localId, pendingEntry.storageId);\n }\n return this.sendBlobAttachOp(localId, blobId);\n }\n\n private logTimeInfo(pendingEntry: PendingBlob, eventName: string) {\n let timeLapseSinceLocalUpload: number = 0;\n let timeLapseSinceServerUpload: number = 0;\n let expiredUsingLocalTime;\n let expiredUsingServerTime;\n if(pendingEntry.localUploadTime){\n timeLapseSinceLocalUpload = (Date.now() - pendingEntry.localUploadTime) / 1000;\n expiredUsingLocalTime = (pendingEntry.minTTLInSeconds?? 0) - timeLapseSinceLocalUpload < 0 ? true : false;\n }\n if(pendingEntry.serverUploadTime){\n timeLapseSinceServerUpload = (Date.now() - pendingEntry.serverUploadTime) / 1000;\n expiredUsingServerTime = (pendingEntry.minTTLInSeconds?? 0) - timeLapseSinceServerUpload < 0 ? true : false;\n }\n this.mc.logger.sendTelemetryEvent({\n eventName,\n entryStatus: pendingEntry.status,\n timeLapseSinceLocalUpload,\n timeLapseSinceServerUpload,\n minTTLInSeconds: pendingEntry.minTTLInSeconds,\n expiredUsingLocalTime,\n expiredUsingServerTime,\n });\n\n }\n\n public processBlobAttachOp(message: ISequencedDocumentMessage, local: boolean) {\n const localId = message.metadata?.localId;\n const blobId = message.metadata?.blobId;\n assert(blobId !== undefined, 0x12a /* \"Missing blob id on metadata\" */);\n\n // Set up a mapping from local ID to storage ID. This is crucial since without this the blob cannot be\n // requested from the server.\n // Note: The check for undefined is needed for back-compat when localId was not part of the BlobAttach op that\n // was sent when online.\n if (localId !== undefined) {\n this.setRedirection(localId, blobId);\n }\n // set identity (id -> id) entry\n this.setRedirection(blobId, blobId);\n\n if (local) {\n assert(localId !== undefined, 0x50e /* local ID not present in blob attach message */);\n const waitingBlobs = this.opsInFlight.get(blobId);\n if (waitingBlobs !== undefined) {\n // For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.\n // This is safe because the server will keep the blob alive and the op containing the local ID to\n // storage ID is already in flight and any op containing this local ID will be sequenced after that.\n waitingBlobs.forEach((pendingLocalId) => {\n const pendingBlobEntry = this.pendingBlobs.get(pendingLocalId);\n assert(\n pendingBlobEntry !== undefined,\n 0x38f, /* local online BlobAttach op with no pending blob entry */\n );\n\n // It's possible we transitioned to offline flow while waiting for this op.\n if (pendingBlobEntry.status === PendingBlobStatus.OnlinePendingOp) {\n this.setRedirection(pendingLocalId, blobId);\n pendingBlobEntry.handleP.resolve(this.getBlobHandle(pendingLocalId));\n this.deleteAndEmitsIfEmpty(pendingLocalId);\n }\n });\n this.opsInFlight.delete(blobId);\n }\n // For blobs that were transitioned to offline flow while waiting for this op, the entry should be deleted.\n this.deleteAndEmitsIfEmpty(localId);\n }\n }\n\n /**\n * Reads blobs needed to load BlobManager from storage.\n * @param blobsTree - Tree containing IDs of previously attached blobs. We\n * look for the IDs in the blob entries of the tree since the both the r11s\n * and SPO drivers replace the attachment types returned in snapshot() with blobs.\n */\n public static async load(\n blobsTree: ISnapshotTree | undefined,\n tryFetchBlob: (id: string) => Promise<[string, string][]>,\n ): Promise<IBlobManagerLoadInfo> {\n if (!blobsTree) {\n return {};\n }\n let redirectTable;\n const tableId = blobsTree.blobs[this.redirectTableBlobName];\n if (tableId) {\n redirectTable = await tryFetchBlob(tableId);\n }\n const ids = Object.entries(blobsTree.blobs)\n .filter(([k, _]) => k !== this.redirectTableBlobName).map(([_, v]) => v);\n return { ids, redirectTable };\n }\n\n /**\n * Load a set of previously attached blob IDs and redirect table from a previous snapshot.\n */\n private load(snapshot: IBlobManagerLoadInfo): Map<string, string | undefined> {\n this.mc.logger.sendTelemetryEvent({\n eventName: \"AttachmentBlobsLoaded\",\n count: snapshot.ids?.length ?? 0,\n redirectTable: snapshot.redirectTable?.length,\n });\n const table = new Map<string, string | undefined>(snapshot.redirectTable);\n if (snapshot.ids) {\n const detached = this.runtime.attachState === AttachState.Detached;\n // If we are detached, we don't have storage IDs yet, so set to undefined\n // Otherwise, set identity (id -> id) entries\n snapshot.ids.forEach((entry) => table.set(entry, detached ? undefined : entry));\n }\n return table;\n }\n\n /**\n * Generates data used for garbage collection. Each blob uploaded represents a node in the GC graph as it can be\n * individually referenced by storing its handle in a referenced DDS. Returns the list of blob ids as GC nodes.\n * @param fullGC - true to bypass optimizations and force full generation of GC data. BlobManager doesn't care\n * about this for now because the data is a simple list of blob ids.\n */\n public getGCData(fullGC: boolean = false): IGarbageCollectionData {\n const gcData: IGarbageCollectionData = { gcNodes: {} };\n for (const [localId, storageId] of this.redirectTable) {\n assert(!!storageId, 0x390 /* Must be attached to get GC data */);\n gcData.gcNodes[this.getBlobGCNodePath(localId)] = [this.getBlobGCNodePath(storageId)];\n }\n return gcData;\n }\n\n /**\n * This is called to update blobs whose routes are unused. The unused blobs are deleted.\n * @param unusedRoutes - The routes of the blob nodes that are unused.\n */\n public updateUnusedRoutes(unusedRoutes: string[]): void {\n // The routes or blob node paths are in the same format as returned in getGCData -\n // `/<BlobManager.basePath>/<blobId>`.\n for (const route of unusedRoutes) {\n const pathParts = route.split(\"/\");\n assert(\n pathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n 0x2d5 /* \"Invalid blob node id in unused routes.\" */,\n );\n const blobId = pathParts[2];\n this.redirectTable.delete(blobId);\n }\n }\n\n /**\n * This is called to update blobs whose routes are tombstones. Tombstoned blobs enable testing scenarios with\n * accessing deleted content without actually deleting content from summaries.\n * @param tombstonedRoutes - The routes of blob nodes that are tombstones.\n */\n public updateTombstonedRoutes(tombstonedRoutes: string[]) {\n const tombstonedBlobsSet: Set<string> = new Set();\n // The routes or blob node paths are in the same format as returned in getGCData -\n // `/<BlobManager.basePath>/<blobId>`.\n for (const route of tombstonedRoutes) {\n const pathParts = route.split(\"/\");\n assert(\n pathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n 0x50f /* Invalid blob node id in tombstoned routes. */,\n );\n tombstonedBlobsSet.add(pathParts[2]);\n }\n\n // Remove blobs from the tombstone list that were tombstoned but aren't anymore as per the tombstoneRoutes.\n for (const blobId of this.tombstonedBlobs) {\n if (!tombstonedBlobsSet.has(blobId)) {\n this.tombstonedBlobs.delete(blobId);\n }\n }\n\n // Mark blobs that are now tombstoned by adding them to the tombstone list.\n for (const blobId of tombstonedBlobsSet) {\n this.tombstonedBlobs.add(blobId);\n }\n }\n\n public summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n // if storageIds is empty, it means we are detached and have only local IDs, or that there are no blobs attached\n const blobIds = this.storageIds.size > 0 ? Array.from(this.storageIds) : Array.from(this.redirectTable.keys());\n const builder = new SummaryTreeBuilder();\n blobIds.forEach((blobId) => {\n builder.addAttachment(blobId);\n });\n\n // Any non-identity entries in the table need to be saved in the summary\n if (this.redirectTable.size > blobIds.length) {\n builder.addBlob(\n BlobManager.redirectTableBlobName,\n // filter out identity entries\n JSON.stringify(Array.from(this.redirectTable.entries())\n .filter(([localId, storageId]) => localId !== storageId)),\n );\n }\n\n return builder.getSummaryTree();\n }\n\n public setRedirectTable(table: Map<string, string>) {\n assert(this.runtime.attachState === AttachState.Detached,\n 0x252 /* \"redirect table can only be set in detached container\" */);\n assert(this.redirectTable.size === table.size,\n 0x391 /* Redirect table size must match BlobManager's local ID count */);\n for (const [localId, storageId] of table) {\n assert(this.redirectTable.has(localId), 0x254 /* \"unrecognized id in redirect table\" */);\n this.setRedirection(localId, storageId);\n // set identity (id -> id) entry\n this.setRedirection(storageId, storageId);\n }\n }\n\n public getPendingBlobs(): IPendingBlobs {\n const blobs = {};\n for (const [key, entry] of this.pendingBlobs) {\n blobs[key] = { blob: bufferToString(entry.blob, \"base64\") };\n }\n return blobs;\n }\n}\n"]}
|
|
@@ -296,6 +296,21 @@ export declare enum RuntimeHeaders {
|
|
|
296
296
|
/** True if the request is coming from an IFluidHandle. */
|
|
297
297
|
viaHandle = "viaHandle"
|
|
298
298
|
}
|
|
299
|
+
/** True if a tombstoned object should be returned without erroring */
|
|
300
|
+
export declare const AllowTombstoneRequestHeaderKey = "allowTombstone";
|
|
301
|
+
/** Tombstone error responses will have this header set to true */
|
|
302
|
+
export declare const TombstoneResponseHeaderKey = "isTombstoned";
|
|
303
|
+
/**
|
|
304
|
+
* The full set of parsed header data that may be found on Runtime requests
|
|
305
|
+
*/
|
|
306
|
+
export interface RuntimeHeaderData {
|
|
307
|
+
wait?: boolean;
|
|
308
|
+
externalRequest?: boolean;
|
|
309
|
+
viaHandle?: boolean;
|
|
310
|
+
allowTombstone?: boolean;
|
|
311
|
+
}
|
|
312
|
+
/** Default values for Runtime Headers */
|
|
313
|
+
export declare const defaultRuntimeHeaderData: Required<RuntimeHeaderData>;
|
|
299
314
|
/**
|
|
300
315
|
* Available compression algorithms for op compression.
|
|
301
316
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAgD,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EAC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exports.agentSchedulerId = exports.isRuntimeMessage = exports.RuntimeMessage = exports.CompressionAlgorithms = exports.RuntimeHeaders = exports.DefaultSummaryConfiguration = exports.ContainerMessageType = void 0;
|
|
3
|
+
exports.ContainerRuntime = exports.getDeviceSpec = exports.agentSchedulerId = exports.isRuntimeMessage = exports.RuntimeMessage = exports.CompressionAlgorithms = exports.defaultRuntimeHeaderData = exports.TombstoneResponseHeaderKey = exports.AllowTombstoneRequestHeaderKey = exports.RuntimeHeaders = exports.DefaultSummaryConfiguration = exports.ContainerMessageType = void 0;
|
|
4
4
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
5
5
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
6
6
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
@@ -78,6 +78,17 @@ var RuntimeHeaders;
|
|
|
78
78
|
/** True if the request is coming from an IFluidHandle. */
|
|
79
79
|
RuntimeHeaders["viaHandle"] = "viaHandle";
|
|
80
80
|
})(RuntimeHeaders = exports.RuntimeHeaders || (exports.RuntimeHeaders = {}));
|
|
81
|
+
/** True if a tombstoned object should be returned without erroring */
|
|
82
|
+
exports.AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
|
|
83
|
+
/** Tombstone error responses will have this header set to true */
|
|
84
|
+
exports.TombstoneResponseHeaderKey = "isTombstoned";
|
|
85
|
+
/** Default values for Runtime Headers */
|
|
86
|
+
exports.defaultRuntimeHeaderData = {
|
|
87
|
+
wait: true,
|
|
88
|
+
externalRequest: false,
|
|
89
|
+
viaHandle: false,
|
|
90
|
+
allowTombstone: false,
|
|
91
|
+
};
|
|
81
92
|
/**
|
|
82
93
|
* Available compression algorithms for op compression.
|
|
83
94
|
*/
|
|
@@ -289,7 +300,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
289
300
|
if (!this.disposed) {
|
|
290
301
|
this.submit(ContainerMessageType.BlobAttach, undefined, undefined, { localId, blobId });
|
|
291
302
|
}
|
|
292
|
-
}, (blobPath) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"), (fromPath, toPath) => this.garbageCollector.addedOutboundReference(fromPath, toPath), this, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pendingAttachmentBlobs);
|
|
303
|
+
}, (blobPath) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"), (fromPath, toPath) => this.garbageCollector.addedOutboundReference(fromPath, toPath), this, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pendingAttachmentBlobs, () => this.getCurrentReferenceTimestampMs());
|
|
293
304
|
this.scheduleManager = new scheduleManager_1.ScheduleManager(context.deltaManager, this, () => this.clientId, telemetry_utils_1.ChildLogger.create(this.logger, "ScheduleManager"));
|
|
294
305
|
this.pendingStateManager = new pendingStateManager_1.PendingStateManager({
|
|
295
306
|
applyStashedOp: this.applyStashedOp.bind(this),
|
|
@@ -463,7 +474,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
463
474
|
logger.sendErrorEvent({ eventName: "SequenceNumberMismatch" }, error);
|
|
464
475
|
}
|
|
465
476
|
else {
|
|
466
|
-
// Call both close and dispose as
|
|
477
|
+
// Call both close and dispose as closeFn implementation will no longer dispose runtime in future
|
|
467
478
|
context.closeFn(error);
|
|
468
479
|
(_d = context.disposeFn) === null || _d === void 0 ? void 0 : _d.call(context, error);
|
|
469
480
|
}
|
|
@@ -705,16 +716,20 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
705
716
|
return (_a = this.dataStores.aliases.get(maybeAlias)) !== null && _a !== void 0 ? _a : maybeAlias;
|
|
706
717
|
}
|
|
707
718
|
async getDataStoreFromRequest(id, request) {
|
|
708
|
-
var _a, _b, _c, _d
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
719
|
+
var _a, _b, _c, _d;
|
|
720
|
+
const headerData = {};
|
|
721
|
+
if (typeof ((_a = request.headers) === null || _a === void 0 ? void 0 : _a[RuntimeHeaders.wait]) === "boolean") {
|
|
722
|
+
headerData.wait = request.headers[RuntimeHeaders.wait];
|
|
723
|
+
}
|
|
724
|
+
if (typeof ((_b = request.headers) === null || _b === void 0 ? void 0 : _b[RuntimeHeaders.viaHandle]) === "boolean") {
|
|
725
|
+
headerData.viaHandle = request.headers[RuntimeHeaders.viaHandle];
|
|
726
|
+
}
|
|
727
|
+
if (typeof ((_c = request.headers) === null || _c === void 0 ? void 0 : _c[exports.AllowTombstoneRequestHeaderKey]) === "boolean") {
|
|
728
|
+
headerData.allowTombstone = request.headers[exports.AllowTombstoneRequestHeaderKey];
|
|
729
|
+
}
|
|
715
730
|
await this.dataStores.waitIfPendingAlias(id);
|
|
716
731
|
const internalId = this.internalId(id);
|
|
717
|
-
const dataStoreContext = await this.dataStores.getDataStore(internalId,
|
|
732
|
+
const dataStoreContext = await this.dataStores.getDataStore(internalId, headerData);
|
|
718
733
|
/**
|
|
719
734
|
* If GC should run and this an external app request with "externalRequest" header, we need to return
|
|
720
735
|
* an error if the data store being requested is marked as unreferenced as per the data store's base
|
|
@@ -723,7 +738,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
723
738
|
* This is a workaround to handle scenarios where a data store shared with an external app is deleted
|
|
724
739
|
* and marked as unreferenced by GC. Returning an error will fail to load the data store for the app.
|
|
725
740
|
*/
|
|
726
|
-
if (((
|
|
741
|
+
if (((_d = request.headers) === null || _d === void 0 ? void 0 : _d[RuntimeHeaders.externalRequest]) && this.garbageCollector.shouldRunGC) {
|
|
727
742
|
// The data store is referenced if used routes in the base summary has a route to self.
|
|
728
743
|
// Older documents may not have used routes in the summary. They are considered referenced.
|
|
729
744
|
const usedRoutes = (await dataStoreContext.getBaseGCDetails()).usedRoutes;
|
|
@@ -1033,7 +1048,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1033
1048
|
async getRootDataStoreChannel(id, wait = true) {
|
|
1034
1049
|
await this.dataStores.waitIfPendingAlias(id);
|
|
1035
1050
|
const internalId = this.internalId(id);
|
|
1036
|
-
const context = await this.dataStores.getDataStore(internalId, wait
|
|
1051
|
+
const context = await this.dataStores.getDataStore(internalId, { wait });
|
|
1037
1052
|
(0, common_utils_1.assert)(await context.isRoot(), 0x12b /* "did not get root data store" */);
|
|
1038
1053
|
return context.realize();
|
|
1039
1054
|
}
|