@fluidframework/container-runtime 2.33.2 → 2.40.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/api-report/container-runtime.legacy.alpha.api.md +4 -0
  3. package/container-runtime.test-files.tar +0 -0
  4. package/dist/blobManager/blobManager.d.ts +31 -8
  5. package/dist/blobManager/blobManager.d.ts.map +1 -1
  6. package/dist/blobManager/blobManager.js +90 -17
  7. package/dist/blobManager/blobManager.js.map +1 -1
  8. package/dist/channelCollection.d.ts +26 -10
  9. package/dist/channelCollection.d.ts.map +1 -1
  10. package/dist/channelCollection.js +42 -11
  11. package/dist/channelCollection.js.map +1 -1
  12. package/dist/compatUtils.d.ts +19 -10
  13. package/dist/compatUtils.d.ts.map +1 -1
  14. package/dist/compatUtils.js +39 -32
  15. package/dist/compatUtils.js.map +1 -1
  16. package/dist/containerRuntime.d.ts +29 -13
  17. package/dist/containerRuntime.d.ts.map +1 -1
  18. package/dist/containerRuntime.js +139 -149
  19. package/dist/containerRuntime.js.map +1 -1
  20. package/dist/dataStoreContext.d.ts +15 -16
  21. package/dist/dataStoreContext.d.ts.map +1 -1
  22. package/dist/dataStoreContext.js +37 -19
  23. package/dist/dataStoreContext.js.map +1 -1
  24. package/dist/index.d.ts +1 -3
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -9
  27. package/dist/index.js.map +1 -1
  28. package/dist/legacy.d.ts +1 -0
  29. package/dist/opLifecycle/index.d.ts +1 -1
  30. package/dist/opLifecycle/index.d.ts.map +1 -1
  31. package/dist/opLifecycle/index.js.map +1 -1
  32. package/dist/opLifecycle/outbox.d.ts +20 -7
  33. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  34. package/dist/opLifecycle/outbox.js +16 -20
  35. package/dist/opLifecycle/outbox.js.map +1 -1
  36. package/dist/packageVersion.d.ts +1 -1
  37. package/dist/packageVersion.js +1 -1
  38. package/dist/packageVersion.js.map +1 -1
  39. package/dist/pendingStateManager.d.ts +22 -8
  40. package/dist/pendingStateManager.d.ts.map +1 -1
  41. package/dist/pendingStateManager.js +11 -16
  42. package/dist/pendingStateManager.js.map +1 -1
  43. package/lib/blobManager/blobManager.d.ts +31 -8
  44. package/lib/blobManager/blobManager.d.ts.map +1 -1
  45. package/lib/blobManager/blobManager.js +91 -18
  46. package/lib/blobManager/blobManager.js.map +1 -1
  47. package/lib/channelCollection.d.ts +26 -10
  48. package/lib/channelCollection.d.ts.map +1 -1
  49. package/lib/channelCollection.js +43 -12
  50. package/lib/channelCollection.js.map +1 -1
  51. package/lib/compatUtils.d.ts +19 -10
  52. package/lib/compatUtils.d.ts.map +1 -1
  53. package/lib/compatUtils.js +36 -29
  54. package/lib/compatUtils.js.map +1 -1
  55. package/lib/containerRuntime.d.ts +29 -13
  56. package/lib/containerRuntime.d.ts.map +1 -1
  57. package/lib/containerRuntime.js +60 -70
  58. package/lib/containerRuntime.js.map +1 -1
  59. package/lib/dataStoreContext.d.ts +15 -16
  60. package/lib/dataStoreContext.d.ts.map +1 -1
  61. package/lib/dataStoreContext.js +38 -20
  62. package/lib/dataStoreContext.js.map +1 -1
  63. package/lib/index.d.ts +1 -3
  64. package/lib/index.d.ts.map +1 -1
  65. package/lib/index.js +0 -3
  66. package/lib/index.js.map +1 -1
  67. package/lib/legacy.d.ts +1 -0
  68. package/lib/opLifecycle/index.d.ts +1 -1
  69. package/lib/opLifecycle/index.d.ts.map +1 -1
  70. package/lib/opLifecycle/index.js.map +1 -1
  71. package/lib/opLifecycle/outbox.d.ts +20 -7
  72. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  73. package/lib/opLifecycle/outbox.js +16 -20
  74. package/lib/opLifecycle/outbox.js.map +1 -1
  75. package/lib/packageVersion.d.ts +1 -1
  76. package/lib/packageVersion.js +1 -1
  77. package/lib/packageVersion.js.map +1 -1
  78. package/lib/pendingStateManager.d.ts +22 -8
  79. package/lib/pendingStateManager.d.ts.map +1 -1
  80. package/lib/pendingStateManager.js +11 -16
  81. package/lib/pendingStateManager.js.map +1 -1
  82. package/package.json +18 -18
  83. package/src/blobManager/blobManager.ts +141 -33
  84. package/src/channelCollection.ts +77 -19
  85. package/src/compatUtils.ts +53 -30
  86. package/src/containerRuntime.ts +102 -81
  87. package/src/dataStoreContext.ts +48 -38
  88. package/src/index.ts +1 -13
  89. package/src/opLifecycle/index.ts +1 -0
  90. package/src/opLifecycle/outbox.ts +42 -33
  91. package/src/packageVersion.ts +1 -1
  92. package/src/pendingStateManager.ts +37 -20
