@fluidframework/container-runtime 2.0.0-internal.7.1.0 → 2.0.0-internal.7.2.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 (207) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-extractor.json +1 -13
  3. package/api-report/container-runtime.api.md +75 -10
  4. package/dist/blobManager.d.ts +4 -6
  5. package/dist/blobManager.d.ts.map +1 -1
  6. package/dist/blobManager.js +42 -56
  7. package/dist/blobManager.js.map +1 -1
  8. package/dist/containerRuntime.d.ts +71 -23
  9. package/dist/containerRuntime.d.ts.map +1 -1
  10. package/dist/containerRuntime.js +72 -32
  11. package/dist/containerRuntime.js.map +1 -1
  12. package/dist/dataStore.js +2 -2
  13. package/dist/dataStore.js.map +1 -1
  14. package/dist/dataStoreContext.d.ts +8 -2
  15. package/dist/dataStoreContext.d.ts.map +1 -1
  16. package/dist/dataStoreContext.js +15 -8
  17. package/dist/dataStoreContext.js.map +1 -1
  18. package/dist/dataStoreRegistry.d.ts +3 -0
  19. package/dist/dataStoreRegistry.d.ts.map +1 -1
  20. package/dist/dataStoreRegistry.js +3 -0
  21. package/dist/dataStoreRegistry.js.map +1 -1
  22. package/dist/dataStores.d.ts +0 -2
  23. package/dist/dataStores.d.ts.map +1 -1
  24. package/dist/dataStores.js +2 -7
  25. package/dist/dataStores.js.map +1 -1
  26. package/dist/deltaManagerProxyBase.d.ts +1 -1
  27. package/dist/deltaManagerProxyBase.d.ts.map +1 -1
  28. package/dist/deltaManagerProxyBase.js +2 -2
  29. package/dist/deltaManagerProxyBase.js.map +1 -1
  30. package/dist/gc/garbageCollection.d.ts +6 -0
  31. package/dist/gc/garbageCollection.d.ts.map +1 -1
  32. package/dist/gc/garbageCollection.js +16 -3
  33. package/dist/gc/garbageCollection.js.map +1 -1
  34. package/dist/gc/gcConfigs.d.ts +1 -0
  35. package/dist/gc/gcConfigs.d.ts.map +1 -1
  36. package/dist/gc/gcConfigs.js +12 -2
  37. package/dist/gc/gcConfigs.js.map +1 -1
  38. package/dist/gc/gcDefinitions.d.ts +40 -9
  39. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  40. package/dist/gc/gcDefinitions.js +4 -1
  41. package/dist/gc/gcDefinitions.js.map +1 -1
  42. package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
  43. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  44. package/dist/gc/gcTelemetry.d.ts +2 -3
  45. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  46. package/dist/gc/gcTelemetry.js +7 -8
  47. package/dist/gc/gcTelemetry.js.map +1 -1
  48. package/dist/gc/index.d.ts +2 -2
  49. package/dist/gc/index.d.ts.map +1 -1
  50. package/dist/gc/index.js +1 -5
  51. package/dist/gc/index.js.map +1 -1
  52. package/dist/id-compressor/utilities.d.ts +3 -0
  53. package/dist/id-compressor/utilities.d.ts.map +1 -1
  54. package/dist/id-compressor/utilities.js +3 -0
  55. package/dist/id-compressor/utilities.js.map +1 -1
  56. package/dist/index.d.ts +3 -2
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +3 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/messageTypes.d.ts +4 -1
  61. package/dist/messageTypes.d.ts.map +1 -1
  62. package/dist/messageTypes.js +3 -0
  63. package/dist/messageTypes.js.map +1 -1
  64. package/dist/opLifecycle/definitions.d.ts +3 -0
  65. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  66. package/dist/opLifecycle/definitions.js.map +1 -1
  67. package/dist/packageVersion.d.ts +1 -1
  68. package/dist/packageVersion.js +1 -1
  69. package/dist/packageVersion.js.map +1 -1
  70. package/dist/summary/orderedClientElection.d.ts +4 -1
  71. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  72. package/dist/summary/orderedClientElection.js.map +1 -1
  73. package/dist/summary/runWhileConnectedCoordinator.d.ts +5 -0
  74. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  75. package/dist/summary/runWhileConnectedCoordinator.js +1 -0
  76. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  77. package/dist/summary/summarizer.d.ts +1 -0
  78. package/dist/summary/summarizer.d.ts.map +1 -1
  79. package/dist/summary/summarizer.js +1 -0
  80. package/dist/summary/summarizer.js.map +1 -1
  81. package/dist/summary/summarizerTypes.d.ts +94 -10
  82. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  83. package/dist/summary/summarizerTypes.js.map +1 -1
  84. package/dist/summary/summaryCollection.d.ts +16 -0
  85. package/dist/summary/summaryCollection.d.ts.map +1 -1
  86. package/dist/summary/summaryCollection.js +1 -0
  87. package/dist/summary/summaryCollection.js.map +1 -1
  88. package/dist/summary/summaryFormat.d.ts +10 -1
  89. package/dist/summary/summaryFormat.d.ts.map +1 -1
  90. package/dist/summary/summaryFormat.js.map +1 -1
  91. package/lib/blobManager.d.ts +4 -6
  92. package/lib/blobManager.d.ts.map +1 -1
  93. package/lib/blobManager.js +44 -58
  94. package/lib/blobManager.js.map +1 -1
  95. package/lib/containerRuntime.d.ts +71 -23
  96. package/lib/containerRuntime.d.ts.map +1 -1
  97. package/lib/containerRuntime.js +73 -33
  98. package/lib/containerRuntime.js.map +1 -1
  99. package/lib/dataStore.js +2 -2
  100. package/lib/dataStore.js.map +1 -1
  101. package/lib/dataStoreContext.d.ts +8 -2
  102. package/lib/dataStoreContext.d.ts.map +1 -1
  103. package/lib/dataStoreContext.js +16 -9
  104. package/lib/dataStoreContext.js.map +1 -1
  105. package/lib/dataStoreRegistry.d.ts +3 -0
  106. package/lib/dataStoreRegistry.d.ts.map +1 -1
  107. package/lib/dataStoreRegistry.js +3 -0
  108. package/lib/dataStoreRegistry.js.map +1 -1
  109. package/lib/dataStores.d.ts +0 -2
  110. package/lib/dataStores.d.ts.map +1 -1
  111. package/lib/dataStores.js +3 -8
  112. package/lib/dataStores.js.map +1 -1
  113. package/lib/deltaManagerProxyBase.d.ts +1 -1
  114. package/lib/deltaManagerProxyBase.d.ts.map +1 -1
  115. package/lib/deltaManagerProxyBase.js +2 -2
  116. package/lib/deltaManagerProxyBase.js.map +1 -1
  117. package/lib/gc/garbageCollection.d.ts +6 -0
  118. package/lib/gc/garbageCollection.d.ts.map +1 -1
  119. package/lib/gc/garbageCollection.js +16 -3
  120. package/lib/gc/garbageCollection.js.map +1 -1
  121. package/lib/gc/gcConfigs.d.ts +1 -0
  122. package/lib/gc/gcConfigs.d.ts.map +1 -1
  123. package/lib/gc/gcConfigs.js +14 -4
  124. package/lib/gc/gcConfigs.js.map +1 -1
  125. package/lib/gc/gcDefinitions.d.ts +40 -9
  126. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  127. package/lib/gc/gcDefinitions.js +4 -1
  128. package/lib/gc/gcDefinitions.js.map +1 -1
  129. package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
  130. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  131. package/lib/gc/gcTelemetry.d.ts +2 -3
  132. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  133. package/lib/gc/gcTelemetry.js +7 -8
  134. package/lib/gc/gcTelemetry.js.map +1 -1
  135. package/lib/gc/index.d.ts +2 -2
  136. package/lib/gc/index.d.ts.map +1 -1
  137. package/lib/gc/index.js +2 -2
  138. package/lib/gc/index.js.map +1 -1
  139. package/lib/id-compressor/utilities.d.ts +3 -0
  140. package/lib/id-compressor/utilities.d.ts.map +1 -1
  141. package/lib/id-compressor/utilities.js +3 -0
  142. package/lib/id-compressor/utilities.js.map +1 -1
  143. package/lib/index.d.ts +3 -2
  144. package/lib/index.d.ts.map +1 -1
  145. package/lib/index.js +1 -0
  146. package/lib/index.js.map +1 -1
  147. package/lib/messageTypes.d.ts +4 -1
  148. package/lib/messageTypes.d.ts.map +1 -1
  149. package/lib/messageTypes.js +3 -0
  150. package/lib/messageTypes.js.map +1 -1
  151. package/lib/opLifecycle/definitions.d.ts +3 -0
  152. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  153. package/lib/opLifecycle/definitions.js.map +1 -1
  154. package/lib/packageVersion.d.ts +1 -1
  155. package/lib/packageVersion.js +1 -1
  156. package/lib/packageVersion.js.map +1 -1
  157. package/lib/summary/orderedClientElection.d.ts +4 -1
  158. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  159. package/lib/summary/orderedClientElection.js.map +1 -1
  160. package/lib/summary/runWhileConnectedCoordinator.d.ts +5 -0
  161. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  162. package/lib/summary/runWhileConnectedCoordinator.js +1 -0
  163. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  164. package/lib/summary/summarizer.d.ts +1 -0
  165. package/lib/summary/summarizer.d.ts.map +1 -1
  166. package/lib/summary/summarizer.js +1 -0
  167. package/lib/summary/summarizer.js.map +1 -1
  168. package/lib/summary/summarizerTypes.d.ts +94 -10
  169. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  170. package/lib/summary/summarizerTypes.js.map +1 -1
  171. package/lib/summary/summaryCollection.d.ts +16 -0
  172. package/lib/summary/summaryCollection.d.ts.map +1 -1
  173. package/lib/summary/summaryCollection.js +1 -0
  174. package/lib/summary/summaryCollection.js.map +1 -1
  175. package/lib/summary/summaryFormat.d.ts +10 -1
  176. package/lib/summary/summaryFormat.d.ts.map +1 -1
  177. package/lib/summary/summaryFormat.js.map +1 -1
  178. package/package.json +25 -22
  179. package/src/blobManager.ts +61 -74
  180. package/src/containerRuntime.ts +103 -50
  181. package/src/dataStore.ts +2 -2
  182. package/src/dataStoreContext.ts +16 -9
  183. package/src/dataStoreRegistry.ts +3 -0
  184. package/src/dataStores.ts +4 -16
  185. package/src/deltaManagerProxyBase.ts +2 -2
  186. package/src/gc/garbageCollection.ts +18 -3
  187. package/src/gc/gcConfigs.ts +22 -4
  188. package/src/gc/gcDefinitions.ts +41 -9
  189. package/src/gc/gcSummaryDefinitions.ts +1 -1
  190. package/src/gc/gcTelemetry.ts +8 -8
  191. package/src/gc/index.ts +0 -4
  192. package/src/id-compressor/utilities.ts +3 -0
  193. package/src/index.ts +13 -1
  194. package/src/messageTypes.ts +4 -1
  195. package/src/opLifecycle/definitions.ts +3 -0
  196. package/src/packageVersion.ts +1 -1
  197. package/src/summary/orderedClientElection.ts +4 -1
  198. package/src/summary/runWhileConnectedCoordinator.ts +5 -1
  199. package/src/summary/summarizer.ts +1 -0
  200. package/src/summary/summarizerTypes.ts +95 -11
  201. package/src/summary/summaryCollection.ts +18 -1
  202. package/src/summary/summaryFormat.ts +11 -1
  203. package/dist/container-runtime-alpha.d.ts +0 -1554
  204. package/dist/container-runtime-beta.d.ts +0 -1554
  205. package/dist/container-runtime-public.d.ts +0 -1554
  206. package/dist/container-runtime.d.ts +0 -1611
  207. package/src/gc/gcEarlyAdoption.md +0 -145
@@ -1 +1 @@
1
- {"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAQlC,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKjG,OAAO,EAAE,WAAW,EAA2B,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EACN,4BAA4B,EAC5B,YAAY,EACZ,YAAY,EAEZ,gBAAgB,GAChB,MAAM,iCAAiC,CAAC;AAOzC,OAAO,EAAoB,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EACN,0BAA0B,EAC1B,6BAA6B,EAC7B,uBAAuB,GACvB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAc,MAAM,aAAa,CAAC;AACvE,OAAO,EA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yright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tICreateBlobResponse,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tcreateResponseError,\n\tgenerateHandleContextPath,\n\tresponseToException,\n\tSummaryTreeBuilder,\n} from \"@fluidframework/runtime-utils\";\nimport { assert, Deferred } from \"@fluidframework/core-utils\";\nimport { bufferToString, stringToBuffer, TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tIContainerRuntime,\n\tIContainerRuntimeEvents,\n} from \"@fluidframework/container-runtime-definitions\";\nimport { AttachState, ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tcreateChildMonitoringContext,\n\tGenericError,\n\tLoggingError,\n\tMonitoringContext,\n\tPerformanceEvent,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\n\nimport { ContainerRuntime, TombstoneResponseHeaderKey } from \"./containerRuntime\";\nimport {\n\tsendGCUnexpectedUsageEvent,\n\tdisableAttachmentBlobSweepKey,\n\tthrowOnTombstoneLoadKey,\n} from \"./gc\";\nimport { Throttler, formExponentialFn, IThrottler } from \"./throttler\";\nimport { summarizerClientType } from \"./summary\";\nimport { IBlobMetadata } from \"./metadata\";\n\n/**\n * This class represents blob (long string)\n * This object is used only when creating (writing) new blob and serialization purposes.\n * De-serialization process goes through FluidObjectHandle and request flow:\n * DataObject.request() recognizes requests in the form of `/blobs/<id>`\n * and loads blob.\n */\nexport class BlobHandle implements IFluidHandle<ArrayBufferLike> {\n\tprivate attached: boolean = false;\n\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\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<any>,\n\t\tprivate readonly onAttachGraph?: () => void,\n\t) {\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\tpublic attachGraph() {\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: IFluidHandle) {\n\t\tthrow new Error(\"Cannot bind to blob handle\");\n\t}\n}\n\nclass CancellableThrottler {\n\tconstructor(private readonly throttler: IThrottler) {}\n\tprivate cancelP = new Deferred<void>();\n\n\tpublic async getDelay(): Promise<void> {\n\t\treturn Promise.race([\n\t\t\tthis.cancelP.promise,\n\t\t\tnew Promise<void>((resolve) => setTimeout(resolve, this.throttler.getDelay())),\n\t\t]);\n\t}\n\n\tpublic cancel() {\n\t\tthis.cancelP.resolve();\n\t\tthis.cancelP = new Deferred<void>();\n\t}\n}\n\n/**\n * Information from a snapshot needed to load BlobManager\n */\nexport interface IBlobManagerLoadInfo {\n\tids?: string[];\n\tredirectTable?: [string, string][];\n}\n\n// Restrict the IContainerRuntime interface to the subset required by BlobManager. This helps to make\n// the contract explicit and reduces the amount of mocking required for tests.\nexport type IBlobManagerRuntime = Pick<\n\tIContainerRuntime,\n\t\"attachState\" | \"connected\" | \"logger\" | \"clientDetails\"\n> &\n\tPick<ContainerRuntime, \"gcTombstoneEnforcementAllowed\"> &\n\tTypedEventEmitter<IContainerRuntimeEvents>;\n\ntype ICreateBlobResponseWithTTL = ICreateBlobResponse & Partial<Record<\"minTTLInSeconds\", number>>;\n\ninterface PendingBlob {\n\tblob: ArrayBufferLike;\n\tuploading?: boolean;\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\tpendingStashed?: boolean;\n}\n\nexport interface IPendingBlobs {\n\t[id: string]: {\n\t\tblob: string;\n\t\tstorageId?: string;\n\t\tuploadTime?: number;\n\t\tminTTLInSeconds?: number;\n\t\tattached?: boolean;\n\t\tacked?: boolean;\n\t};\n}\n\nexport interface IBlobManagerEvents {\n\t(event: \"noPendingBlobs\", listener: () => void);\n}\n\nexport class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {\n\tpublic static readonly basePath = \"_blobs\";\n\tprivate static readonly redirectTableBlobName = \".redirectTable\";\n\tprivate readonly mc: MonitoringContext;\n\n\t/**\n\t * Map of local IDs to storage IDs. Contains identity entries (id → id) 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, string[]> = new Map();\n\n\tprivate readonly retryThrottler = new CancellableThrottler(\n\t\tnew Throttler(\n\t\t\t60 * 1000, // 60 sec delay window\n\t\t\t30 * 1000, // 30 sec max delay\n\t\t\t// throttling function increases exponentially (0ms, 40ms, 80ms, 160ms, etc)\n\t\t\tformExponentialFn({ coefficient: 20, initialDelay: 0 }),\n\t\t),\n\t);\n\n\t/** If true, throw an error when a tombstone attachment blob is retrieved. */\n\tprivate readonly throwOnTombstoneLoad: boolean;\n\t/**\n\t * This stores IDs of tombstoned blobs.\n\t * Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.\n\t */\n\tprivate readonly tombstonedBlobs: Set<string> = new Set();\n\n\tprivate readonly sendBlobAttachOp: (localId: string, storageId?: string) => void;\n\n\tconstructor(\n\t\tprivate readonly routeContext: IFluidHandleContext,\n\t\tsnapshot: IBlobManagerLoadInfo,\n\t\tprivate readonly getStorage: () => 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 - `/<BlobManager.basePath>/<blobId>`.\n\t\tprivate readonly blobRequested: (blobPath: string) => void,\n\t\t// Called to check if a blob has been deleted by GC.\n\t\t// blobPath's format - `/<BlobManager.basePath>/<blobId>`.\n\t\tprivate readonly isBlobDeleted: (blobPath: string) => boolean,\n\t\tprivate readonly runtime: IBlobManagerRuntime,\n\t\tstashedBlobs: IPendingBlobs = {},\n\t\tprivate readonly closeContainer: (error?: ICriticalContainerError) => void,\n\t) {\n\t\tsuper();\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: this.runtime.logger,\n\t\t\tnamespace: \"BlobManager\",\n\t\t});\n\t\t// Read the feature flag that tells whether to throw when a tombstone blob is requested.\n\t\tthis.throwOnTombstoneLoad =\n\t\t\tthis.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&\n\t\t\tthis.runtime.gcTombstoneEnforcementAllowed &&\n\t\t\tthis.runtime.clientDetails.type !== summarizerClientType;\n\n\t\tthis.redirectTable = this.load(snapshot);\n\n\t\t// Begin uploading stashed blobs from previous container instance\n\t\tObject.entries(stashedBlobs).forEach(([localId, entry]) => {\n\t\t\tconst blob = stringToBuffer(entry.blob, \"base64\");\n\t\t\tconst attached = entry.attached;\n\t\t\tconst acked = entry.acked;\n\t\t\tconst storageId = entry.storageId; // entry.storageId = response.id\n\t\t\tif (entry.minTTLInSeconds && entry.uploadTime) {\n\t\t\t\tconst timeLapseSinceLocalUpload = (Date.now() - entry.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 (entry.minTTLInSeconds - timeLapseSinceLocalUpload > entry.minTTLInSeconds / 2) {\n\t\t\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\t\t\tblob,\n\t\t\t\t\t\tuploading: false,\n\t\t\t\t\t\topsent: true,\n\t\t\t\t\t\thandleP: new Deferred(),\n\t\t\t\t\t\tstorageId,\n\t\t\t\t\t\tuploadP: undefined,\n\t\t\t\t\t\tuploadTime: entry.uploadTime,\n\t\t\t\t\t\tminTTLInSeconds: entry.minTTLInSeconds,\n\t\t\t\t\t\tattached,\n\t\t\t\t\t\tacked,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\tblob,\n\t\t\t\tuploading: true,\n\t\t\t\thandleP: new Deferred(),\n\t\t\t\tuploadP: this.uploadBlob(localId, blob),\n\t\t\t\tattached,\n\t\t\t\tacked,\n\t\t\t\topsent: true,\n\t\t\t\tpendingStashed: true,\n\t\t\t});\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// we want to avoid submitting ops with broken handles\n\t\t\t\t\tthis.closeContainer(\n\t\t\t\t\t\tnew GenericError(\n\t\t\t\t\t\t\t\"Trying to submit a BlobAttach for expired blob\",\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlocalId,\n\t\t\t\t\t\t\t\tblobId,\n\t\t\t\t\t\t\t\tsecondsSinceUpload,\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}\n\t\t\t}\n\t\t\tpendingEntry.opsent = true;\n\t\t\treturn sendBlobAttachOp(localId, blobId);\n\t\t};\n\t}\n\n\tpublic get allBlobsAttached(): boolean {\n\t\tfor (const [, entry] of this.pendingBlobs) {\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) {\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 hasPendingStashedBlobs(): boolean {\n\t\treturn Array.from(this.pendingBlobs.values()).some((e) => e.pendingStashed === true);\n\t}\n\t/**\n\t * Upload blobs added while offline. This must be completed before connecting and resubmitting ops.\n\t */\n\tpublic async processStashedChanges() {\n\t\tthis.retryThrottler.cancel();\n\t\tconst pendingUploads = Array.from(this.pendingBlobs.values())\n\t\t\t.filter((e) => e.pendingStashed === true)\n\t\t\t.map(async (e) => e.uploadP);\n\t\tawait PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{\n\t\t\t\teventName: \"BlobUploadProcessStashedChanges\",\n\t\t\t\tcount: pendingUploads.length,\n\t\t\t},\n\t\t\tasync () => Promise.all(pendingUploads),\n\t\t\t{ start: true, end: true },\n\t\t);\n\t}\n\n\t/**\n\t * Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is\n\t * detached or there are no (non-pending) attachment blobs in the document\n\t */\n\tprivate get storageIds(): Set<string> {\n\t\tconst ids = new Set<string | undefined>(this.redirectTable.values());\n\n\t\t// If we are detached, we will not have storage IDs, only undefined\n\t\tconst undefinedValueInTable = ids.delete(undefined);\n\n\t\t// For a detached container, entries are inserted into the redirect table with an undefined storage ID.\n\t\t// For an attached container, entries are inserted w/storage ID after the BlobAttach op round-trips.\n\t\tassert(\n\t\t\t!undefinedValueInTable ||\n\t\t\t\t(this.runtime.attachState === AttachState.Detached && ids.size === 0),\n\t\t\t0x382 /* 'redirectTable' must contain only undefined while detached / defined values while attached */,\n\t\t);\n\n\t\treturn ids as Set<string>;\n\t}\n\n\tpublic async getBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\t// Verify that the blob is valid, i.e., it has not been garbage collected. If it is, this will throw an error,\n\t\t// failing the call.\n\t\tthis.verifyBlobValidity(blobId);\n\n\t\tconst pending = this.pendingBlobs.get(blobId);\n\t\tif (pending) {\n\t\t\treturn pending.blob;\n\t\t}\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\tassert(!!attachedStorageId, 0x11f /* \"requesting unknown blobs\" */);\n\t\t\tstorageId = attachedStorageId;\n\t\t}\n\n\t\t// Let runtime know that the corresponding GC node was requested.\n\t\tthis.blobRequested(getGCNodePathFromBlobId(blobId));\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"AttachmentReadBlob\", id: storageId },\n\t\t\tasync () => {\n\t\t\t\treturn this.getStorage().readBlob(storageId);\n\t\t\t},\n\t\t\t{ end: true, cancel: \"error\" },\n\t\t);\n\t}\n\n\tprivate getBlobHandle(id: string): BlobHandle {\n\t\tassert(\n\t\t\tthis.redirectTable.has(id) || this.pendingBlobs.has(id),\n\t\t\t0x384 /* requesting handle for unknown blob */,\n\t\t);\n\t\tconst pending = this.pendingBlobs.get(id);\n\t\tconst callback = pending\n\t\t\t? () => {\n\t\t\t\t\tpending.attached = true;\n\t\t\t\t\tthis.emit(\"blobAttached\", pending);\n\t\t\t\t\tthis.deletePendingBlobMaybe(id);\n\t\t\t }\n\t\t\t: undefined;\n\t\treturn new BlobHandle(\n\t\t\t`${BlobManager.basePath}/${id}`,\n\t\t\tthis.routeContext,\n\t\t\tasync () => this.getBlob(id),\n\t\t\tcallback,\n\t\t);\n\t}\n\n\tprivate async createBlobDetached(\n\t\tblob: ArrayBufferLike,\n\t): Promise<IFluidHandle<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.getStorage().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<IFluidHandle<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 = uuid();\n\t\tconst pendingEntry: PendingBlob = {\n\t\t\tblob,\n\t\t\tuploading: true,\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 = () => {\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 PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"createBlob\" },\n\t\t\tasync () => this.getStorage().createBlob(blob),\n\t\t\t{ end: true, cancel: this.runtime.connected ? \"error\" : \"generic\" },\n\t\t).then(\n\t\t\t(response) => this.onUploadResolve(localId, response),\n\t\t\tasync (err) => this.onUploadReject(localId, err),\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) {\n\t\tthis.redirectTable.set(fromId, toId);\n\t}\n\n\tprivate deletePendingBlobMaybe(id: string) {\n\t\tif (this.pendingBlobs.has(id)) {\n\t\t\tconst entry = this.pendingBlobs.get(id);\n\t\t\tif (entry?.attached && entry?.acked) {\n\t\t\t\tthis.deletePendingBlob(id);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate deletePendingBlob(id: string) {\n\t\tif (this.pendingBlobs.delete(id) && !this.hasPendingBlobs) {\n\t\t\tthis.emit(\"noPendingBlobs\");\n\t\t}\n\t}\n\n\tprivate onUploadResolve(localId: string, response: ICreateBlobResponseWithTTL) {\n\t\tconst entry = this.pendingBlobs.get(localId);\n\t\tassert(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);\n\t\tif (entry.abortSignal?.aborted === true && !entry.opsent) {\n\t\t\tthis.deletePendingBlob(localId);\n\t\t\treturn;\n\t\t}\n\t\tassert(\n\t\t\tentry.uploading === true,\n\t\t\t0x386 /* Must have pending blob entry for uploaded blob */,\n\t\t);\n\t\tentry.storageId = response.id;\n\t\tentry.uploadTime = Date.now();\n\t\tentry.minTTLInSeconds = response.minTTLInSeconds;\n\t\t// Send a blob attach op. This serves two purposes:\n\t\t// 1. If its a new blob, i.e., it isn't de-duped, the server will keep the blob alive if it sees this op\n\t\t// until its storage ID is added to the next summary.\n\t\t// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the\n\t\t// blob from the server via the storage ID.\n\t\tif (!entry.opsent) {\n\t\t\tthis.sendBlobAttachOp(localId, response.id);\n\t\t}\n\t\tif (this.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\tthis.opsInFlight.set(\n\t\t\t\tresponse.id,\n\t\t\t\t(this.opsInFlight.get(response.id) ?? []).concat(localId),\n\t\t\t);\n\t\t}\n\t\treturn response;\n\t}\n\n\tprivate async onUploadReject(localId: string, error: any) {\n\t\tconst entry = this.pendingBlobs.get(localId);\n\t\tassert(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);\n\t\tif (entry.abortSignal?.aborted === true && !entry.opsent) {\n\t\t\tthis.deletePendingBlob(localId);\n\t\t\treturn;\n\t\t}\n\t\tif (!this.runtime.connected) {\n\t\t\t// we are probably not connected to storage but start another upload request in case we are\n\t\t\tentry.uploadP = this.retryThrottler\n\t\t\t\t.getDelay()\n\t\t\t\t.then(async () => this.uploadBlob(localId, entry.blob));\n\t\t\treturn entry.uploadP;\n\t\t} else {\n\t\t\tthis.deletePendingBlob(localId);\n\t\t\tentry.handleP.reject(error);\n\t\t}\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) {\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 processBlobAttachOp(message: ISequencedDocumentMessage, local: boolean) {\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\tif (pendingEntry?.pendingStashed) {\n\t\t\t\tpendingEntry.pendingStashed = false;\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\twaitingBlobs.forEach((pendingLocalId) => {\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}\n\n\t/**\n\t * Reads blobs needed to load BlobManager from storage.\n\t * @param blobsTree - Tree containing IDs of previously attached blobs. We\n\t * look for the IDs in the blob entries of the tree since the both the r11s\n\t * and SPO drivers replace the attachment types returned in snapshot() with blobs.\n\t */\n\tpublic static async load(\n\t\tblobsTree: ISnapshotTree | undefined,\n\t\ttryFetchBlob: (id: string) => Promise<[string, string][]>,\n\t): Promise<IBlobManagerLoadInfo> {\n\t\tif (!blobsTree) {\n\t\t\treturn {};\n\t\t}\n\t\tlet redirectTable;\n\t\tconst tableId = blobsTree.blobs[this.redirectTableBlobName];\n\t\tif (tableId) {\n\t\t\tredirectTable = await tryFetchBlob(tableId);\n\t\t}\n\t\tconst ids = Object.entries(blobsTree.blobs)\n\t\t\t.filter(([k, _]) => k !== this.redirectTableBlobName)\n\t\t\t.map(([_, v]) => v);\n\t\treturn { ids, redirectTable };\n\t}\n\n\t/**\n\t * Load a set of previously attached blob IDs and redirect table from a previous snapshot.\n\t */\n\tprivate load(snapshot: IBlobManagerLoadInfo): Map<string, string | undefined> {\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName: \"AttachmentBlobsLoaded\",\n\t\t\tcount: snapshot.ids?.length ?? 0,\n\t\t\tredirectTable: snapshot.redirectTable?.length,\n\t\t});\n\t\tconst table = new Map<string, string | undefined>(snapshot.redirectTable);\n\t\tif (snapshot.ids) {\n\t\t\tconst detached = this.runtime.attachState === AttachState.Detached;\n\t\t\t// If we are detached, we don't have storage IDs yet, so set to undefined\n\t\t\t// Otherwise, set identity (id -> id) entries\n\t\t\tsnapshot.ids.forEach((entry) => table.set(entry, detached ? undefined : entry));\n\t\t}\n\t\treturn table;\n\t}\n\n\tpublic summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\t// if storageIds is empty, it means we are detached and have only local IDs, or that there are no blobs attached\n\t\tconst blobIds =\n\t\t\tthis.storageIds.size > 0\n\t\t\t\t? Array.from(this.storageIds)\n\t\t\t\t: Array.from(this.redirectTable.keys());\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tblobIds.forEach((blobId) => {\n\t\t\tbuilder.addAttachment(blobId);\n\t\t});\n\n\t\t// Any non-identity entries in the table need to be saved in the summary\n\t\tif (this.redirectTable.size > blobIds.length) {\n\t\t\tbuilder.addBlob(\n\t\t\t\tBlobManager.redirectTableBlobName,\n\t\t\t\t// filter out identity entries\n\t\t\t\tJSON.stringify(\n\t\t\t\t\tArray.from(this.redirectTable.entries()).filter(\n\t\t\t\t\t\t([localId, storageId]) => localId !== storageId,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn builder.getSummaryTree();\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 * This is called to update blobs whose routes are unused. The unused blobs are deleted.\n\t * @param unusedRoutes - The routes of the blob nodes that are unused. These routes will be based off of local ids.\n\t */\n\tpublic updateUnusedRoutes(unusedRoutes: string[]): void {\n\t\tthis.deleteBlobsFromRedirectTable(unusedRoutes);\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: string[]): string[] {\n\t\t// If sweep for attachment blobs is not enabled, return empty list indicating nothing is deleted.\n\t\tif (this.mc.config.getBoolean(disableAttachmentBlobSweepKey) === true) {\n\t\t\treturn [];\n\t\t}\n\n\t\tthis.deleteBlobsFromRedirectTable(sweepReadyBlobRoutes);\n\t\treturn Array.from(sweepReadyBlobRoutes);\n\t}\n\n\t/**\n\t * Delete blobs with the given routes from the redirect table.\n\t * The routes are GC nodes paths of format -`/<BlobManager.basePath>/<blobId>`. The blob ids are all local ids.\n\t * Deleting the blobs involves 2 steps:\n\t * 1. The redirect table entry for the local ids are deleted.\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: string[]) {\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\tif (!this.redirectTable.has(blobId)) {\n\t\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\t\teventName: \"DeletedAttachmentBlobNotFound\",\n\t\t\t\t\tblobId,\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 * This is called to update blobs whose routes are tombstones. Tombstoned blobs enable testing scenarios with\n\t * accessing deleted content without actually deleting content from summaries.\n\t * @param tombstonedRoutes - The routes of blob nodes that are tombstones.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: string[]) {\n\t\tconst tombstonedBlobsSet: Set<string> = new Set();\n\t\t// The routes or blob node paths are in the same format as returned in getGCData -\n\t\t// `/<BlobManager.basePath>/<blobId>`.\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst blobId = getBlobIdFromGCNodePath(route);\n\t\t\ttombstonedBlobsSet.add(blobId);\n\t\t}\n\n\t\t// Remove blobs from the tombstone list that were tombstoned but aren't anymore as per the tombstoneRoutes.\n\t\tfor (const blobId of this.tombstonedBlobs) {\n\t\t\tif (!tombstonedBlobsSet.has(blobId)) {\n\t\t\t\tthis.tombstonedBlobs.delete(blobId);\n\t\t\t}\n\t\t}\n\n\t\t// Mark blobs that are now tombstoned by adding them to the tombstone list.\n\t\tfor (const blobId of tombstonedBlobsSet) {\n\t\t\tthis.tombstonedBlobs.add(blobId);\n\t\t}\n\t}\n\n\t/**\n\t * Verifies that the blob with given id is valid, 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 verifyBlobValidity(blobId: string) {\n\t\t/**\n\t\t * A blob can be in one of the following states:\n\t\t * 1. \"deleted\" - It has been deleted by garbage collection sweep phase.\n\t\t * 2. \"tombstoned\" - It is ready for deletion but sweep phase isn't enabled and tombstone feature is enabled.\n\t\t * 3. \"valid\" - It has not been deleted or tombstoned.\n\t\t */\n\t\tlet state: \"valid\" | \"tombstoned\" | \"deleted\" = \"valid\";\n\t\tif (this.isBlobDeleted(getGCNodePathFromBlobId(blobId))) {\n\t\t\tstate = \"deleted\";\n\t\t} else if (this.tombstonedBlobs.has(blobId)) {\n\t\t\tstate = \"tombstoned\";\n\t\t}\n\n\t\tif (state === \"valid\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the blob is deleted or throw on tombstone load is enabled, throw an error which will fail any attempt\n\t\t// to load the blob.\n\t\tconst shouldFail = state === \"deleted\" || this.throwOnTombstoneLoad;\n\t\tconst request = { url: blobId };\n\t\tconst error = responseToException(\n\t\t\tcreateResponseError(\n\t\t\t\t404,\n\t\t\t\t\"Blob was deleted\",\n\t\t\t\trequest,\n\t\t\t\tstate === \"tombstoned\" ? { [TombstoneResponseHeaderKey]: true } : undefined,\n\t\t\t),\n\t\t\trequest,\n\t\t);\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName:\n\t\t\t\t\tstate === \"tombstoned\"\n\t\t\t\t\t\t? \"GC_Tombstone_Blob_Requested\"\n\t\t\t\t\t\t: \"GC_Deleted_Blob_Requested\",\n\t\t\t\tcategory: shouldFail ? \"error\" : \"generic\",\n\t\t\t\tgcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,\n\t\t\t},\n\t\t\t[BlobManager.basePath],\n\t\t\terror,\n\t\t);\n\t\tif (shouldFail) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic setRedirectTable(table: Map<string, string>) {\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(\n\t\t\t\tthis.redirectTable.has(localId),\n\t\t\t\t0x254 /* \"unrecognized id in redirect table\" */,\n\t\t\t);\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\tpublic async attachAndGetPendingBlobs(): 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\twhile (localBlobs.size < this.pendingBlobs.size) {\n\t\t\t\t\tconst attachBlobsP: Promise<void>[] = [];\n\t\t\t\t\tfor (const [id, 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\tif (!entry.opsent) {\n\t\t\t\t\t\t\t\tthis.sendBlobAttachOp(id, entry.storageId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tentry.handleP.resolve(this.getBlobHandle(id));\n\t\t\t\t\t\t\tattachBlobsP.push(\n\t\t\t\t\t\t\t\tnew Promise<void>((resolve) => {\n\t\t\t\t\t\t\t\t\tconst onBlobAttached = (attachedEntry) => {\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.off(\"blobAttached\", 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\tthis.on(\"blobAttached\", onBlobAttached);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tresolve();\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\tawait Promise.all(attachBlobsP);\n\t\t\t\t}\n\n\t\t\t\tfor (const [id, entry] of this.pendingBlobs) {\n\t\t\t\t\tassert(entry.attached === true, 0x790 /* stashed blob should be attached */);\n\t\t\t\t\tblobs[id] = {\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\tattached: entry.attached,\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 `/<BlobManager.basePath>/<blobId>`.\n * This path must match the path of the blob handle returned by the createBlob API because blobs are marked\n * referenced by storing these handles in a referenced DDS.\n */\nfunction getGCNodePathFromBlobId(blobId: string) {\n\treturn `/${BlobManager.basePath}/${blobId}`;\n}\n\n/**\n * For a given GC node path, return the blobId. The node path is of the format `/<BlobManager.basePath>/<blobId>`.\n */\nfunction getBlobIdFromGCNodePath(nodePath: string) {\n\tconst pathParts = nodePath.split(\"/\");\n\tassert(\n\t\tpathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n\t\t0x5bd /* Invalid blob node path */,\n\t);\n\treturn pathParts[2];\n}\n"]}
1
+ {"version":3,"file":"blobManager.js","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAQlC,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKjG,OAAO,EAAE,WAAW,EAA2B,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EACN,4BAA4B,EAC5B,YAAY,EACZ,YAAY,EAEZ,gBAAgB,EAChB,SAAS,GACT,MAAM,iCAAiC,C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C,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1D,CAAC,CACD,CAAC;IACH,CAAC;;AAn0BsB,oBAAQ,GAAG,QAAQ,AAAX,CAAY;AACnB,iCAAqB,GAAG,gBAAgB,AAAnB,CAAoB;AAq0BlE;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,MAAc;IAC9C,OAAO,IAAI,WAAW,CAAC,QAAQ,IAAI,MAAM,EAAE,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,SAAS,uBAAuB,CAAC,QAAgB;IAChD,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,CACL,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,QAAQ,EAC/D,KAAK,CAAC,4BAA4B,CAClC,CAAC;IACF,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tICreateBlobResponse,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tcreateResponseError,\n\tgenerateHandleContextPath,\n\tresponseToException,\n\tSummaryTreeBuilder,\n} from \"@fluidframework/runtime-utils\";\nimport { assert, Deferred } from \"@fluidframework/core-utils\";\nimport { bufferToString, stringToBuffer, TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tIContainerRuntime,\n\tIContainerRuntimeEvents,\n} from \"@fluidframework/container-runtime-definitions\";\nimport { AttachState, ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tcreateChildMonitoringContext,\n\tGenericError,\n\tLoggingError,\n\tMonitoringContext,\n\tPerformanceEvent,\n\twrapError,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\n\nimport { canRetryOnError, runWithRetry } from \"@fluidframework/driver-utils\";\nimport { ContainerRuntime, TombstoneResponseHeaderKey } from \"./containerRuntime\";\nimport { sendGCUnexpectedUsageEvent, disableAttachmentBlobSweepKey } from \"./gc\";\nimport { IBlobMetadata } from \"./metadata\";\n\n/**\n * This class represents blob (long string)\n * This object is used only when creating (writing) new blob and serialization purposes.\n * De-serialization process goes through FluidObjectHandle and request flow:\n * DataObject.request() recognizes requests in the form of `/blobs/<id>`\n * and loads blob.\n */\nexport class BlobHandle implements IFluidHandle<ArrayBufferLike> {\n\tprivate attached: boolean = false;\n\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\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<any>,\n\t\tprivate readonly onAttachGraph?: () => void,\n\t) {\n\t\tthis.absolutePath = generateHandleContextPath(path, this.routeContext);\n\t}\n\n\tpublic attachGraph() {\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: IFluidHandle) {\n\t\tthrow new Error(\"Cannot bind to blob handle\");\n\t}\n}\n\n/**\n * Information from a snapshot needed to load BlobManager\n * @public\n */\nexport interface IBlobManagerLoadInfo {\n\tids?: string[];\n\tredirectTable?: [string, string][];\n}\n\n// Restrict the IContainerRuntime interface to the subset required by BlobManager. This helps to make\n// the contract explicit and reduces the amount of mocking required for tests.\nexport type IBlobManagerRuntime = Pick<\n\tIContainerRuntime,\n\t\"attachState\" | \"connected\" | \"logger\" | \"clientDetails\"\n> &\n\tPick<ContainerRuntime, \"gcTombstoneEnforcementAllowed\" | \"gcThrowOnTombstoneLoad\"> &\n\tTypedEventEmitter<IContainerRuntimeEvents>;\n\ntype ICreateBlobResponseWithTTL = ICreateBlobResponse & Partial<Record<\"minTTLInSeconds\", number>>;\n\ninterface PendingBlob {\n\tblob: ArrayBufferLike;\n\tuploading?: boolean;\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\tpendingStashed?: boolean;\n}\n\nexport interface IPendingBlobs {\n\t[id: string]: {\n\t\tblob: string;\n\t\tstorageId?: string;\n\t\tuploadTime?: number;\n\t\tminTTLInSeconds?: number;\n\t\tattached?: boolean;\n\t\tacked?: boolean;\n\t};\n}\n\nexport interface IBlobManagerEvents {\n\t(event: \"noPendingBlobs\", listener: () => void);\n}\n\nexport class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {\n\tpublic static readonly basePath = \"_blobs\";\n\tprivate static readonly redirectTableBlobName = \".redirectTable\";\n\tprivate readonly mc: MonitoringContext;\n\n\t/**\n\t * Map of local IDs to storage IDs. Contains identity entries (id → id) 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, string[]> = new Map();\n\n\t/**\n\t * This stores IDs of tombstoned blobs.\n\t * Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.\n\t */\n\tprivate readonly tombstonedBlobs: Set<string> = new Set();\n\n\tprivate readonly sendBlobAttachOp: (localId: string, storageId?: string) => void;\n\tprivate stopAttaching: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly routeContext: IFluidHandleContext,\n\t\tsnapshot: IBlobManagerLoadInfo,\n\t\tprivate readonly getStorage: () => 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 - `/<BlobManager.basePath>/<blobId>`.\n\t\tprivate readonly blobRequested: (blobPath: string) => void,\n\t\t// Called to check if a blob has been deleted by GC.\n\t\t// blobPath's format - `/<BlobManager.basePath>/<blobId>`.\n\t\tprivate readonly isBlobDeleted: (blobPath: string) => boolean,\n\t\tprivate readonly runtime: IBlobManagerRuntime,\n\t\tstashedBlobs: IPendingBlobs = {},\n\t\tprivate readonly closeContainer: (error?: ICriticalContainerError) => void,\n\t) {\n\t\tsuper();\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger: this.runtime.logger,\n\t\t\tnamespace: \"BlobManager\",\n\t\t});\n\n\t\tthis.redirectTable = this.load(snapshot);\n\n\t\t// Begin uploading stashed blobs from previous container instance\n\t\tObject.entries(stashedBlobs).forEach(([localId, entry]) => {\n\t\t\tconst blob = stringToBuffer(entry.blob, \"base64\");\n\t\t\tconst attached = entry.attached;\n\t\t\tconst acked = entry.acked;\n\t\t\tconst storageId = entry.storageId; // entry.storageId = response.id\n\t\t\tif (entry.minTTLInSeconds && entry.uploadTime) {\n\t\t\t\tconst timeLapseSinceLocalUpload = (Date.now() - entry.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 (entry.minTTLInSeconds - timeLapseSinceLocalUpload > entry.minTTLInSeconds / 2) {\n\t\t\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\t\t\tblob,\n\t\t\t\t\t\tuploading: false,\n\t\t\t\t\t\topsent: true,\n\t\t\t\t\t\thandleP: new Deferred(),\n\t\t\t\t\t\tstorageId,\n\t\t\t\t\t\tuploadP: undefined,\n\t\t\t\t\t\tuploadTime: entry.uploadTime,\n\t\t\t\t\t\tminTTLInSeconds: entry.minTTLInSeconds,\n\t\t\t\t\t\tattached,\n\t\t\t\t\t\tacked,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.pendingBlobs.set(localId, {\n\t\t\t\tblob,\n\t\t\t\tuploading: true,\n\t\t\t\thandleP: new Deferred(),\n\t\t\t\tuploadP: this.uploadBlob(localId, blob),\n\t\t\t\tattached,\n\t\t\t\tacked,\n\t\t\t\topsent: true,\n\t\t\t\tpendingStashed: true,\n\t\t\t});\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// we want to avoid submitting ops with broken handles\n\t\t\t\t\tthis.closeContainer(\n\t\t\t\t\t\tnew GenericError(\n\t\t\t\t\t\t\t\"Trying to submit a BlobAttach for expired blob\",\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlocalId,\n\t\t\t\t\t\t\t\tblobId,\n\t\t\t\t\t\t\t\tsecondsSinceUpload,\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}\n\t\t\t}\n\t\t\tpendingEntry.opsent = true;\n\t\t\treturn sendBlobAttachOp(localId, blobId);\n\t\t};\n\t}\n\n\tpublic get allBlobsAttached(): boolean {\n\t\tfor (const [, entry] of this.pendingBlobs) {\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) {\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 hasPendingStashedBlobs(): boolean {\n\t\treturn Array.from(this.pendingBlobs.values()).some((e) => e.pendingStashed === true);\n\t}\n\t/**\n\t * Upload blobs added while offline. This must be completed before connecting and resubmitting ops.\n\t */\n\tpublic async processStashedChanges() {\n\t\tconst pendingUploads = Array.from(this.pendingBlobs.values())\n\t\t\t.filter((e) => e.pendingStashed === true)\n\t\t\t.map(async (e) => e.uploadP);\n\t\tawait PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{\n\t\t\t\teventName: \"BlobUploadProcessStashedChanges\",\n\t\t\t\tcount: pendingUploads.length,\n\t\t\t},\n\t\t\tasync () => Promise.all(pendingUploads),\n\t\t\t{ start: true, end: true },\n\t\t);\n\t}\n\n\t/**\n\t * Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is\n\t * detached or there are no (non-pending) attachment blobs in the document\n\t */\n\tprivate get storageIds(): Set<string> {\n\t\tconst ids = new Set<string | undefined>(this.redirectTable.values());\n\n\t\t// If we are detached, we will not have storage IDs, only undefined\n\t\tconst undefinedValueInTable = ids.delete(undefined);\n\n\t\t// For a detached container, entries are inserted into the redirect table with an undefined storage ID.\n\t\t// For an attached container, entries are inserted w/storage ID after the BlobAttach op round-trips.\n\t\tassert(\n\t\t\t!undefinedValueInTable ||\n\t\t\t\t(this.runtime.attachState === AttachState.Detached && ids.size === 0),\n\t\t\t0x382 /* 'redirectTable' must contain only undefined while detached / defined values while attached */,\n\t\t);\n\n\t\treturn ids as Set<string>;\n\t}\n\n\tpublic async getBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\t// Verify that the blob is valid, i.e., it has not been garbage collected. If it is, this will throw an error,\n\t\t// failing the call.\n\t\tthis.verifyBlobValidity(blobId);\n\n\t\tconst pending = this.pendingBlobs.get(blobId);\n\t\tif (pending) {\n\t\t\treturn pending.blob;\n\t\t}\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\tassert(!!attachedStorageId, 0x11f /* \"requesting unknown blobs\" */);\n\t\t\tstorageId = attachedStorageId;\n\t\t}\n\n\t\t// Let runtime know that the corresponding GC node was requested.\n\t\tthis.blobRequested(getGCNodePathFromBlobId(blobId));\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.mc.logger,\n\t\t\t{ eventName: \"AttachmentReadBlob\", id: storageId },\n\t\t\tasync () => {\n\t\t\t\treturn this.getStorage().readBlob(storageId);\n\t\t\t},\n\t\t\t{ end: true, cancel: \"error\" },\n\t\t);\n\t}\n\n\tprivate getBlobHandle(id: string): BlobHandle {\n\t\tassert(\n\t\t\tthis.redirectTable.has(id) || this.pendingBlobs.has(id),\n\t\t\t0x384 /* requesting handle for unknown blob */,\n\t\t);\n\t\tconst pending = this.pendingBlobs.get(id);\n\t\tconst callback = pending\n\t\t\t? () => {\n\t\t\t\t\tpending.attached = true;\n\t\t\t\t\tthis.emit(\"blobAttached\", pending);\n\t\t\t\t\tthis.deletePendingBlobMaybe(id);\n\t\t\t }\n\t\t\t: undefined;\n\t\treturn new BlobHandle(\n\t\t\t`${BlobManager.basePath}/${id}`,\n\t\t\tthis.routeContext,\n\t\t\tasync () => this.getBlob(id),\n\t\t\tcallback,\n\t\t);\n\t}\n\n\tprivate async createBlobDetached(\n\t\tblob: ArrayBufferLike,\n\t): Promise<IFluidHandle<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.getStorage().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<IFluidHandle<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 = uuid();\n\t\tconst pendingEntry: PendingBlob = {\n\t\t\tblob,\n\t\t\tuploading: true,\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 = () => {\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.getStorage().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\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) {\n\t\tthis.redirectTable.set(fromId, toId);\n\t}\n\n\tprivate deletePendingBlobMaybe(id: string) {\n\t\tif (this.pendingBlobs.has(id)) {\n\t\t\tconst entry = this.pendingBlobs.get(id);\n\t\t\tif (entry?.attached && entry?.acked) {\n\t\t\t\tthis.deletePendingBlob(id);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate deletePendingBlob(id: string) {\n\t\tif (this.pendingBlobs.delete(id) && !this.hasPendingBlobs) {\n\t\t\tthis.emit(\"noPendingBlobs\");\n\t\t}\n\t}\n\n\tprivate onUploadResolve(localId: string, response: ICreateBlobResponseWithTTL) {\n\t\tconst entry = this.pendingBlobs.get(localId);\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.deletePendingBlob(localId);\n\t\t\treturn;\n\t\t}\n\t\tassert(\n\t\t\tentry.uploading === true,\n\t\t\t0x386 /* Must have pending blob entry for uploaded blob */,\n\t\t);\n\t\tentry.storageId = response.id;\n\t\tentry.uploadTime = Date.now();\n\t\tentry.minTTLInSeconds = response.minTTLInSeconds;\n\t\t// Send a blob attach op. This serves two purposes:\n\t\t// 1. If its a new blob, i.e., it isn't de-duped, the server will keep the blob alive if it sees this op\n\t\t// until its storage ID is added to the next summary.\n\t\t// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the\n\t\t// blob from the server via the storage ID.\n\t\tif (!entry.opsent) {\n\t\t\tthis.sendBlobAttachOp(localId, response.id);\n\t\t}\n\t\tif (this.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\tthis.opsInFlight.set(\n\t\t\t\tresponse.id,\n\t\t\t\t(this.opsInFlight.get(response.id) ?? []).concat(localId),\n\t\t\t);\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) {\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 processBlobAttachOp(message: ISequencedDocumentMessage, local: boolean) {\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\tif (pendingEntry?.pendingStashed) {\n\t\t\t\tpendingEntry.pendingStashed = false;\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\twaitingBlobs.forEach((pendingLocalId) => {\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}\n\n\t/**\n\t * Reads blobs needed to load BlobManager from storage.\n\t * @param blobsTree - Tree containing IDs of previously attached blobs. We\n\t * look for the IDs in the blob entries of the tree since the both the r11s\n\t * and SPO drivers replace the attachment types returned in snapshot() with blobs.\n\t */\n\tpublic static async load(\n\t\tblobsTree: ISnapshotTree | undefined,\n\t\ttryFetchBlob: (id: string) => Promise<[string, string][]>,\n\t): Promise<IBlobManagerLoadInfo> {\n\t\tif (!blobsTree) {\n\t\t\treturn {};\n\t\t}\n\t\tlet redirectTable;\n\t\tconst tableId = blobsTree.blobs[this.redirectTableBlobName];\n\t\tif (tableId) {\n\t\t\tredirectTable = await tryFetchBlob(tableId);\n\t\t}\n\t\tconst ids = Object.entries(blobsTree.blobs)\n\t\t\t.filter(([k, _]) => k !== this.redirectTableBlobName)\n\t\t\t.map(([_, v]) => v);\n\t\treturn { ids, redirectTable };\n\t}\n\n\t/**\n\t * Load a set of previously attached blob IDs and redirect table from a previous snapshot.\n\t */\n\tprivate load(snapshot: IBlobManagerLoadInfo): Map<string, string | undefined> {\n\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\teventName: \"AttachmentBlobsLoaded\",\n\t\t\tcount: snapshot.ids?.length ?? 0,\n\t\t\tredirectTable: snapshot.redirectTable?.length,\n\t\t});\n\t\tconst table = new Map<string, string | undefined>(snapshot.redirectTable);\n\t\tif (snapshot.ids) {\n\t\t\tconst detached = this.runtime.attachState === AttachState.Detached;\n\t\t\t// If we are detached, we don't have storage IDs yet, so set to undefined\n\t\t\t// Otherwise, set identity (id -> id) entries\n\t\t\tsnapshot.ids.forEach((entry) => table.set(entry, detached ? undefined : entry));\n\t\t}\n\t\treturn table;\n\t}\n\n\tpublic summarize(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\t// if storageIds is empty, it means we are detached and have only local IDs, or that there are no blobs attached\n\t\tconst blobIds =\n\t\t\tthis.storageIds.size > 0\n\t\t\t\t? Array.from(this.storageIds)\n\t\t\t\t: Array.from(this.redirectTable.keys());\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tblobIds.forEach((blobId) => {\n\t\t\tbuilder.addAttachment(blobId);\n\t\t});\n\n\t\t// Any non-identity entries in the table need to be saved in the summary\n\t\tif (this.redirectTable.size > blobIds.length) {\n\t\t\tbuilder.addBlob(\n\t\t\t\tBlobManager.redirectTableBlobName,\n\t\t\t\t// filter out identity entries\n\t\t\t\tJSON.stringify(\n\t\t\t\t\tArray.from(this.redirectTable.entries()).filter(\n\t\t\t\t\t\t([localId, storageId]) => localId !== storageId,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn builder.getSummaryTree();\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 * This is called to update blobs whose routes are unused. The unused blobs are deleted.\n\t * @param unusedRoutes - The routes of the blob nodes that are unused. These routes will be based off of local ids.\n\t */\n\tpublic updateUnusedRoutes(unusedRoutes: string[]): void {\n\t\tthis.deleteBlobsFromRedirectTable(unusedRoutes);\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: string[]): string[] {\n\t\t// If sweep for attachment blobs is not enabled, return empty list indicating nothing is deleted.\n\t\tif (this.mc.config.getBoolean(disableAttachmentBlobSweepKey) === true) {\n\t\t\treturn [];\n\t\t}\n\n\t\tthis.deleteBlobsFromRedirectTable(sweepReadyBlobRoutes);\n\t\treturn Array.from(sweepReadyBlobRoutes);\n\t}\n\n\t/**\n\t * Delete blobs with the given routes from the redirect table.\n\t * The routes are GC nodes paths of format -`/<BlobManager.basePath>/<blobId>`. The blob ids are all local ids.\n\t * Deleting the blobs involves 2 steps:\n\t * 1. The redirect table entry for the local ids are deleted.\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: string[]) {\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\tif (!this.redirectTable.has(blobId)) {\n\t\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\t\teventName: \"DeletedAttachmentBlobNotFound\",\n\t\t\t\t\tblobId,\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 * This is called to update blobs whose routes are tombstones. Tombstoned blobs enable testing scenarios with\n\t * accessing deleted content without actually deleting content from summaries.\n\t * @param tombstonedRoutes - The routes of blob nodes that are tombstones.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: string[]) {\n\t\tconst tombstonedBlobsSet: Set<string> = new Set();\n\t\t// The routes or blob node paths are in the same format as returned in getGCData -\n\t\t// `/<BlobManager.basePath>/<blobId>`.\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst blobId = getBlobIdFromGCNodePath(route);\n\t\t\ttombstonedBlobsSet.add(blobId);\n\t\t}\n\n\t\t// Remove blobs from the tombstone list that were tombstoned but aren't anymore as per the tombstoneRoutes.\n\t\tfor (const blobId of this.tombstonedBlobs) {\n\t\t\tif (!tombstonedBlobsSet.has(blobId)) {\n\t\t\t\tthis.tombstonedBlobs.delete(blobId);\n\t\t\t}\n\t\t}\n\n\t\t// Mark blobs that are now tombstoned by adding them to the tombstone list.\n\t\tfor (const blobId of tombstonedBlobsSet) {\n\t\t\tthis.tombstonedBlobs.add(blobId);\n\t\t}\n\t}\n\n\t/**\n\t * Verifies that the blob with given id is valid, 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 verifyBlobValidity(blobId: string) {\n\t\t/**\n\t\t * A blob can be in one of the following states:\n\t\t * 1. \"deleted\" - It has been deleted by garbage collection sweep phase.\n\t\t * 2. \"tombstoned\" - It is ready for deletion but sweep phase isn't enabled and tombstone feature is enabled.\n\t\t * 3. \"valid\" - It has not been deleted or tombstoned.\n\t\t */\n\t\tlet state: \"valid\" | \"tombstoned\" | \"deleted\" = \"valid\";\n\t\tif (this.isBlobDeleted(getGCNodePathFromBlobId(blobId))) {\n\t\t\tstate = \"deleted\";\n\t\t} else if (this.tombstonedBlobs.has(blobId)) {\n\t\t\tstate = \"tombstoned\";\n\t\t}\n\n\t\tif (state === \"valid\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the blob is deleted or throw on tombstone load is enabled, throw an error which will fail any attempt\n\t\t// to load the blob.\n\t\tconst shouldFail = state === \"deleted\" || this.runtime.gcThrowOnTombstoneLoad;\n\t\tconst request = { url: blobId };\n\t\tconst error = responseToException(\n\t\t\tcreateResponseError(\n\t\t\t\t404,\n\t\t\t\t\"Blob was deleted\",\n\t\t\t\trequest,\n\t\t\t\tstate === \"tombstoned\" ? { [TombstoneResponseHeaderKey]: true } : undefined,\n\t\t\t),\n\t\t\trequest,\n\t\t);\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName:\n\t\t\t\t\tstate === \"tombstoned\"\n\t\t\t\t\t\t? \"GC_Tombstone_Blob_Requested\"\n\t\t\t\t\t\t: \"GC_Deleted_Blob_Requested\",\n\t\t\t\tcategory: shouldFail ? \"error\" : \"generic\",\n\t\t\t\tgcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,\n\t\t\t},\n\t\t\t[BlobManager.basePath],\n\t\t\terror,\n\t\t);\n\t\tif (shouldFail) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic setRedirectTable(table: Map<string, string>) {\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(\n\t\t\t\tthis.redirectTable.has(localId),\n\t\t\t\t0x254 /* \"unrecognized id in redirect table\" */,\n\t\t\t);\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\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\twhile (localBlobs.size < this.pendingBlobs.size) {\n\t\t\t\t\tconst attachBlobsP: Promise<void>[] = [];\n\t\t\t\t\tfor (const [id, 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\tentry.handleP.resolve(this.getBlobHandle(id));\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) => {\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.off(\"blobAttached\", 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\tthis.on(\"blobAttached\", onBlobAttached);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tresolve();\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\tawait Promise.allSettled(attachBlobsP).catch(() => {});\n\t\t\t\t}\n\n\t\t\t\tfor (const [id, 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,\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\tif (!entry.opsent) {\n\t\t\t\t\t\tthis.sendBlobAttachOp(id, entry.storageId);\n\t\t\t\t\t}\n\t\t\t\t\tblobs[id] = {\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\tattached: entry.attached,\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 `/<BlobManager.basePath>/<blobId>`.\n * This path must match the path of the blob handle returned by the createBlob API because blobs are marked\n * referenced by storing these handles in a referenced DDS.\n */\nfunction getGCNodePathFromBlobId(blobId: string) {\n\treturn `/${BlobManager.basePath}/${blobId}`;\n}\n\n/**\n * For a given GC node path, return the blobId. The node path is of the format `/<BlobManager.basePath>/<blobId>`.\n */\nfunction getBlobIdFromGCNodePath(nodePath: string) {\n\tconst pathParts = nodePath.split(\"/\");\n\tassert(\n\t\tpathParts.length === 3 && pathParts[1] === BlobManager.basePath,\n\t\t0x5bd /* Invalid blob node path */,\n\t);\n\treturn pathParts[2];\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { FluidObject, IFluidHandle, IFluidHandleContext, IFluidRouter, IRequest, IResponse, IProvideFluidHandleContext } from "@fluidframework/core-interfaces";
6
- import { IAudience, IContainerContext, IDeltaManager, IRuntime, ICriticalContainerError, AttachState, ILoaderOptions, ILoader } from "@fluidframework/container-definitions";
6
+ import { IAudience, IContainerContext, IDeltaManager, IRuntime, ICriticalContainerError, AttachState, ILoaderOptions, ILoader, IGetPendingLocalStateProps } from "@fluidframework/container-definitions";
7
7
  import { IContainerRuntime, IContainerRuntimeEvents } from "@fluidframework/container-runtime-definitions";
8
8
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
9
9
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
@@ -15,6 +15,9 @@ import { IBlobManagerLoadInfo, IPendingBlobs } from "./blobManager";
15
15
  import { IContainerRuntimeMetadata, ISerializedElection, SubmitSummaryResult, ISubmitSummaryOptions, ISummarizerInternalsProvider, ISummarizerRuntime, IRefreshSummaryAckOptions, IOnDemandSummarizeOptions, ISummarizeResults, IEnqueueSummarizeOptions, EnqueueSummarizeResult, ISummarizerEvents, ISummarizer } from "./summary";
16
16
  import { GCNodeType, IGCRuntimeOptions, IGCStats } from "./gc";
17
17
  import { IBatch } from "./opLifecycle";
18
+ /**
19
+ * @public
20
+ */
18
21
  export interface ISummaryBaseConfiguration {
19
22
  /**
20
23
  * Delay before first attempt to spawn summarizing container.
@@ -32,6 +35,9 @@ export interface ISummaryBaseConfiguration {
32
35
  */
33
36
  maxOpsSinceLastSummary: number;
34
37
  }
38
+ /**
39
+ * @public
40
+ */
35
41
  export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
36
42
  state: "enabled";
37
43
  /**
@@ -90,14 +96,29 @@ export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfigurati
90
96
  */
91
97
  nonRuntimeHeuristicThreshold?: number;
92
98
  }