@@ -1 +1 @@
1
- {"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../../src/blobManager/blobManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAIsC;AACtC,iFAAoE;AAYpE,kEAAuE;AAKvE,oEAAsF;AAOtF,qEAKgD;AAChD,uEAMkD;AAClD,+BAAkC;AAIlC,mEAKiC;AAEjC;;;;;;GAMG;AACH,MAAa,UACZ,SAAQ,0BAAgC;IAKxC,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC;IACtD,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;QAbpC,aAAQ,GAAY,KAAK,CAAC;QAgBjC,IAAI,CAAC,YAAY,GAAG,IAAA,oCAAyB,EAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACxE,CAAC;IAEM,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpB,IAAI,CAAC,QAAQ,GAA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ACtC,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 {\n\tTypedEventEmitter,\n\tbufferToString,\n\tstringToBuffer,\n} from \"@fluid-internal/client-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport {\n\tIContainerRuntime,\n\tIContainerRuntimeEvents,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tIEvent,\n\tIEventProvider,\n\tIFluidHandleContext,\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, Deferred } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentStorageService,\n\tICreateBlobResponse,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { canRetryOnError, runWithRetry } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\ttype ISequencedMessageEnvelope,\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\tMonitoringContext,\n\tPerformanceEvent,\n\tcreateChildMonitoringContext,\n\twrapError,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { IBlobMetadata } 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 IFluidHandleInternalPayloadPending<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\tpublic readonly absolutePath: string;\n\n\tconstructor(\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 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\tpublic bind(handle: IFluidHandleInternal): void {\n\t\tthrow new Error(\"Cannot bind to blob handle\");\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\" | \"connected\" | \"baseLogger\" | \"clientDetails\" | \"disposed\"\n> &\n\tTypedEventEmitter<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<ICreateBlobResponse | void>;\n\tuploadTime?: number;\n\tminTTLInSeconds?: number;\n\tattached?: boolean;\n\tacked?: boolean;\n\tabortSignal?: AbortSignal;\n\tstashedUpload?: boolean;\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 extends IEvent {\n\t(event: \"noPendingBlobs\", listener: () => void);\n}\n\ninterface IBlobManagerInternalEvents extends IEvent {\n\t(event: \"handleAttached\", listener: (pending: PendingBlob) => void);\n\t(event: \"processedBlobAttach\", listener: (localId: string, storageId: string) => void);\n}\n\nconst stashedPendingBlobOverrides: Pick<\n\tPendingBlob,\n\t\"stashedUpload\" | \"storageId\" | \"minTTLInSeconds\" | \"uploadTime\"\n> = {\n\tstashedUpload: true,\n\tstorageId: undefined,\n\tminTTLInSeconds: undefined,\n\tuploadTime: undefined,\n} as const;\n\nexport const blobManagerBasePath = \"_blobs\" as const;\n\nexport class BlobManager {\n\tprivate readonly mc: MonitoringContext;\n\n\tprivate readonly publicEvents = new TypedEventEmitter<IBlobManagerEvents>();\n\tpublic get events(): IEventProvider<IBlobManagerEvents> {\n\t\treturn this.publicEvents;\n\t}\n\tprivate readonly internalEvents = new TypedEventEmitter<IBlobManagerInternalEvents>();\n\n\t/**\n\t * Map of local IDs to storage IDs. Contains identity entries (storageId → storageId) for storage IDs. All requested IDs should\n\t * be a key in this map. Blobs created while the container is detached are stored in IDetachedBlobStorage which\n\t * gives local IDs; the storage IDs are filled in at attach time.\n\t * Note: It contains mappings from all clients, i.e., from remote clients as well. local ID comes from the client\n\t * that uploaded the blob but its mapping to storage ID is needed in all clients in order to retrieve the blob.\n\t */\n\tprivate readonly redirectTable: Map<string, string | undefined>;\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\tprivate stopAttaching: boolean = false;\n\n\tprivate readonly routeContext: IFluidHandleContext;\n\tprivate readonly storage: IDocumentStorageService;\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>/<blobId>`.\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>/<blobId>`.\n\tprivate readonly isBlobDeleted: (blobPath: string) => boolean;\n\tprivate readonly runtime: IBlobManagerRuntime;\n\tprivate readonly localBlobIdGenerator: () => string;\n\tprivate readonly pendingStashedBlobs: Map<string, Promise<ICreateBlobResponse | void>> =\n\t\tnew Map();\n\tpublic readonly stashedBlobsUploadP: Promise<(void | ICreateBlobResponse)[]>;\n\n\tpublic constructor(props: {\n\t\treadonly routeContext: IFluidHandleContext;\n\n\t\tblobManagerLoadInfo: IBlobManagerLoadInfo;\n\t\treadonly storage: IDocumentStorageService;\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>/<blobId>`.\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>/<blobId>`.\n\t\treadonly isBlobDeleted: (blobPath: string) => boolean;\n\t\treadonly runtime: IBlobManagerRuntime;\n\t\tstashedBlobs: IPendingBlobs | undefined;\n\t\treadonly localBlobIdGenerator?: (() => 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\tstashedBlobs,\n\t\t\tlocalBlobIdGenerator,\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.localBlobIdGenerator = localBlobIdGenerator ?? uuid;\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(\n\t\t\tblobManagerLoadInfo,\n\t\t\tthis.mc.logger,\n\t\t\tthis.runtime.attachState,\n\t\t);\n\n\t\t// Begin uploading stashed blobs from previous container instance\n\t\tfor (const [localId, entry] of Object.entries(stashedBlobs ?? {})) {\n\t\t\tconst { acked, storageId, minTTLInSeconds, uploadTime } = entry;\n\t\t\tconst blob = stringToBuffer(entry.blob, \"base64\");\n\t\t\tconst pendingEntry: PendingBlob = {\n\t\t\t\tblob,\n\t\t\t\topsent: true,\n\t\t\t\thandleP: new Deferred(),\n\t\t\t\tstorageId,\n\t\t\t\tuploadP: undefined,\n\t\t\t\tuploadTime,\n\t\t\t\tminTTLInSeconds,\n\t\t\t\tattached: true,\n\t\t\t\tacked,\n\t\t\t};\n\t\t\tthis.pendingBlobs.set(localId, pendingEntry);\n\n\t\t\tif (storageId !== undefined && minTTLInSeconds && uploadTime) {\n\t\t\t\tconst timeLapseSinceLocalUpload = (Date.now() - uploadTime) / 1000;\n\t\t\t\t// stashed entries with more than half-life in storage will not be reuploaded\n\t\t\t\tif (minTTLInSeconds - timeLapseSinceLocalUpload > minTTLInSeconds / 2) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.pendingStashedBlobs.set(localId, this.uploadBlob(localId, blob));\n\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\t...pendingEntry,\n\t\t\t\t...stashedPendingBlobOverrides,\n\t\t\t\tuploadP: this.pendingStashedBlobs.get(localId),\n\t\t\t});\n\t\t}\n\n\t\tthis.stashedBlobsUploadP = PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"BlobUploadProcessStashedChanges\", count: this.pendingStashedBlobs.size },\n\t\t\tasync () => Promise.all(this.pendingStashedBlobs.values()),\n\t\t\t{ start: true, end: true },\n\t\t).finally(() => {\n\t\t\tthis.pendingStashedBlobs.clear();\n\t\t});\n\n\t\tthis.sendBlobAttachOp = (localId: string, blobId?: 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, blobId);\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 hasPendingStashedUploads(): boolean {\n\t\treturn [...this.pendingBlobs.values()].some((e) => e.stashedUpload === true);\n\t}\n\n\tpublic hasBlob(blobId: string): boolean {\n\t\treturn this.redirectTable.get(blobId) !== undefined;\n\t}\n\n\tpublic async getBlob(blobId: 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(blobId);\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(getGCNodePathFromBlobId(blobId));\n\n\t\tconst pending = this.pendingBlobs.get(blobId);\n\t\tif (pending) {\n\t\t\treturn pending.blob;\n\t\t}\n\n\t\tlet storageId: string;\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\tassert(this.redirectTable.has(blobId), 0x383 /* requesting unknown blobs */);\n\n\t\t\t// Blobs created while the container is detached are stored in IDetachedBlobStorage.\n\t\t\t// The 'IDocumentStorageService.readBlob()' call below will retrieve these via localId.\n\t\t\tstorageId = blobId;\n\t\t} else {\n\t\t\tconst attachedStorageId = this.redirectTable.get(blobId);\n\t\t\tif (!payloadPending) {\n\t\t\t\tassert(!!attachedStorageId, 0x11f /* \"requesting unknown blobs\" */);\n\t\t\t}\n\t\t\t// If we didn't find it in the redirectTable, assume the attach op is coming eventually and wait.\n\t\t\t// We do this even if the local client doesn't have the blob payloadPending flag enabled, in case a\n\t\t\t// remote client does have it enabled. This wait may be infinite if the uploading client failed\n\t\t\t// the upload and doesn't exist anymore.\n\t\t\tstorageId =\n\t\t\t\tattachedStorageId ??\n\t\t\t\t(await new Promise<string>((resolve) => {\n\t\t\t\t\tconst onProcessBlobAttach = (localId: string, _storageId: string): void => {\n\t\t\t\t\t\tif (localId === blobId) {\n\t\t\t\t\t\t\tthis.internalEvents.off(\"processedBlobAttach\", onProcessBlobAttach);\n\t\t\t\t\t\t\tresolve(_storageId);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tthis.internalEvents.on(\"processedBlobAttach\", onProcessBlobAttach);\n\t\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 blob 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 blob 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\tgetGCNodePathFromBlobId(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<IFluidHandleInternal<ArrayBufferLike>> {\n\t\t// Blobs created while the container is detached are stored in IDetachedBlobStorage.\n\t\t// The 'IDocumentStorageService.createBlob()' call below will respond with a localId.\n\t\tconst response = await this.storage.createBlob(blob);\n\t\tthis.setRedirection(response.id, undefined);\n\t\treturn this.getBlobHandle(response.id);\n\t}\n\n\tpublic async createBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternal<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\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.localBlobIdGenerator();\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 async uploadBlob(\n\t\tlocalId: string,\n\t\tblob: ArrayBufferLike,\n\t): Promise<ICreateBlobResponse | void> {\n\t\treturn runWithRetry(\n\t\t\tasync () => {\n\t\t\t\ttry {\n\t\t\t\t\treturn await this.storage.createBlob(blob);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst entry = this.pendingBlobs.get(localId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!entry,\n\t\t\t\t\t\t0x387 /* Must have pending blob entry for blob which failed to upload */,\n\t\t\t\t\t);\n\t\t\t\t\tif (entry.opsent && !canRetryOnError(error)) {\n\t\t\t\t\t\tthrow wrapError(\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t() => new LoggingError(`uploadBlob error`, { canRetry: true }),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"createBlob\",\n\t\t\tthis.mc.logger,\n\t\t\t{\n\t\t\t\tcancel: this.pendingBlobs.get(localId)?.abortSignal,\n\t\t\t},\n\t\t).then(\n\t\t\t(response) => this.onUploadResolve(localId, response),\n\t\t\t(error) => {\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"UploadBlobReject\",\n\t\t\t\t\t// TODO: better typing\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\terror,\n\t\t\t\t\tlocalId,\n\t\t\t\t});\n\t\t\t\t// it will only reject if we haven't sent an op\n\t\t\t\t// and is a non-retriable error. It will only reject\n\t\t\t\t// the promise but not throw any error outside.\n\t\t\t\tthis.pendingBlobs.get(localId)?.handleP.reject(error);\n\t\t\t\tthis.deletePendingBlob(localId);\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 | undefined): 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\t\tif (entry === undefined && this.pendingStashedBlobs.has(localId)) {\n\t\t\t// The blob was already processed and deleted. This can happen if the blob was reuploaded by\n\t\t\t// the stashing process and the original upload was processed before the stashed upload.\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"StashedBlobAlreadyProcessed\",\n\t\t\t\tlocalId,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tassert(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);\n\t\tif ((entry.abortSignal?.aborted === true && !entry.opsent) || this.stopAttaching) {\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.stashedUpload = undefined;\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, this.runtime.attachState);\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\tentry.handleP.resolve(this.getBlobHandle(localId));\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(!!metadata, 0x38b /* Resubmitted ops must have metadata */);\n\t\tconst { localId, blobId }: { localId?: string; blobId?: string } = metadata;\n\t\tassert(localId !== undefined, 0x50d /* local ID not available on reSubmit */);\n\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\n\t\tif (!blobId) {\n\t\t\t// We submitted this op while offline. The blob should have been uploaded by now.\n\t\t\tassert(\n\t\t\t\tpendingEntry?.opsent === true && !!pendingEntry?.storageId,\n\t\t\t\t0x38d /* blob must be uploaded before resubmitting BlobAttach op */,\n\t\t\t);\n\t\t\treturn this.sendBlobAttachOp(localId, pendingEntry?.storageId);\n\t\t}\n\t\treturn this.sendBlobAttachOp(localId, blobId);\n\t}\n\n\tpublic processBlobAttachMessage(message: ISequencedMessageEnvelope, local: boolean): void {\n\t\tconst localId = (message.metadata as IBlobMetadata | undefined)?.localId;\n\t\tconst blobId = (message.metadata as IBlobMetadata | undefined)?.blobId;\n\n\t\tif (localId) {\n\t\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\t\t\tif (pendingEntry?.abortSignal?.aborted) {\n\t\t\t\tthis.deletePendingBlob(localId);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tassert(blobId !== undefined, 0x12a /* \"Missing blob id on metadata\" */);\n\n\t\t// Set up a mapping from local ID to storage ID. This is crucial since without this the blob cannot be\n\t\t// requested from the server.\n\t\t// Note: The check for undefined is needed for back-compat when localId was not part of the BlobAttach op that\n\t\t// was sent when online.\n\t\tif (localId !== undefined) {\n\t\t\tthis.setRedirection(localId, blobId);\n\t\t}\n\t\t// set identity (id -> id) entry\n\t\tthis.setRedirection(blobId, blobId);\n\n\t\tif (local) {\n\t\t\tassert(localId !== undefined, 0x50e /* local ID not present in blob attach message */);\n\t\t\tconst waitingBlobs = this.opsInFlight.get(blobId);\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, blobId);\n\t\t\t\t\tentry.acked = true;\n\t\t\t\t\tentry.handleP.resolve(this.getBlobHandle(pendingLocalId));\n\t\t\t\t\tthis.deletePendingBlobMaybe(pendingLocalId);\n\t\t\t\t}\n\t\t\t\tthis.opsInFlight.delete(blobId);\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\tlocalEntry.handleP.resolve(this.getBlobHandle(localId));\n\t\t\t\tthis.deletePendingBlobMaybe(localId);\n\t\t\t}\n\t\t}\n\t\tthis.internalEvents.emit(\"processedBlobAttach\", localId, blobId);\n\t}\n\n\tpublic summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\treturn summarizeBlobManagerState(this.redirectTable, this.runtime.attachState);\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\tassert(!!storageId, 0x390 /* Must be attached to get GC data */);\n\t\t\t// Only return local ids as GC nodes because a blob can only be referenced via its local id. The storage\n\t\t\t// id entries have the same key and value, ignore them.\n\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// by adding its handle to a referenced DDS.\n\t\t\tif (localId !== storageId) {\n\t\t\t\tgcData.gcNodes[getGCNodePathFromBlobId(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>/<blobId>`. The blob ids are all local ids.\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 in-use anymore, the redirect table entries\n\t * for the storage ids 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 remove them the next summary. The service would them delete them some time in the future.\n\t */\n\tprivate deleteBlobsFromRedirectTable(blobRoutes: readonly string[]): void {\n\t\tif (blobRoutes.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// This tracks the storage ids of local ids that are deleted. After the local ids have been deleted, if any of\n\t\t// these storage ids are unused, they will be deleted as well.\n\t\tconst maybeUnusedStorageIds: Set<string> = new Set();\n\t\tfor (const route of blobRoutes) {\n\t\t\tconst blobId = getBlobIdFromGCNodePath(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\tif (!this.redirectTable.has(blobId)) {\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,\n\t\t\t\t\tdetails: { alreadyDeleted },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storageId = this.redirectTable.get(blobId);\n\t\t\tassert(!!storageId, 0x5bb /* Must be attached to run GC */);\n\t\t\tmaybeUnusedStorageIds.add(storageId);\n\t\t\tthis.redirectTable.delete(blobId);\n\t\t}\n\n\t\t// Find out storage ids that are in-use and remove them from maybeUnusedStorageIds. A storage id is in-use if\n\t\t// the redirect table has a local id -> storage id entry for it.\n\t\tfor (const [localId, storageId] of this.redirectTable.entries()) {\n\t\t\tassert(!!storageId, 0x5bc /* Must be attached to run GC */);\n\t\t\t// For every storage id, the redirect table has a id -> id entry. These do not make the storage id in-use.\n\t\t\tif (maybeUnusedStorageIds.has(storageId) && localId !== storageId) {\n\t\t\t\tmaybeUnusedStorageIds.delete(storageId);\n\t\t\t}\n\t\t}\n\n\t\t// For unused storage ids, delete their id -> id entries from the redirect table.\n\t\t// This way they'll be absent from the next summary, and the service is free to delete them from storage.\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(blobId: string): void {\n\t\tif (!this.isBlobDeleted(getGCNodePathFromBlobId(blobId))) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst request = { url: blobId };\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\tpublic setRedirectTable(table: 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\tassert(\n\t\t\tthis.redirectTable.size === table.size,\n\t\t\t0x391 /* Redirect table size must match BlobManager's local ID count */,\n\t\t);\n\t\tfor (const [localId, storageId] of table) {\n\t\t\tassert(this.redirectTable.has(localId), 0x254 /* \"unrecognized id in redirect table\" */);\n\t\t\tthis.setRedirection(localId, storageId);\n\t\t\t// set identity (id -> id) entry\n\t\t\tthis.setRedirection(storageId, storageId);\n\t\t}\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\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"GetPendingBlobs\" },\n\t\t\tasync () => {\n\t\t\t\tif (this.pendingBlobs.size === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst blobs = {};\n\t\t\t\tconst localBlobs = new Set<PendingBlob>();\n\t\t\t\t// This while is used to stash blobs created while attaching and getting blobs\n\t\t\t\twhile (localBlobs.size < this.pendingBlobs.size) {\n\t\t\t\t\tconst attachBlobsP: Promise<void>[] = [];\n\t\t\t\t\tfor (const [localId, entry] of this.pendingBlobs) {\n\t\t\t\t\t\tif (!localBlobs.has(entry)) {\n\t\t\t\t\t\t\tlocalBlobs.add(entry);\n\t\t\t\t\t\t\t// In order to follow natural blob creation flow we need to:\n\t\t\t\t\t\t\t// 1 send the blob attach op\n\t\t\t\t\t\t\t// 2 resolve the blob handle\n\t\t\t\t\t\t\t// 3 wait for op referencing the blob\n\t\t\t\t\t\t\tif (!entry.opsent) {\n\t\t\t\t\t\t\t\tthis.sendBlobAttachOp(localId, entry.storageId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Resolving the blob handle to let hosts continue with their operations (it will resolve\n\t\t\t\t\t\t\t// original createBlob call) and let them attach the blob. This is a lie we told since the upload\n\t\t\t\t\t\t\t// hasn't finished yet, but it's fine since we will retry on rehydration.\n\t\t\t\t\t\t\tentry.handleP.resolve(this.getBlobHandle(localId));\n\t\t\t\t\t\t\t// Array of promises that will resolve when blobs get attached.\n\t\t\t\t\t\t\tattachBlobsP.push(\n\t\t\t\t\t\t\t\tnew Promise<void>((resolve, reject) => {\n\t\t\t\t\t\t\t\t\tstopBlobAttachingSignal?.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\"abort\",\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tthis.stopAttaching = true;\n\t\t\t\t\t\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{ once: true },\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconst onBlobAttached = (attachedEntry: PendingBlob): void => {\n\t\t\t\t\t\t\t\t\t\tif (attachedEntry === entry) {\n\t\t\t\t\t\t\t\t\t\t\tthis.internalEvents.off(\"handleAttached\", onBlobAttached);\n\t\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif (entry.attached) {\n\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tthis.internalEvents.on(\"handleAttached\", onBlobAttached);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Wait for all blobs to be attached. This is important, otherwise serialized container\n\t\t\t\t\t// could send the blobAttach op without any op that references the blob, making it useless.\n\t\t\t\t\tawait Promise.allSettled(attachBlobsP);\n\t\t\t\t}\n\n\t\t\t\tfor (const [localId, entry] of this.pendingBlobs) {\n\t\t\t\t\tif (stopBlobAttachingSignal?.aborted && !entry.attached) {\n\t\t\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\t\t\teventName: \"UnableToStashBlob\",\n\t\t\t\t\t\t\tid: localId,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tassert(entry.attached === true, 0x790 /* stashed blob should be attached */);\n\t\t\t\t\tblobs[localId] = {\n\t\t\t\t\t\tblob: bufferToString(entry.blob, \"base64\"),\n\t\t\t\t\t\tstorageId: entry.storageId,\n\t\t\t\t\t\tacked: entry.acked,\n\t\t\t\t\t\tminTTLInSeconds: entry.minTTLInSeconds,\n\t\t\t\t\t\tuploadTime: entry.uploadTime,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn Object.keys(blobs).length > 0 ? blobs : undefined;\n\t\t\t},\n\t\t);\n\t}\n}\n\n/**\n * For a blobId, returns its path in GC's graph. The node path is of the format `/<blobManagerBasePath>/<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 */\nconst getGCNodePathFromBlobId = (blobId: string): string =>\n\t`/${blobManagerBasePath}/${blobId}`;\n\n/**\n * For a given GC node path, return the blobId. The node path is of the format `/<basePath>/<blobId>`.\n */\nconst getBlobIdFromGCNodePath = (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,+DAA6F;AAC7F,iFAAoE;AAgBpE,kEAAuE;AAKvE,oEAAsF;AAOtF,qEAKgD;AAChD,uEAM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AAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, createEmitter, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport {\n\tIContainerRuntime,\n\tIContainerRuntimeEvents,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tIEmitter,\n\tIEventProvider,\n\tIFluidHandleContext,\n\tIFluidHandleInternal,\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 {\n\tIDocumentStorageService,\n\tICreateBlobResponse,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { canRetryOnError, runWithRetry } from \"@fluidframework/driver-utils/internal\";\nimport {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\ttype ISequencedMessageEnvelope,\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\tMonitoringContext,\n\tPerformanceEvent,\n\tcreateChildMonitoringContext,\n\twrapError,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { IBlobMetadata } 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\t// eslint-disable-next-line jsdoc/require-description\n\t/**\n\t * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.\n\t */\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\tthrow new Error(\"Cannot bind to blob handle\");\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\" | \"connected\" | \"baseLogger\" | \"clientDetails\" | \"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<ICreateBlobResponse | void>;\n\tuploadTime?: number;\n\tminTTLInSeconds?: number;\n\tattached?: boolean;\n\tacked?: boolean;\n\tabortSignal?: AbortSignal;\n\tstashedUpload?: boolean;\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\nconst stashedPendingBlobOverrides: Pick<\n\tPendingBlob,\n\t\"stashedUpload\" | \"storageId\" | \"minTTLInSeconds\" | \"uploadTime\"\n> = {\n\tstashedUpload: true,\n\tstorageId: undefined,\n\tminTTLInSeconds: undefined,\n\tuploadTime: undefined,\n} as const;\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. Contains identity entries (storageId → storageId) for storage IDs. All requested IDs should\n\t * be a key in this map. Blobs created while the container is detached are stored in IDetachedBlobStorage which\n\t * gives local IDs; the storage IDs are filled in at attach time.\n\t * Note: It contains mappings from all clients, i.e., from remote clients as well. local ID comes from the client\n\t * that uploaded the blob but its mapping to storage ID is needed in all clients in order to retrieve the blob.\n\t */\n\tprivate readonly redirectTable: Map<string, string | undefined>;\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\tprivate stopAttaching: boolean = false;\n\n\tprivate readonly routeContext: IFluidHandleContext;\n\tprivate readonly storage: IDocumentStorageService;\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>/<blobId>`.\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>/<blobId>`.\n\tprivate readonly isBlobDeleted: (blobPath: string) => boolean;\n\tprivate readonly runtime: IBlobManagerRuntime;\n\tprivate readonly localBlobIdGenerator: () => string;\n\tprivate readonly pendingStashedBlobs: Map<string, Promise<ICreateBlobResponse | void>> =\n\t\tnew Map();\n\tpublic readonly stashedBlobsUploadP: Promise<(void | ICreateBlobResponse)[]>;\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: IDocumentStorageService;\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>/<blobId>`.\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>/<blobId>`.\n\t\treadonly isBlobDeleted: (blobPath: string) => boolean;\n\t\treadonly runtime: IBlobManagerRuntime;\n\t\tstashedBlobs: IPendingBlobs | undefined;\n\t\treadonly localBlobIdGenerator?: (() => 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\tstashedBlobs,\n\t\t\tlocalBlobIdGenerator,\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.localBlobIdGenerator = localBlobIdGenerator ?? 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(\n\t\t\tblobManagerLoadInfo,\n\t\t\tthis.mc.logger,\n\t\t\tthis.runtime.attachState,\n\t\t);\n\n\t\t// Begin uploading stashed blobs from previous container instance\n\t\tfor (const [localId, entry] of Object.entries(stashedBlobs ?? {})) {\n\t\t\tconst { acked, storageId, minTTLInSeconds, uploadTime } = entry;\n\t\t\tconst blob = stringToBuffer(entry.blob, \"base64\");\n\t\t\tconst pendingEntry: PendingBlob = {\n\t\t\t\tblob,\n\t\t\t\topsent: true,\n\t\t\t\thandleP: new Deferred(),\n\t\t\t\tstorageId,\n\t\t\t\tuploadP: undefined,\n\t\t\t\tuploadTime,\n\t\t\t\tminTTLInSeconds,\n\t\t\t\tattached: true,\n\t\t\t\tacked,\n\t\t\t};\n\t\t\tthis.pendingBlobs.set(localId, pendingEntry);\n\n\t\t\tif (storageId !== undefined && minTTLInSeconds && uploadTime) {\n\t\t\t\tconst timeLapseSinceLocalUpload = (Date.now() - uploadTime) / 1000;\n\t\t\t\t// stashed entries with more than half-life in storage will not be reuploaded\n\t\t\t\tif (minTTLInSeconds - timeLapseSinceLocalUpload > minTTLInSeconds / 2) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.pendingStashedBlobs.set(localId, this.uploadBlob(localId, blob));\n\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\t...pendingEntry,\n\t\t\t\t...stashedPendingBlobOverrides,\n\t\t\t\tuploadP: this.pendingStashedBlobs.get(localId),\n\t\t\t});\n\t\t}\n\n\t\tthis.stashedBlobsUploadP = PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"BlobUploadProcessStashedChanges\", count: this.pendingStashedBlobs.size },\n\t\t\tasync () => Promise.all(this.pendingStashedBlobs.values()),\n\t\t\t{ start: true, end: true },\n\t\t).finally(() => {\n\t\t\tthis.pendingStashedBlobs.clear();\n\t\t});\n\n\t\tthis.sendBlobAttachOp = (localId: string, blobId?: 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, blobId);\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 hasPendingStashedUploads(): boolean {\n\t\treturn [...this.pendingBlobs.values()].some((e) => e.stashedUpload === true);\n\t}\n\n\tpublic hasBlob(blobId: string): boolean {\n\t\treturn this.redirectTable.get(blobId) !== undefined;\n\t}\n\n\t/**\n\t * Retrieve the blob with the given local blob id.\n\t * @param blobId - 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(blobId: 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(blobId);\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(getGCNodePathFromBlobId(blobId));\n\n\t\tconst pending = this.pendingBlobs.get(blobId);\n\t\tif (pending) {\n\t\t\treturn pending.blob;\n\t\t}\n\n\t\tlet storageId: string;\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\tassert(this.redirectTable.has(blobId), 0x383 /* requesting unknown blobs */);\n\n\t\t\t// Blobs created while the container is detached are stored in IDetachedBlobStorage.\n\t\t\t// The 'IDocumentStorageService.readBlob()' call below will retrieve these via localId.\n\t\t\tstorageId = blobId;\n\t\t} else {\n\t\t\tconst attachedStorageId = this.redirectTable.get(blobId);\n\t\t\tif (!payloadPending) {\n\t\t\t\t// Only blob handles explicitly marked with pending payload are permitted to exist without\n\t\t\t\t// yet knowing their storage id. Otherwise they must already be associated with a storage id.\n\t\t\t\tassert(attachedStorageId !== undefined, 0x11f /* \"requesting unknown blobs\" */);\n\t\t\t}\n\t\t\t// If we didn't find it in the redirectTable, assume the attach op is coming eventually and wait.\n\t\t\t// We do this even if the local client doesn't have the blob payloadPending flag enabled, in case a\n\t\t\t// remote client does have it enabled. This wait may be infinite if the uploading client failed\n\t\t\t// the upload and doesn't exist anymore.\n\t\t\tstorageId =\n\t\t\t\tattachedStorageId ??\n\t\t\t\t(await new Promise<string>((resolve) => {\n\t\t\t\t\tconst onProcessBlobAttach = (localId: string, _storageId: string): void => {\n\t\t\t\t\t\tif (localId === blobId) {\n\t\t\t\t\t\t\tthis.internalEvents.off(\"processedBlobAttach\", onProcessBlobAttach);\n\t\t\t\t\t\t\tresolve(_storageId);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tthis.internalEvents.on(\"processedBlobAttach\", onProcessBlobAttach);\n\t\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\tgetGCNodePathFromBlobId(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\t// Blobs created while the container is detached are stored in IDetachedBlobStorage.\n\t\t// The 'IDocumentStorageService.createBlob()' call below will respond with a localId.\n\t\tconst response = await this.storage.createBlob(blob);\n\t\tthis.setRedirection(response.id, undefined);\n\t\treturn this.getBlobHandle(response.id);\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.localBlobIdGenerator();\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.localBlobIdGenerator();\n\n\t\tconst blobHandle = new BlobHandle(\n\t\t\tgetGCNodePathFromBlobId(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\tprivate async uploadBlob(\n\t\tlocalId: string,\n\t\tblob: ArrayBufferLike,\n\t): Promise<ICreateBlobResponse | void> {\n\t\treturn runWithRetry(\n\t\t\tasync () => {\n\t\t\t\ttry {\n\t\t\t\t\treturn await this.storage.createBlob(blob);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst entry = this.pendingBlobs.get(localId);\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!entry,\n\t\t\t\t\t\t0x387 /* Must have pending blob entry for blob which failed to upload */,\n\t\t\t\t\t);\n\t\t\t\t\tif (entry.opsent && !canRetryOnError(error)) {\n\t\t\t\t\t\tthrow wrapError(\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t() => new LoggingError(`uploadBlob error`, { canRetry: true }),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"createBlob\",\n\t\t\tthis.mc.logger,\n\t\t\t{\n\t\t\t\tcancel: this.pendingBlobs.get(localId)?.abortSignal,\n\t\t\t},\n\t\t).then(\n\t\t\t(response) => this.onUploadResolve(localId, response),\n\t\t\t(error) => {\n\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"UploadBlobReject\",\n\t\t\t\t\t// TODO: better typing\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\terror,\n\t\t\t\t\tlocalId,\n\t\t\t\t});\n\t\t\t\t// it will only reject if we haven't sent an op\n\t\t\t\t// and is a non-retriable error. It will only reject\n\t\t\t\t// the promise but not throw any error outside.\n\t\t\t\tthis.pendingBlobs.get(localId)?.handleP.reject(error);\n\t\t\t\tthis.deletePendingBlob(localId);\n\t\t\t\tthis.internalEvents.emit(\"uploadFailed\", localId, error);\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 | undefined): 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\t\tif (entry === undefined && this.pendingStashedBlobs.has(localId)) {\n\t\t\t// The blob was already processed and deleted. This can happen if the blob was reuploaded by\n\t\t\t// the stashing process and the original upload was processed before the stashed upload.\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"StashedBlobAlreadyProcessed\",\n\t\t\t\tlocalId,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tassert(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);\n\t\tif ((entry.abortSignal?.aborted === true && !entry.opsent) || this.stopAttaching) {\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.stashedUpload = undefined;\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, this.runtime.attachState);\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(!!metadata, 0x38b /* Resubmitted ops must have metadata */);\n\t\tconst { localId, blobId }: { localId?: string; blobId?: string } = metadata;\n\t\tassert(localId !== undefined, 0x50d /* local ID not available on reSubmit */);\n\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\n\t\tif (!blobId) {\n\t\t\t// We submitted this op while offline. The blob should have been uploaded by now.\n\t\t\tassert(\n\t\t\t\tpendingEntry?.opsent === true && !!pendingEntry?.storageId,\n\t\t\t\t0x38d /* blob must be uploaded before resubmitting BlobAttach op */,\n\t\t\t);\n\t\t\treturn this.sendBlobAttachOp(localId, pendingEntry?.storageId);\n\t\t}\n\t\treturn this.sendBlobAttachOp(localId, blobId);\n\t}\n\n\tpublic processBlobAttachMessage(message: ISequencedMessageEnvelope, local: boolean): void {\n\t\tconst localId = (message.metadata as IBlobMetadata | undefined)?.localId;\n\t\tconst blobId = (message.metadata as IBlobMetadata | undefined)?.blobId;\n\n\t\tif (localId) {\n\t\t\tconst pendingEntry = this.pendingBlobs.get(localId);\n\t\t\tif (pendingEntry?.abortSignal?.aborted) {\n\t\t\t\tthis.deletePendingBlob(localId);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tassert(blobId !== undefined, 0x12a /* \"Missing blob id on metadata\" */);\n\n\t\t// Set up a mapping from local ID to storage ID. This is crucial since without this the blob cannot be\n\t\t// requested from the server.\n\t\t// Note: The check for undefined is needed for back-compat when localId was not part of the BlobAttach op that\n\t\t// was sent when online.\n\t\tif (localId !== undefined) {\n\t\t\tthis.setRedirection(localId, blobId);\n\t\t}\n\t\t// set identity (id -> id) entry\n\t\tthis.setRedirection(blobId, blobId);\n\n\t\tassert(localId !== undefined, 0x50e /* local ID not present in blob attach message */);\n\t\tif (local) {\n\t\t\tconst waitingBlobs = this.opsInFlight.get(blobId);\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, blobId);\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(blobId);\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, blobId);\n\t}\n\n\tpublic summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\treturn summarizeBlobManagerState(this.redirectTable, this.runtime.attachState);\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\tassert(!!storageId, 0x390 /* Must be attached to get GC data */);\n\t\t\t// Only return local ids as GC nodes because a blob can only be referenced via its local id. The storage\n\t\t\t// id entries have the same key and value, ignore them.\n\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// by adding its handle to a referenced DDS.\n\t\t\tif (localId !== storageId) {\n\t\t\t\tgcData.gcNodes[getGCNodePathFromBlobId(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>/<blobId>`. The blob ids are all local ids.\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 in-use anymore, the redirect table entries\n\t * for the storage ids 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 remove them the next summary. The service would them delete them some time in the future.\n\t */\n\tprivate deleteBlobsFromRedirectTable(blobRoutes: readonly string[]): void {\n\t\tif (blobRoutes.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// This tracks the storage ids of local ids that are deleted. After the local ids have been deleted, if any of\n\t\t// these storage ids are unused, they will be deleted as well.\n\t\tconst maybeUnusedStorageIds: Set<string> = new Set();\n\t\tfor (const route of blobRoutes) {\n\t\t\tconst blobId = getBlobIdFromGCNodePath(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\tif (!this.redirectTable.has(blobId)) {\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,\n\t\t\t\t\tdetails: { alreadyDeleted },\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storageId = this.redirectTable.get(blobId);\n\t\t\tassert(!!storageId, 0x5bb /* Must be attached to run GC */);\n\t\t\tmaybeUnusedStorageIds.add(storageId);\n\t\t\tthis.redirectTable.delete(blobId);\n\t\t}\n\n\t\t// Find out storage ids that are in-use and remove them from maybeUnusedStorageIds. A storage id is in-use if\n\t\t// the redirect table has a local id -> storage id entry for it.\n\t\tfor (const [localId, storageId] of this.redirectTable.entries()) {\n\t\t\tassert(!!storageId, 0x5bc /* Must be attached to run GC */);\n\t\t\t// For every storage id, the redirect table has a id -> id entry. These do not make the storage id in-use.\n\t\t\tif (maybeUnusedStorageIds.has(storageId) && localId !== storageId) {\n\t\t\t\tmaybeUnusedStorageIds.delete(storageId);\n\t\t\t}\n\t\t}\n\n\t\t// For unused storage ids, delete their id -> id entries from the redirect table.\n\t\t// This way they'll be absent from the next summary, and the service is free to delete them from storage.\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(blobId: string): void {\n\t\tif (!this.isBlobDeleted(getGCNodePathFromBlobId(blobId))) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst request = { url: blobId };\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\tpublic setRedirectTable(table: 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\tassert(\n\t\t\tthis.redirectTable.size === table.size,\n\t\t\t0x391 /* Redirect table size must match BlobManager's local ID count */,\n\t\t);\n\t\tfor (const [localId, storageId] of table) {\n\t\t\tassert(this.redirectTable.has(localId), 0x254 /* \"unrecognized id in redirect table\" */);\n\t\t\tthis.setRedirection(localId, storageId);\n\t\t\t// set identity (id -> id) entry\n\t\t\tthis.setRedirection(storageId, storageId);\n\t\t}\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\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"GetPendingBlobs\" },\n\t\t\tasync () => {\n\t\t\t\tif (this.pendingBlobs.size === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst blobs = {};\n\t\t\t\tconst localBlobs = new Set<PendingBlob>();\n\t\t\t\t// This while is used to stash blobs created while attaching and getting blobs\n\t\t\t\twhile (localBlobs.size < this.pendingBlobs.size) {\n\t\t\t\t\tconst attachHandlesP: Promise<void>[] = [];\n\t\t\t\t\tfor (const [localId, entry] of this.pendingBlobs) {\n\t\t\t\t\t\tif (!localBlobs.has(entry)) {\n\t\t\t\t\t\t\tlocalBlobs.add(entry);\n\t\t\t\t\t\t\t// In order to follow natural blob creation flow we need to:\n\t\t\t\t\t\t\t// 1 send the blob attach op\n\t\t\t\t\t\t\t// 2 resolve the blob handle\n\t\t\t\t\t\t\t// 3 wait for op referencing the blob\n\t\t\t\t\t\t\tif (!entry.opsent) {\n\t\t\t\t\t\t\t\tthis.sendBlobAttachOp(localId, entry.storageId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Resolving the blob handle to let hosts continue with their operations (it will resolve\n\t\t\t\t\t\t\t// original createBlob call) and let them attach the blob. This is a lie we told since the upload\n\t\t\t\t\t\t\t// hasn't finished yet, but it's fine since we will retry on rehydration.\n\t\t\t\t\t\t\tentry.handleP.resolve(this.getBlobHandle(localId));\n\t\t\t\t\t\t\t// Array of promises that will resolve when handles get attached.\n\t\t\t\t\t\t\tattachHandlesP.push(\n\t\t\t\t\t\t\t\tnew Promise<void>((resolve, reject) => {\n\t\t\t\t\t\t\t\t\tstopBlobAttachingSignal?.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\"abort\",\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tthis.stopAttaching = true;\n\t\t\t\t\t\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{ once: true },\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tconst onHandleAttached = (attachedEntry: PendingBlob): void => {\n\t\t\t\t\t\t\t\t\t\tif (attachedEntry === entry) {\n\t\t\t\t\t\t\t\t\t\t\tthis.internalEvents.off(\"handleAttached\", onHandleAttached);\n\t\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif (entry.attached) {\n\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tthis.internalEvents.on(\"handleAttached\", onHandleAttached);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Wait for all blobs to be attached. This is important, otherwise serialized container\n\t\t\t\t\t// could send the blobAttach op without any op that references the blob, making it useless.\n\t\t\t\t\tawait Promise.allSettled(attachHandlesP);\n\t\t\t\t}\n\n\t\t\t\tfor (const [localId, entry] of this.pendingBlobs) {\n\t\t\t\t\tif (stopBlobAttachingSignal?.aborted && !entry.attached) {\n\t\t\t\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\t\t\t\teventName: \"UnableToStashBlob\",\n\t\t\t\t\t\t\tid: localId,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tassert(entry.attached === true, 0x790 /* stashed blob should be attached */);\n\t\t\t\t\tblobs[localId] = {\n\t\t\t\t\t\tblob: bufferToString(entry.blob, \"base64\"),\n\t\t\t\t\t\tstorageId: entry.storageId,\n\t\t\t\t\t\tacked: entry.acked,\n\t\t\t\t\t\tminTTLInSeconds: entry.minTTLInSeconds,\n\t\t\t\t\t\tuploadTime: entry.uploadTime,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn Object.keys(blobs).length > 0 ? blobs : undefined;\n\t\t\t},\n\t\t);\n\t}\n}\n\n/**\n * For a blobId, returns its path in GC's graph. The node path is of the format `/<blobManagerBasePath>/<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 */\nconst getGCNodePathFromBlobId = (blobId: string): string =>\n\t`/${blobManagerBasePath}/${blobId}`;\n\n/**\n * For a given GC node path, return the blobId. The node path is of the format `/<basePath>/<blobId>`.\n */\nconst getBlobIdFromGCNodePath = (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"]}
@@ -20,10 +20,21 @@ import { IContainerRuntimeMetadata } from "./summary/index.js";
20
20
  * @alpha