99
+ /**
100
+ * @public
101
+ */
93
102
  export interface ISummaryConfigurationDisableSummarizer {
94
103
  state: "disabled";
95
104
  }
105
+ /**
106
+ * @public
107
+ */
96
108
  export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
97
109
  state: "disableHeuristics";
98
110
  }
111
+ /**
112
+ * @public
113
+ */
99
114
  export type ISummaryConfiguration = ISummaryConfigurationDisableSummarizer | ISummaryConfigurationDisableHeuristics | ISummaryConfigurationHeuristics;
115
+ /**
116
+ * @public
117
+ */
100
118
  export declare const DefaultSummaryConfiguration: ISummaryConfiguration;
119
+ /**
120
+ * @public
121
+ */
101
122
  export interface ISummaryRuntimeOptions {
102
123
  /** Override summary configurations set by the server. */
103
124
  summaryConfigOverrides?: ISummaryConfiguration;
@@ -111,6 +132,7 @@ export interface ISummaryRuntimeOptions {
111
132
  }
112
133
  /**
113
134
  * Options for op compression.
135
+ * @public
114
136
  */
115
137
  export interface ICompressionRuntimeOptions {
116
138
  /**
@@ -126,6 +148,7 @@ export interface ICompressionRuntimeOptions {
126
148
  }
127
149
  /**
128
150
  * Options for container runtime.
151
+ * @public
129
152
  */
130
153
  export interface IContainerRuntimeOptions {
131
154
  readonly summaryOptions?: ISummaryRuntimeOptions;
@@ -204,6 +227,7 @@ export interface IContainerRuntimeOptions {
204
227
  }
205
228
  /**
206
229
  * Accepted header keys for requests coming to the runtime.
230
+ * @public
207
231
  */
208
232
  export declare enum RuntimeHeaders {
209
233
  /** True to wait for a data store to be created and loaded before returning it. */
@@ -211,13 +235,24 @@ export declare enum RuntimeHeaders {
211
235
  /** True if the request is coming from an IFluidHandle. */
212
236
  viaHandle = "viaHandle"
213
237
  }
214
- /** True if a tombstoned object should be returned without erroring */
238
+ /** True if a tombstoned object should be returned without erroring
239
+ * @public
240
+ */
215
241
  export declare const AllowTombstoneRequestHeaderKey = "allowTombstone";
216
- /** [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring */
242
+ /**
243
+ * [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
244
+ * @public
245
+ */
217
246
  export declare const AllowInactiveRequestHeaderKey = "allowInactive";
218
- /** Tombstone error responses will have this header set to true */
247
+ /**
248
+ * Tombstone error responses will have this header set to true
249
+ * @public
250
+ */
219
251
  export declare const TombstoneResponseHeaderKey = "isTombstoned";
220
- /** Inactive error responses will have this header set to true */
252
+ /**
253
+ * Inactive error responses will have this header set to true
254
+ * @public
255
+ */
221
256
  export declare const InactiveResponseHeaderKey = "isInactive";
222
257
  /**
223
258
  * The full set of parsed header data that may be found on Runtime requests
@@ -231,6 +266,7 @@ export interface RuntimeHeaderData {
231
266
  export declare const defaultRuntimeHeaderData: Required<RuntimeHeaderData>;
232
267
  /**
233
268
  * Available compression algorithms for op compression.
269
+ * @public
234
270
  */
235
271
  export declare enum CompressionAlgorithms {
236
272
  lz4 = "lz4"
@@ -255,7 +291,8 @@ export declare const defaultPendingOpsWaitTimeoutMs = 1000;
255
291
  /** The default time to delay a summarization retry attempt when there are pending ops */
256
292
  export declare const defaultPendingOpsRetryDelayMs = 1000;
257
293
  /**
258
- * @deprecated - use ContainerRuntimeMessageType instead
294
+ * @deprecated use ContainerRuntimeMessageType instead
295
+ * @public
259
296
  */
260
297
  export declare enum RuntimeMessage {
261
298
  FluidDataStoreOp = "component",
@@ -267,13 +304,15 @@ export declare enum RuntimeMessage {
267
304
  Operation = "op"
268
305
  }
269
306
  /**
270
- * @deprecated - please use version in driver-utils
307
+ * @deprecated please use version in driver-utils
308
+ * @public
271
309
  */
272
310
  export declare function isRuntimeMessage(message: ISequencedDocumentMessage): boolean;
273
311
  /**
274
312
  * Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
275
313
  * special-case for document dirty state. Ultimately we should have no special-cases from the
276
314
  * ContainerRuntime's perspective.
315
+ * @public
277
316
  */
278
317
  export declare const agentSchedulerId = "_scheduler";
279
318
  export declare function getDeviceSpec(): {
@@ -291,11 +330,13 @@ export declare function getDeviceSpec(): {
291
330
  export declare const makeLegacySendBatchFn: (submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number, deltaManager: Pick<IDeltaManager<unknown, unknown>, "flush">) => (batch: IBatch) => void;
292
331
  /**
293
332
  * This function is not supported publicly and exists for e2e testing
333
+ * @internal
294
334
  */
295
335
  export declare function TEST_requestSummarizer(loader: ILoader, url: string): Promise<ISummarizer>;
296
336
  /**
297
337
  * Represents the runtime of the container. Contains helper functions/state of the container.
298
338
  * It will define the store level mappings.
339
+ * @public
299
340
  */
300
341
  export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents & ISummarizerEvents> implements IContainerRuntime, IRuntime, ISummarizerRuntime, ISummarizerInternalsProvider, IProvideFluidHandleContext {
301
342
  private readonly registry;
@@ -306,11 +347,11 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
306
347
  private readonly requestHandler?;
307
348
  private readonly summaryConfiguration;
308
349
  /**
309
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
350
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
310
351
  */
311
352
  get IFluidRouter(): this;
312
353
  /**
313
- * @deprecated - use loadRuntime instead.
354
+ * @deprecated use loadRuntime instead.
314
355
  * Load the stores from a snapshot and returns the runtime.
315
356
  * @param context - Context of the container.
316
357
  * @param registryEntries - Mapping to the stores.
@@ -468,10 +509,12 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
468
509
  * a summary is generated.
469
510
  */
470
511
  private nextSummaryNumber;
471
- /**
472
- * If false, loading or using a Tombstoned object should merely log, not fail
473
- */
474
- readonly gcTombstoneEnforcementAllowed: boolean;
512
+ /** If false, loading or using a Tombstoned object should merely log, not fail */
513
+ get gcTombstoneEnforcementAllowed(): boolean;
514
+ /** If true, throw an error when a tombstone data store is retrieved */
515
+ get gcThrowOnTombstoneLoad(): boolean;
516
+ /** If true, throw an error when a tombstone data store is used. */
517
+ get gcThrowOnTombstoneUsage(): boolean;
475
518
  /**
476
519
  * GUID to identify a document in telemetry
477
520
  * ! Note: should not be used for anything other than telemetry and is not considered a stable GUID
@@ -501,7 +544,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
501
544
  /**
502
545
  * Notifies this object about the request made to the container.
503
546
  * @param request - Request made to the handler.
504
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
547
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
505
548
  */
506
549
  request(request: IRequest): Promise<IResponse>;
507
550
  /**
@@ -563,7 +606,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
563
606
  * Returns the runtime of the data store.
564
607
  * @param id - Id supplied during creating the data store.
565
608
  * @param wait - True if you want to wait for it.
566
- * @deprecated - Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
609
+ * @deprecated Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
567
610
  */
568
611
  getRootDataStore(id: string, wait?: boolean): Promise<IFluidRouter>;
569
612
  private getRootDataStoreChannel;
@@ -608,9 +651,16 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
608
651
  * Submits the signal to be sent to other clients.
609
652
  * @param type - Type of the signal.
610
653
  * @param content - Content of the signal.
654
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
655
+ */
656
+ submitSignal(type: string, content: any, targetClientId?: string): void;
657
+ /**
658
+ * Submits the signal to be sent to other clients.
659
+ * @param type - Type of the signal.
660
+ * @param content - Content of the signal.
661
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
611
662
  */
612
- submitSignal(type: string, content: any): void;
613
- submitDataStoreSignal(address: string, type: string, content: any): void;
663
+ submitDataStoreSignal(address: string, type: string, content: any, targetClientId?: string): void;
614
664
  setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
615
665
  /**
616
666
  * Create a summary. Used when attaching or serializing a detached container.
@@ -666,7 +716,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
666
716
  */
667
717
  updateUnusedRoutes(unusedRoutes: string[]): void;
668
718
  /**
669
- * @deprecated - Replaced by deleteSweepReadyNodes.
719
+ * @deprecated Replaced by deleteSweepReadyNodes.
670
720
  */
671
721
  deleteUnusedNodes(unusedRoutes: string[]): string[];
672
722
  /**
@@ -781,15 +831,13 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
781
831
  private prefetchLatestSummaryThenClose;
782
832
  private closeStaleSummarizer;
783
833
  /**
784
- * Downloads snapshot from storage with the given versionId or latest if versionId is null.
834
+ * Downloads the latest snapshot from storage.
785
835
  * By default, it also closes the container after downloading the snapshot. However, this may be
786
836
  * overridden via options.
787
837
  */
788
- private fetchSnapshotFromStorage;
838
+ private fetchLatestSnapshotFromStorage;
789
839
  notifyAttaching(): void;
790
- getPendingLocalState(props?: {
791
- notifyImminentClosure: boolean;
792
- }): Promise<unknown>;
840
+ getPendingLocalState(props?: IGetPendingLocalStateProps): Promise<unknown>;
793
841
  summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
794
842
  enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
795
843
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,WAAW,EACX,YAAY,EACZ,mBAAmB,EAEnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,0BAA0B,EAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,SAAS,EAET,iBAAiB,EACjB,aAAa,EACb,QAAQ,EACR,uBAAuB,EACvB,WAAW,EACX,cAAc,EACd,OA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