21
21
  */
22
22
  export declare const AllowTombstoneRequestHeaderKey = "allowTombstone";
23
+ /**
24
+ * This version of the interface is private to this the package. it should never be exported under any tag.
25
+ * It is used to manage interactions within the container-runtime package. If something is needed
26
+ * cross package, it is likely it is also being used cross layer (ContainerRuntime * DataStoreRuntime).
27
+ * If that is the case, the change likely needs to be staged directly on IFluidParentContext. Changes
28
+ * being staged on IFluidParentContext can be added here as well, likely with optionality removed,
29
+ * to ease interactions within this package.
30
+ */
31
+ export interface IFluidParentContextPrivate extends Omit<IFluidParentContext, "isReadOnly"> {
32
+ readonly isReadOnly: () => boolean;
33
+ }
23
34
  /**
24
35
  * Creates a shallow wrapper of {@link IFluidParentContext}. The wrapper can then have its methods overwritten as needed
25
36
  */
26
- export declare function wrapContext(context: IFluidParentContext): IFluidParentContext;
37
+ export declare function wrapContext(context: IFluidParentContextPrivate): IFluidParentContextPrivate;
27
38
  /**
28
39
  * Returns the type of the given local data store from its package path.
29
40
  */
@@ -35,7 +46,7 @@ export declare function getLocalDataStoreType(localDataStore: LocalFluidDataStor
35
46
  */
36
47
  export declare class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
37
48
  protected readonly baseSnapshot: ISnapshotTree | ISnapshot | undefined;
38
- readonly parentContext: IFluidParentContext;
49
+ readonly parentContext: IFluidParentContextPrivate;
39
50
  private readonly gcNodeUpdated;
40
51
  private readonly isDataStoreDeleted;
41
52
  private readonly aliasMap;
@@ -51,7 +62,7 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
51
62
  private readonly pendingAliasMap;
52
63
  protected readonly contexts: DataStoreContexts;
53
64
  private readonly aliasedDataStores;
54
- constructor(baseSnapshot: ISnapshotTree | ISnapshot | undefined, parentContext: IFluidParentContext, baseLogger: ITelemetryBaseLogger, gcNodeUpdated: (props: IGCNodeUpdatedProps) => void, isDataStoreDeleted: (nodePath: string) => boolean, aliasMap: Map<string, string>, provideEntryPoint: (runtime: ChannelCollection) => Promise<FluidObject>);
65
+ constructor(baseSnapshot: ISnapshotTree | ISnapshot | undefined, parentContext: IFluidParentContextPrivate, baseLogger: ITelemetryBaseLogger, gcNodeUpdated: (props: IGCNodeUpdatedProps) => void, isDataStoreDeleted: (nodePath: string) => boolean, aliasMap: Map<string, string>, provideEntryPoint: (runtime: ChannelCollection) => Promise<FluidObject>);
55
66
  get aliases(): ReadonlyMap<string, string>;
56
67
  get pendingAliases(): Map<string, Promise<AliasResult>>;
57
68
  waitIfPendingAlias(maybeAlias: string): Promise<AliasResult>;
@@ -59,7 +70,7 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
59
70
  * For sampling. Only log once per container
60
71
  */
61
72
  private shouldSendAttachLog;
62
- protected wrapContextForInnerChannel(id: string): IFluidParentContext;
73
+ protected wrapContextForInnerChannel(id: string): IFluidParentContextPrivate;
63
74
  /**
64
75
  * IFluidDataStoreChannel.makeVisibleAndAttachGraph implementation
65
76
  * Not clear when it would be called and what it should do.
@@ -103,8 +114,8 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
103
114
  protected createContext<T extends LocalFluidDataStoreContext>(id: string, pkg: Readonly<string[]>, contextCtor: new (props: ILocalDetachedFluidDataStoreContextProps) => T, loadingGroupId?: string): T;
104
115
  get disposed(): boolean;
105
116
  readonly dispose: () => void;
106
- reSubmit(type: string, content: unknown, localOpMetadata: unknown): void;
107
- protected reSubmitChannelOp(type: string, content: unknown, localOpMetadata: unknown): void;
117
+ reSubmit(type: string, content: unknown, localOpMetadata: unknown, squash: boolean): void;
118
+ protected reSubmitChannelOp(type: string, content: unknown, localOpMetadata: unknown, squash: boolean): void;
108
119
  rollback(type: string, content: unknown, localOpMetadata: unknown): void;
109
120
  applyStashedOp(content: unknown): Promise<unknown>;
110
121
  protected applyStashedChannelChannelOp(envelope: IEnvelope): Promise<unknown>;
@@ -142,6 +153,12 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
142
153
  * Enumerates the contexts and calls notifyReadOnlyState on them.
143
154
  */
144
155
  notifyReadOnlyState(readonly: boolean): void;
156
+ /**
157
+ * Notifies all data store contexts about the current staging mode state.
158
+ *
159
+ * @param staging - A boolean indicating whether the container is in staging mode.
160
+ */
161
+ notifyStagingMode(staging: boolean): void;
145
162
  setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
146
163
  get size(): number;
147
164
  /**
@@ -226,13 +243,12 @@ export declare function detectOutboundReferences(address: string, contents: unkn
226
243
  /**
227
244
  * @internal
228
245
  */
229
- export declare class ChannelCollectionFactory<T extends ChannelCollection = ChannelCollection> implements IFluidDataStoreFactory {
246
+ export declare class ChannelCollectionFactory implements IFluidDataStoreFactory {
230
247
  private readonly provideEntryPoint;
231
- private readonly ctor;
232
248
  readonly type = "ChannelCollectionChannel";
233
249
  IFluidDataStoreRegistry: IFluidDataStoreRegistry;
234
- constructor(registryEntries: NamedFluidDataStoreRegistryEntries, provideEntryPoint: (runtime: IFluidDataStoreChannel) => Promise<FluidObject>, ctor: (...args: ConstructorParameters<typeof ChannelCollection>) => T);
235
- get IFluidDataStoreFactory(): ChannelCollectionFactory<T>;
250
+ constructor(registryEntries: NamedFluidDataStoreRegistryEntries, provideEntryPoint: (runtime: IFluidDataStoreChannel) => Promise<FluidObject>);
251
+ get IFluidDataStoreFactory(): ChannelCollectionFactory;
236
252
  instantiateDataStore(context: IFluidDataStoreContext, _existing: boolean): Promise<IFluidDataStoreChannel>;
237
253
  }
238
254
  //# sourceMappingURL=channelCollection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EACN,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EACN,aAAa,EAEb,MAAM,6CAA6C,CAAC;AAMrD,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EAGX,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EAEnB,kCAAkC,EAElC,qBAAqB,EAIrB,KAAK,yBAAyB,EAC9B,MAAM,8CAA8C,CAAC;AAiBtD,OAAO,EAIN,iBAAiB,EAMjB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAEN,iBAAiB,EAEjB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAEN,8BAA8B,EAC9B,wCAAwC,EAExC,0BAA0B,EAG1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,m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,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,GACxE,IAAI,CAiCN;AAED;;GAEG;AACH,qBAAa,wBAAyB,YAAW,sBAAsB;IAQrE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAPnC,SAAgB,IAAI,8BAA8B;IAE3C,uBAAuB,EAAE,uBAAuB,CAAC;gBAGvD,eAAe,EAAE,kCAAkC,EAElC,iBAAiB,EAAE,CACnC,OAAO,EAAE,sBAAsB,KAC3B,OAAO,CAAC,WAAW,CAAC;IAK1B,IAAW,sBAAsB,IAAI,wBAAwB,CAE5D;IAEY,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,OAAO,GAChB,OAAO,CAAC,sBAAsB,CAAC;CA2BlC"}
@@ -32,7 +32,6 @@ exports.AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enu
32
32
  * Creates a shallow wrapper of {@link IFluidParentContext}. The wrapper can then have its methods overwritten as needed
33
33
  */
34
34
  function wrapContext(context) {
35
- const isReadOnly = context.isReadOnly;
36
35
  return {
37
36
  get IFluidDataStoreRegistry() {
38
37
  return context.IFluidDataStoreRegistry;
@@ -58,7 +57,7 @@ function wrapContext(context) {
58
57
  get attachState() {
59
58
  return context.attachState;
60
59
  },
61
- isReadOnly: isReadOnly === undefined ? undefined : () => isReadOnly(),
60
+ isReadOnly: () => context.isReadOnly(),
62
61
  containerRuntime: context.containerRuntime,
63
62
  scope: context.scope,
64
63
  gcThrowOnTombstoneUsage: context.gcThrowOnTombstoneUsage,
@@ -476,7 +475,7 @@ class ChannelCollection {
476
475
  get disposed() {
477
476
  return this.disposeOnce.evaluated;
478
477
  }
479
- reSubmit(type, content, localOpMetadata) {
478
+ reSubmit(type, content, localOpMetadata, squash) {
480
479
  switch (type) {
481
480
  case messageTypes_js_1.ContainerMessageType.Attach:
482
481
  case messageTypes_js_1.ContainerMessageType.Alias: {
@@ -484,14 +483,14 @@ class ChannelCollection {
484
483
  return;
485
484
  }
486
485
  case messageTypes_js_1.ContainerMessageType.FluidDataStoreOp: {
487
- return this.reSubmitChannelOp(type, content, localOpMetadata);
486
+ return this.reSubmitChannelOp(type, content, localOpMetadata, squash);
488
487
  }
489
488
  default: {
490
489
  (0, internal_1.assert)(false, 0x907 /* unknown op type */);
491
490
  }
492
491
  }
493
492
  }
494
- reSubmitChannelOp(type, content, localOpMetadata) {
493
+ reSubmitChannelOp(type, content, localOpMetadata, squash) {
495
494
  const envelope = content;
496
495
  const context = this.contexts.get(envelope.address);
497
496
  // If the data store has been deleted, log an error and throw an error. If there are local changes for a
@@ -504,7 +503,7 @@ class ChannelCollection {
504
503
  }
505
504
  (0, internal_1.assert)(!!context, 0x160 /* "There should be a store context for the op" */);
506
505
  const innerContents = envelope.contents;
507
- context.reSubmit(innerContents.type, innerContents.content, localOpMetadata);
506
+ context.reSubmit(innerContents.type, innerContents.content, localOpMetadata, squash);
508
507
  }
509
508
  rollback(type, content, localOpMetadata) {
510
509
  (0, internal_1.assert)(type === messageTypes_js_1.ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);
@@ -816,7 +815,7 @@ class ChannelCollection {
816
815
  notifyReadOnlyState(readonly) {
817
816
  for (const [fluidDataStoreId, context] of this.contexts) {
818
817
  try {
819
- context.notifyReadOnlyState(readonly);
818
+ context.notifyReadOnlyState();
820
819
  }
821
820
  catch (error) {
822
821
  this.mc.logger.sendErrorEvent({
@@ -825,13 +824,36 @@ class ChannelCollection {
825
824
  fluidDataStoreId,
826
825
  }),
827
826
  details: {
828
- runtimeReadonly: this.parentContext.isReadOnly?.(),
827
+ runtimeReadonly: this.parentContext.isReadOnly(),
829
828
  readonly,
830
829
  },
831
830
  }, error);
832
831
  }
833
832
  }
834
833
  }
834
+ /**
835
+ * Notifies all data store contexts about the current staging mode state.
836
+ *
837
+ * @param staging - A boolean indicating whether the container is in staging mode.
838
+ */
839
+ notifyStagingMode(staging) {
840
+ for (const [fluidDataStoreId, context] of this.contexts) {
841
+ try {
842
+ context.notifyStagingMode(staging);
843
+ }
844
+ catch (error) {
845
+ this.mc.logger.sendErrorEvent({
846
+ eventName: "notifyStagingModeError",
847
+ ...(0, internal_6.tagCodeArtifacts)({
848
+ fluidDataStoreId,
849
+ }),
850
+ details: {
851
+ staging,
852
+ },
853
+ }, error);
854
+ }
855
+ }
856
+ }
835
857
  setAttachState(attachState) {
836
858
  for (const [, context] of this.contexts) {
837
859
  // Fire only for bounded stores.
@@ -1219,9 +1241,8 @@ exports.detectOutboundReferences = detectOutboundReferences;
1219
1241
  class ChannelCollectionFactory {
1220
1242
  constructor(registryEntries,
1221
1243
  // ADO:7302 We need a better type here
1222
- provideEntryPoint, ctor) {
1244
+ provideEntryPoint) {
1223
1245
  this.provideEntryPoint = provideEntryPoint;
1224
- this.ctor = ctor;
1225
1246
  this.type = "ChannelCollectionChannel";
1226
1247
  this.IFluidDataStoreRegistry = new dataStoreRegistry_js_1.FluidDataStoreRegistry(registryEntries);
1227
1248
  }
@@ -1229,7 +1250,17 @@ class ChannelCollectionFactory {
1229
1250
  return this;
1230
1251
  }
1231
1252
  async instantiateDataStore(context, _existing) {
1232
- const runtime = this.ctor(context.baseSnapshot, context, // parentContext
1253
+ // when work is done to complete nested datastores
1254
+ // this class should move to a new package
1255
+ // and IFluidDataStoreContext will need to support
1256
+ // all the cross layer needs of the channel context,
1257
+ // and the below assert should be removed.
1258
+ //
1259
+ // for now this will continue to work if both
1260
+ // this factory and the container runtime are
1261
+ // from the same package.
1262
+ (0, internal_1.assert)(context instanceof dataStoreContext_js_1.FluidDataStoreContext, 0xb8f /* we don't support the layer boundary here today */);
1263
+ const runtime = new ChannelCollection(context.baseSnapshot, context, // parentContext
1233
1264
  context.baseLogger, () => { }, // gcNodeUpdated
1234
1265
  (_nodePath) => false, // isDataStoreDeleted
1235
1266
  new Map(), // aliasMap