@fluidframework/container-runtime 2.74.0 → 2.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/container-runtime.test-files.tar +0 -0
- package/dist/blobManager/blobManager.d.ts +0 -2
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +4 -5
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +3 -3
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +5 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +13 -7
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +2 -1
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +1 -0
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +1 -0
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/runtimeLayerCompatState.d.ts +10 -6
- package/dist/runtimeLayerCompatState.d.ts.map +1 -1
- package/dist/runtimeLayerCompatState.js +16 -6
- package/dist/runtimeLayerCompatState.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +1 -0
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +1 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +5 -0
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts +3 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js +39 -18
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.js +13 -11
- package/dist/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.d.ts +4 -1
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js +37 -16
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +10 -9
- package/dist/summary/summaryManager.js.map +1 -1
- package/eslint.config.mts +4 -4
- package/lib/blobManager/blobManager.d.ts +0 -2
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +4 -5
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +3 -3
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +5 -0
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +13 -7
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +2 -1
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +1 -0
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +1 -0
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/runtimeLayerCompatState.d.ts +10 -6
- package/lib/runtimeLayerCompatState.d.ts.map +1 -1
- package/lib/runtimeLayerCompatState.js +15 -5
- package/lib/runtimeLayerCompatState.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +1 -0
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +1 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +5 -0
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts +3 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js +39 -18
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.js +13 -11
- package/lib/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.d.ts +4 -1
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js +34 -13
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +10 -9
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +27 -27
- package/src/blobManager/blobManager.ts +3 -7
- package/src/channelCollection.ts +3 -3
- package/src/containerRuntime.ts +19 -6
- package/src/dataStoreContext.ts +3 -2
- package/src/deltaScheduler.ts +1 -0
- package/src/gc/gcHelpers.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/runtimeLayerCompatState.ts +25 -9
- package/src/summary/summarizerClientElection.ts +1 -0
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +1 -0
- package/src/summary/summarizerTypes.ts +5 -0
- package/src/summary/summaryDelayLoadedModule/runningSummarizer.ts +54 -26
- package/src/summary/summaryDelayLoadedModule/summarizer.ts +13 -11
- package/src/summary/summaryDelayLoadedModule/summaryGenerator.ts +43 -13
- package/src/summary/summaryManager.ts +11 -10
- package/.eslintrc.cjs +0 -30
package/dist/gc/gcHelpers.js
CHANGED
|
@@ -196,6 +196,7 @@ function unpackChildNodesGCDetails(gcDetails) {
|
|
|
196
196
|
childGCNodeId = "/";
|
|
197
197
|
}
|
|
198
198
|
let childGCDetails = childGCDetailsMap.get(childId);
|
|
199
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy
|
|
199
200
|
if (childGCDetails === undefined) {
|
|
200
201
|
childGCDetails = { gcData: { gcNodes: {} }, usedRoutes: [] };
|
|
201
202
|
}
|
package/dist/gc/gcHelpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcHelpers.js","sourceRoot":"","sources":["../../src/gc/gcHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,2EAMsD;AAGtD,yDAO4B;AAO5B,SAAgB,YAAY,CAAC,QAAsB;IAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,0CAA0C;QAC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B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7C,CAAC;AAFD,sDAEC;AAED;;;;;;;GAOG;AACH,SAAgB,iCAAiC,CAChD,qBAA4B,EAC5B,cAAsD;IAEtD,yDAAyD;IACzD,OAAO,cAAc,KAAK,QAAQ,CAAC;AACpC,CAAC;AAND,8EAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\ttype IGarbageCollectionDetailsBase,\n\tgcBlobPrefix,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\ttype IGarbageCollectionData,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { IConfigProvider } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype GCFeatureMatrix,\n\ttype GCVersion,\n\ttype IGCMetadata,\n\tgcVersionUpgradeToV4Key,\n\tnextGCVersion,\n\tstableGCVersion,\n} from \"./gcDefinitions.js\";\nimport type {\n\tIGarbageCollectionNodeData,\n\tIGarbageCollectionSnapshotData,\n\tIGarbageCollectionState,\n} from \"./gcSummaryDefinitions.js\";\n\nexport function getGCVersion(metadata?: IGCMetadata): GCVersion {\n\tif (!metadata) {\n\t\t// Force to 0/disallowed in prior versions\n\t\treturn 0;\n\t}\n\treturn metadata.gcFeature ?? 0;\n}\n\n/**\n * Indicates what GC version is in effect for new GC data being written in this session\n */\nexport function getGCVersionInEffect(configProvider: IConfigProvider): number {\n\t// If version upgrade is not enabled, fall back to the stable GC version.\n\treturn configProvider.getBoolean(gcVersionUpgradeToV4Key) === true\n\t\t? nextGCVersion\n\t\t: stableGCVersion;\n}\n\n/**\n * Indicates whether Sweep is allowed for this document based on the persisted GC Feature Matrix and current gcGeneration.\n * This applies to the entire Sweep Phase the same - both Tombstone Enforcement (i.e. should loading a Tombstone fail?) and Deletion.\n *\n * In order to protect old documents that were created at a time when known bugs exist that violate GC's invariants\n * such that enforcing GC Sweep would cause legitimate data loss, the container author may increment the generation value for Sweep\n * such that containers created with a different value will not be subjected to GC Sweep.\n *\n * If no generation is provided, Sweep will be enabled for all documents.\n *\n * For backwards compatibility, the current generation value is also compared against the persisted gcTombstoneGeneration if present.\n *\n * @param featureMatrix - The GC Feature Matrix, containing the persisted generation value\n * @param currentGeneration - The current app-provided gcGeneration value\n * @returns true if GC Sweep should be allowed for this document\n */\nexport function shouldAllowGcSweep(\n\tfeatureMatrix: GCFeatureMatrix,\n\tcurrentGeneration: number | undefined,\n): boolean {\n\t// If no Generation value is provided for this session, default to true\n\tif (currentGeneration === undefined) {\n\t\treturn true;\n\t}\n\n\t// tombstoneGeneration is the predecessor and needs to be supported for back-compat reasons\n\tconst targetGeneration = featureMatrix.tombstoneGeneration ?? featureMatrix.gcGeneration;\n\n\treturn currentGeneration === targetGeneration;\n}\n\n/**\n * Sorts the given GC state as per the id of the GC nodes. It also sorts the outbound routes array of each node.\n */\nexport function generateSortedGCState(\n\tgcState: IGarbageCollectionState,\n): IGarbageCollectionState {\n\tconst sortableArray: [string, IGarbageCollectionNodeData][] = Object.entries(\n\t\tgcState.gcNodes,\n\t);\n\tsortableArray.sort(([a], [b]) => a.localeCompare(b));\n\tconst sortedGCState: IGarbageCollectionState = { gcNodes: {} };\n\tfor (const [nodeId, nodeData] of sortableArray) {\n\t\tnodeData.outboundRoutes.sort();\n\t\tsortedGCState.gcNodes[nodeId] = nodeData;\n\t}\n\treturn sortedGCState;\n}\n\n/**\n * Concatenates the given GC states and returns the concatenated GC state.\n */\nexport function concatGarbageCollectionStates(\n\tgcState1: IGarbageCollectionState,\n\tgcState2: IGarbageCollectionState,\n): IGarbageCollectionState {\n\tconst combinedGCNodes: { [id: string]: IGarbageCollectionNodeData } = {};\n\tfor (const [nodeId, nodeData] of Object.entries(gcState1.gcNodes)) {\n\t\tcombinedGCNodes[nodeId] = {\n\t\t\toutboundRoutes: [...nodeData.outboundRoutes],\n\t\t\tunreferencedTimestampMs: nodeData.unreferencedTimestampMs,\n\t\t};\n\t}\n\n\tfor (const [nodeId, nodeData] of Object.entries(gcState2.gcNodes)) {\n\t\tlet combineNodeData = combinedGCNodes[nodeId];\n\t\tif (combineNodeData === undefined) {\n\t\t\tcombineNodeData = {\n\t\t\t\toutboundRoutes: [...nodeData.outboundRoutes],\n\t\t\t\tunreferencedTimestampMs: nodeData.unreferencedTimestampMs,\n\t\t\t};\n\t\t} else {\n\t\t\t// Validate that same node doesn't have different unreferenced timestamp.\n\t\t\tif (\n\t\t\t\tnodeData.unreferencedTimestampMs !== undefined &&\n\t\t\t\tcombineNodeData.unreferencedTimestampMs !== undefined\n\t\t\t) {\n\t\t\t\tassert(\n\t\t\t\t\tnodeData.unreferencedTimestampMs === combineNodeData.unreferencedTimestampMs,\n\t\t\t\t\t0x5d7 /* Two entries for the same GC node with different unreferenced timestamp */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcombineNodeData = {\n\t\t\t\toutboundRoutes: [\n\t\t\t\t\t...new Set([...nodeData.outboundRoutes, ...combineNodeData.outboundRoutes]),\n\t\t\t\t],\n\t\t\t\tunreferencedTimestampMs:\n\t\t\t\t\tnodeData.unreferencedTimestampMs ?? combineNodeData.unreferencedTimestampMs,\n\t\t\t};\n\t\t}\n\t\tcombinedGCNodes[nodeId] = combineNodeData;\n\t}\n\treturn { gcNodes: combinedGCNodes };\n}\n\n/**\n * Helper function that clones the GC data.\n * @param gcData - The GC data to clone.\n * @returns a clone of the given GC data.\n */\nexport function cloneGCData(gcData: IGarbageCollectionData): IGarbageCollectionData {\n\tconst clonedGCNodes: { [id: string]: string[] } = {};\n\tfor (const [id, outboundRoutes] of Object.entries(gcData.gcNodes)) {\n\t\tclonedGCNodes[id] = [...outboundRoutes];\n\t}\n\treturn {\n\t\tgcNodes: clonedGCNodes,\n\t};\n}\n\n/**\n * Concatenates the given GC data and returns the concatenated GC data.\n */\nexport function concatGarbageCollectionData(\n\tgcData1: IGarbageCollectionData,\n\tgcData2: IGarbageCollectionData,\n): IGarbageCollectionData {\n\tconst combinedGCData: IGarbageCollectionData = cloneGCData(gcData1);\n\tfor (const [id, routes] of Object.entries(gcData2.gcNodes)) {\n\t\tif (combinedGCData.gcNodes[id] === undefined) {\n\t\t\tcombinedGCData.gcNodes[id] = [...routes];\n\t\t} else {\n\t\t\tconst combinedRoutes = [...routes, ...combinedGCData.gcNodes[id]];\n\t\t\tcombinedGCData.gcNodes[id] = [...new Set(combinedRoutes)];\n\t\t}\n\t}\n\treturn combinedGCData;\n}\n\n/**\n * Gets the base garbage collection state from the given snapshot tree. It contains GC state, deleted nodes and\n * tombstones. The GC state may be written into multiple blobs. Merge the GC state from all such blobs into one.\n */\nexport async function getGCDataFromSnapshot(\n\tgcSnapshotTree: ISnapshotTree,\n\treadAndParseBlob: <T>(id: string) => Promise<T>,\n): Promise<IGarbageCollectionSnapshotData> {\n\tlet rootGCState: IGarbageCollectionState = { gcNodes: {} };\n\tlet tombstones: string[] | undefined;\n\tlet deletedNodes: string[] | undefined;\n\tfor (const key of Object.keys(gcSnapshotTree.blobs)) {\n\t\t// Update deleted nodes blob.\n\t\tif (key === gcDeletedBlobKey) {\n\t\t\tdeletedNodes = await readAndParseBlob<string[]>(gcSnapshotTree.blobs[key]);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Update tombstone blob.\n\t\tif (key === gcTombstoneBlobKey) {\n\t\t\ttombstones = await readAndParseBlob<string[]>(gcSnapshotTree.blobs[key]);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Skip blobs that do not start with the GC prefix.\n\t\tif (!key.startsWith(gcBlobPrefix)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst blobId = gcSnapshotTree.blobs[key];\n\t\tif (blobId === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst gcState = await readAndParseBlob<IGarbageCollectionState>(blobId);\n\t\tassert(gcState !== undefined, 0x5d8 /* GC blob missing from snapshot */);\n\t\t// Merge the GC state of this blob into the root GC state.\n\t\trootGCState = concatGarbageCollectionStates(rootGCState, gcState);\n\t}\n\treturn { gcState: rootGCState, tombstones, deletedNodes };\n}\n\n/**\n * Helper function that unpacks the GC details of the children from a given node's GC details.\n * @param gcDetails - The GC details of a node.\n * @returns A map of GC details of each children of the the given node.\n */\nexport function unpackChildNodesGCDetails(\n\tgcDetails: IGarbageCollectionDetailsBase,\n): Map<string, IGarbageCollectionDetailsBase> {\n\tconst childGCDetailsMap: Map<string, IGarbageCollectionDetailsBase> = new Map();\n\n\t// If GC data is not available, bail out.\n\tif (gcDetails.gcData === undefined) {\n\t\treturn childGCDetailsMap;\n\t}\n\n\tconst gcNodes = gcDetails.gcData.gcNodes;\n\tfor (const [id, outboundRoutes] of Object.entries(gcNodes)) {\n\t\t// Skip self-node since only children GC data is to be generated.\n\t\tif (id === \"/\") {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst childId = id.split(\"/\")[1];\n\t\tassert(\n\t\t\tchildId !== undefined,\n\t\t\t0x9fe /* node id should be an absolute route with child id part */,\n\t\t);\n\t\tlet childGCNodeId = id.slice(childId.length + 1);\n\t\t// GC node id always begins with \"/\". Handle the special case where a child's id in the parent's GC nodes is\n\t\t// of format `/root`. In this case, the childId is root and childGCNodeId is \"\". Make childGCNodeId = \"/\".\n\t\tif (childGCNodeId === \"\") {\n\t\t\tchildGCNodeId = \"/\";\n\t\t}\n\n\t\tlet childGCDetails = childGCDetailsMap.get(childId);\n\t\tif (childGCDetails === undefined) {\n\t\t\tchildGCDetails = { gcData: { gcNodes: {} }, usedRoutes: [] };\n\t\t}\n\t\t// gcData should not undefined as its always at least initialized as empty above.\n\t\tassert(\n\t\t\tchildGCDetails.gcData !== undefined,\n\t\t\t0x5da /* Child GC data should have been initialized */,\n\t\t);\n\t\tchildGCDetails.gcData.gcNodes[childGCNodeId] = [...new Set(outboundRoutes)];\n\t\tchildGCDetailsMap.set(childId, childGCDetails);\n\t}\n\n\tif (gcDetails.usedRoutes === undefined) {\n\t\treturn childGCDetailsMap;\n\t}\n\n\t// Remove the node's self used route, if any, and generate the children used routes.\n\tconst usedRoutes = gcDetails.usedRoutes.filter((route) => route !== \"\" && route !== \"/\");\n\tfor (const route of usedRoutes) {\n\t\tconst childId = route.split(\"/\")[1];\n\t\tassert(\n\t\t\tchildId !== undefined,\n\t\t\t0x9ff /* used route should be an absolute route with child id part */,\n\t\t);\n\t\tconst childUsedRoute = route.slice(childId.length + 1);\n\n\t\tconst childGCDetails = childGCDetailsMap.get(childId);\n\t\tassert(\n\t\t\tchildGCDetails?.usedRoutes !== undefined,\n\t\t\t0x5dc /* This should have be initialized when generate GC nodes above */,\n\t\t);\n\n\t\tchildGCDetails.usedRoutes.push(childUsedRoute);\n\t\tchildGCDetailsMap.set(childId, childGCDetails);\n\t}\n\treturn childGCDetailsMap;\n}\n\n/**\n * Trims the leading and trailing slashes from the given string.\n * @param str - A string that may contain leading and / or trailing slashes.\n * @returns A new string without leading and trailing slashes.\n */\nfunction trimLeadingAndTrailingSlashes(str: string): string {\n\treturn str.replace(/^\\/+|\\/+$/g, \"\");\n}\n\n/**\n * Reformats a request URL to match expected format for a GC node path\n */\nexport function urlToGCNodePath(url: string): string {\n\treturn `/${trimLeadingAndTrailingSlashes(url.split(\"?\")[0])}`;\n}\n\n/**\n * Pulls out the first path segment and formats it as a GC Node path\n * e.g. \"/dataStoreId/ddsId\" yields \"/dataStoreId\"\n */\nexport function dataStoreNodePathOnly(subDataStorePath: string): string {\n\treturn `/${subDataStorePath.split(\"/\")[1]}`;\n}\n\n/**\n * Utility to implement compat behaviors given an unknown message type\n * The parameters are typed to support compile-time enforcement of handling all known types/behaviors\n *\n * @param _unknownGCMessageType - Typed as never to ensure all known types have been\n * handled before calling this function (e.g. in a switch statement).\n * @param compatBehavior - Typed redundantly with CompatModeBehavior to ensure handling is added when updating that type\n */\nexport function compatBehaviorAllowsGCMessageType(\n\t_unknownGCMessageType: never,\n\tcompatBehavior: \"Ignore\" | \"FailToProcess\" | undefined,\n): boolean {\n\t// undefined defaults to same behavior as \"FailToProcess\"\n\treturn compatBehavior === \"Ignore\";\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gcHelpers.js","sourceRoot":"","sources":["../../src/gc/gcHelpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,2EAMsD;AAGtD,yDAO4B;AAO5B,SAAgB,YAAY,CAAC,QAAsB;IAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,0CAA0C;QAC1C,OAAO,CAAC,CAAC;IACV,CAAC;IACD,OAAO,QAAQ,CAAC,SAAS,IAAI,CAAC,CAAC;AAChC,CAAC;AAND,oCAMC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,cAA+B;IACnE,yEAAyE;IACzE,OAAO,cAAc,CAAC,UAAU,CAAC,0CAAuB,CAAC,KAAK,IAAI;QACjE,CAAC,CAAC,gCAAa;QACf,CAAC,CAAC,kCAAe,CAAC;AACpB,CAAC;AALD,oDAKC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,kBAAkB,CACjC,aAA8B,EAC9B,iBAAqC;IAErC,uEAAuE;IACvE,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,2FAA2F;IAC3F,MAAM,gBAAgB,GAAG,aAAa,CAAC,mBAAmB,IAAI,aAAa,CAAC,YAAY,CAAC;IAEzF,OAAO,iBAAiB,KAAK,gBAAgB,CAAC;AAC/C,CAAC;AAbD,gDAaC;AAED;;GAEG;AACH,SAAgB,qBAAqB,CACpC,OAAgC;IAEhC,MAAM,aAAa,GAA2C,MAAM,CAAC,OAAO,CAC3E,OAAO,CAAC,OAAO,CACf,CAAC;IACF,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aA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C;AAED;;;;GAIG;AACH,SAAS,6BAA6B,CAAC,GAAW;IACjD,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,GAAW;IAC1C,OAAO,IAAI,6BAA6B,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/D,CAAC;AAFD,0CAEC;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,gBAAwB;IAC7D,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7C,CAAC;AAFD,sDAEC;AAED;;;;;;;GAOG;AACH,SAAgB,iCAAiC,CAChD,qBAA4B,EAC5B,cAAsD;IAEtD,yDAAyD;IACzD,OAAO,cAAc,KAAK,QAAQ,CAAC;AACpC,CAAC;AAND,8EAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\ttype IGarbageCollectionDetailsBase,\n\tgcBlobPrefix,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\ttype IGarbageCollectionData,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { IConfigProvider } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype GCFeatureMatrix,\n\ttype GCVersion,\n\ttype IGCMetadata,\n\tgcVersionUpgradeToV4Key,\n\tnextGCVersion,\n\tstableGCVersion,\n} from \"./gcDefinitions.js\";\nimport type {\n\tIGarbageCollectionNodeData,\n\tIGarbageCollectionSnapshotData,\n\tIGarbageCollectionState,\n} from \"./gcSummaryDefinitions.js\";\n\nexport function getGCVersion(metadata?: IGCMetadata): GCVersion {\n\tif (!metadata) {\n\t\t// Force to 0/disallowed in prior versions\n\t\treturn 0;\n\t}\n\treturn metadata.gcFeature ?? 0;\n}\n\n/**\n * Indicates what GC version is in effect for new GC data being written in this session\n */\nexport function getGCVersionInEffect(configProvider: IConfigProvider): number {\n\t// If version upgrade is not enabled, fall back to the stable GC version.\n\treturn configProvider.getBoolean(gcVersionUpgradeToV4Key) === true\n\t\t? nextGCVersion\n\t\t: stableGCVersion;\n}\n\n/**\n * Indicates whether Sweep is allowed for this document based on the persisted GC Feature Matrix and current gcGeneration.\n * This applies to the entire Sweep Phase the same - both Tombstone Enforcement (i.e. should loading a Tombstone fail?) and Deletion.\n *\n * In order to protect old documents that were created at a time when known bugs exist that violate GC's invariants\n * such that enforcing GC Sweep would cause legitimate data loss, the container author may increment the generation value for Sweep\n * such that containers created with a different value will not be subjected to GC Sweep.\n *\n * If no generation is provided, Sweep will be enabled for all documents.\n *\n * For backwards compatibility, the current generation value is also compared against the persisted gcTombstoneGeneration if present.\n *\n * @param featureMatrix - The GC Feature Matrix, containing the persisted generation value\n * @param currentGeneration - The current app-provided gcGeneration value\n * @returns true if GC Sweep should be allowed for this document\n */\nexport function shouldAllowGcSweep(\n\tfeatureMatrix: GCFeatureMatrix,\n\tcurrentGeneration: number | undefined,\n): boolean {\n\t// If no Generation value is provided for this session, default to true\n\tif (currentGeneration === undefined) {\n\t\treturn true;\n\t}\n\n\t// tombstoneGeneration is the predecessor and needs to be supported for back-compat reasons\n\tconst targetGeneration = featureMatrix.tombstoneGeneration ?? featureMatrix.gcGeneration;\n\n\treturn currentGeneration === targetGeneration;\n}\n\n/**\n * Sorts the given GC state as per the id of the GC nodes. It also sorts the outbound routes array of each node.\n */\nexport function generateSortedGCState(\n\tgcState: IGarbageCollectionState,\n): IGarbageCollectionState {\n\tconst sortableArray: [string, IGarbageCollectionNodeData][] = Object.entries(\n\t\tgcState.gcNodes,\n\t);\n\tsortableArray.sort(([a], [b]) => a.localeCompare(b));\n\tconst sortedGCState: IGarbageCollectionState = { gcNodes: {} };\n\tfor (const [nodeId, nodeData] of sortableArray) {\n\t\tnodeData.outboundRoutes.sort();\n\t\tsortedGCState.gcNodes[nodeId] = nodeData;\n\t}\n\treturn sortedGCState;\n}\n\n/**\n * Concatenates the given GC states and returns the concatenated GC state.\n */\nexport function concatGarbageCollectionStates(\n\tgcState1: IGarbageCollectionState,\n\tgcState2: IGarbageCollectionState,\n): IGarbageCollectionState {\n\tconst combinedGCNodes: { [id: string]: IGarbageCollectionNodeData } = {};\n\tfor (const [nodeId, nodeData] of Object.entries(gcState1.gcNodes)) {\n\t\tcombinedGCNodes[nodeId] = {\n\t\t\toutboundRoutes: [...nodeData.outboundRoutes],\n\t\t\tunreferencedTimestampMs: nodeData.unreferencedTimestampMs,\n\t\t};\n\t}\n\n\tfor (const [nodeId, nodeData] of Object.entries(gcState2.gcNodes)) {\n\t\tlet combineNodeData = combinedGCNodes[nodeId];\n\t\tif (combineNodeData === undefined) {\n\t\t\tcombineNodeData = {\n\t\t\t\toutboundRoutes: [...nodeData.outboundRoutes],\n\t\t\t\tunreferencedTimestampMs: nodeData.unreferencedTimestampMs,\n\t\t\t};\n\t\t} else {\n\t\t\t// Validate that same node doesn't have different unreferenced timestamp.\n\t\t\tif (\n\t\t\t\tnodeData.unreferencedTimestampMs !== undefined &&\n\t\t\t\tcombineNodeData.unreferencedTimestampMs !== undefined\n\t\t\t) {\n\t\t\t\tassert(\n\t\t\t\t\tnodeData.unreferencedTimestampMs === combineNodeData.unreferencedTimestampMs,\n\t\t\t\t\t0x5d7 /* Two entries for the same GC node with different unreferenced timestamp */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tcombineNodeData = {\n\t\t\t\toutboundRoutes: [\n\t\t\t\t\t...new Set([...nodeData.outboundRoutes, ...combineNodeData.outboundRoutes]),\n\t\t\t\t],\n\t\t\t\tunreferencedTimestampMs:\n\t\t\t\t\tnodeData.unreferencedTimestampMs ?? combineNodeData.unreferencedTimestampMs,\n\t\t\t};\n\t\t}\n\t\tcombinedGCNodes[nodeId] = combineNodeData;\n\t}\n\treturn { gcNodes: combinedGCNodes };\n}\n\n/**\n * Helper function that clones the GC data.\n * @param gcData - The GC data to clone.\n * @returns a clone of the given GC data.\n */\nexport function cloneGCData(gcData: IGarbageCollectionData): IGarbageCollectionData {\n\tconst clonedGCNodes: { [id: string]: string[] } = {};\n\tfor (const [id, outboundRoutes] of Object.entries(gcData.gcNodes)) {\n\t\tclonedGCNodes[id] = [...outboundRoutes];\n\t}\n\treturn {\n\t\tgcNodes: clonedGCNodes,\n\t};\n}\n\n/**\n * Concatenates the given GC data and returns the concatenated GC data.\n */\nexport function concatGarbageCollectionData(\n\tgcData1: IGarbageCollectionData,\n\tgcData2: IGarbageCollectionData,\n): IGarbageCollectionData {\n\tconst combinedGCData: IGarbageCollectionData = cloneGCData(gcData1);\n\tfor (const [id, routes] of Object.entries(gcData2.gcNodes)) {\n\t\tif (combinedGCData.gcNodes[id] === undefined) {\n\t\t\tcombinedGCData.gcNodes[id] = [...routes];\n\t\t} else {\n\t\t\tconst combinedRoutes = [...routes, ...combinedGCData.gcNodes[id]];\n\t\t\tcombinedGCData.gcNodes[id] = [...new Set(combinedRoutes)];\n\t\t}\n\t}\n\treturn combinedGCData;\n}\n\n/**\n * Gets the base garbage collection state from the given snapshot tree. It contains GC state, deleted nodes and\n * tombstones. The GC state may be written into multiple blobs. Merge the GC state from all such blobs into one.\n */\nexport async function getGCDataFromSnapshot(\n\tgcSnapshotTree: ISnapshotTree,\n\treadAndParseBlob: <T>(id: string) => Promise<T>,\n): Promise<IGarbageCollectionSnapshotData> {\n\tlet rootGCState: IGarbageCollectionState = { gcNodes: {} };\n\tlet tombstones: string[] | undefined;\n\tlet deletedNodes: string[] | undefined;\n\tfor (const key of Object.keys(gcSnapshotTree.blobs)) {\n\t\t// Update deleted nodes blob.\n\t\tif (key === gcDeletedBlobKey) {\n\t\t\tdeletedNodes = await readAndParseBlob<string[]>(gcSnapshotTree.blobs[key]);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Update tombstone blob.\n\t\tif (key === gcTombstoneBlobKey) {\n\t\t\ttombstones = await readAndParseBlob<string[]>(gcSnapshotTree.blobs[key]);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Skip blobs that do not start with the GC prefix.\n\t\tif (!key.startsWith(gcBlobPrefix)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst blobId = gcSnapshotTree.blobs[key];\n\t\tif (blobId === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst gcState = await readAndParseBlob<IGarbageCollectionState>(blobId);\n\t\tassert(gcState !== undefined, 0x5d8 /* GC blob missing from snapshot */);\n\t\t// Merge the GC state of this blob into the root GC state.\n\t\trootGCState = concatGarbageCollectionStates(rootGCState, gcState);\n\t}\n\treturn { gcState: rootGCState, tombstones, deletedNodes };\n}\n\n/**\n * Helper function that unpacks the GC details of the children from a given node's GC details.\n * @param gcDetails - The GC details of a node.\n * @returns A map of GC details of each children of the the given node.\n */\nexport function unpackChildNodesGCDetails(\n\tgcDetails: IGarbageCollectionDetailsBase,\n): Map<string, IGarbageCollectionDetailsBase> {\n\tconst childGCDetailsMap: Map<string, IGarbageCollectionDetailsBase> = new Map();\n\n\t// If GC data is not available, bail out.\n\tif (gcDetails.gcData === undefined) {\n\t\treturn childGCDetailsMap;\n\t}\n\n\tconst gcNodes = gcDetails.gcData.gcNodes;\n\tfor (const [id, outboundRoutes] of Object.entries(gcNodes)) {\n\t\t// Skip self-node since only children GC data is to be generated.\n\t\tif (id === \"/\") {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst childId = id.split(\"/\")[1];\n\t\tassert(\n\t\t\tchildId !== undefined,\n\t\t\t0x9fe /* node id should be an absolute route with child id part */,\n\t\t);\n\t\tlet childGCNodeId = id.slice(childId.length + 1);\n\t\t// GC node id always begins with \"/\". Handle the special case where a child's id in the parent's GC nodes is\n\t\t// of format `/root`. In this case, the childId is root and childGCNodeId is \"\". Make childGCNodeId = \"/\".\n\t\tif (childGCNodeId === \"\") {\n\t\t\tchildGCNodeId = \"/\";\n\t\t}\n\n\t\tlet childGCDetails = childGCDetailsMap.get(childId);\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy\n\t\tif (childGCDetails === undefined) {\n\t\t\tchildGCDetails = { gcData: { gcNodes: {} }, usedRoutes: [] };\n\t\t}\n\t\t// gcData should not undefined as its always at least initialized as empty above.\n\t\tassert(\n\t\t\tchildGCDetails.gcData !== undefined,\n\t\t\t0x5da /* Child GC data should have been initialized */,\n\t\t);\n\t\tchildGCDetails.gcData.gcNodes[childGCNodeId] = [...new Set(outboundRoutes)];\n\t\tchildGCDetailsMap.set(childId, childGCDetails);\n\t}\n\n\tif (gcDetails.usedRoutes === undefined) {\n\t\treturn childGCDetailsMap;\n\t}\n\n\t// Remove the node's self used route, if any, and generate the children used routes.\n\tconst usedRoutes = gcDetails.usedRoutes.filter((route) => route !== \"\" && route !== \"/\");\n\tfor (const route of usedRoutes) {\n\t\tconst childId = route.split(\"/\")[1];\n\t\tassert(\n\t\t\tchildId !== undefined,\n\t\t\t0x9ff /* used route should be an absolute route with child id part */,\n\t\t);\n\t\tconst childUsedRoute = route.slice(childId.length + 1);\n\n\t\tconst childGCDetails = childGCDetailsMap.get(childId);\n\t\tassert(\n\t\t\tchildGCDetails?.usedRoutes !== undefined,\n\t\t\t0x5dc /* This should have be initialized when generate GC nodes above */,\n\t\t);\n\n\t\tchildGCDetails.usedRoutes.push(childUsedRoute);\n\t\tchildGCDetailsMap.set(childId, childGCDetails);\n\t}\n\treturn childGCDetailsMap;\n}\n\n/**\n * Trims the leading and trailing slashes from the given string.\n * @param str - A string that may contain leading and / or trailing slashes.\n * @returns A new string without leading and trailing slashes.\n */\nfunction trimLeadingAndTrailingSlashes(str: string): string {\n\treturn str.replace(/^\\/+|\\/+$/g, \"\");\n}\n\n/**\n * Reformats a request URL to match expected format for a GC node path\n */\nexport function urlToGCNodePath(url: string): string {\n\treturn `/${trimLeadingAndTrailingSlashes(url.split(\"?\")[0])}`;\n}\n\n/**\n * Pulls out the first path segment and formats it as a GC Node path\n * e.g. \"/dataStoreId/ddsId\" yields \"/dataStoreId\"\n */\nexport function dataStoreNodePathOnly(subDataStorePath: string): string {\n\treturn `/${subDataStorePath.split(\"/\")[1]}`;\n}\n\n/**\n * Utility to implement compat behaviors given an unknown message type\n * The parameters are typed to support compile-time enforcement of handling all known types/behaviors\n *\n * @param _unknownGCMessageType - Typed as never to ensure all known types have been\n * handled before calling this function (e.g. in a switch statement).\n * @param compatBehavior - Typed redundantly with CompatModeBehavior to ensure handling is added when updating that type\n */\nexport function compatBehaviorAllowsGCMessageType(\n\t_unknownGCMessageType: never,\n\tcompatBehavior: \"Ignore\" | \"FailToProcess\" | undefined,\n): boolean {\n\t// undefined defaults to same behavior as \"FailToProcess\"\n\treturn compatBehavior === \"Ignore\";\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/container-runtime";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.81.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/container-runtime";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.81.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.81.0\";\n"]}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
5
|
+
import { type ILayerCompatDetails, type ILayerCompatSupportRequirements } from "@fluid-internal/client-utils";
|
|
6
6
|
import type { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
7
|
-
import { type
|
|
7
|
+
import { type MonitoringContext } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
+
/**
|
|
9
|
+
* The config key to disable strict loader layer compatibility check.
|
|
10
|
+
*/
|
|
11
|
+
export declare const disableStrictLoaderLayerCompatibilityCheckKey = "Fluid.ContainerRuntime.DisableStrictLoaderLayerCompatibilityCheck";
|
|
8
12
|
/**
|
|
9
13
|
* The core compatibility details of the Runtime layer that is the same across all layer boundaries.
|
|
10
14
|
* @internal
|
|
@@ -13,11 +17,11 @@ export declare const runtimeCoreCompatDetails: {
|
|
|
13
17
|
/**
|
|
14
18
|
* The package version of the Runtime layer.
|
|
15
19
|
*/
|
|
16
|
-
readonly pkgVersion: "2.
|
|
20
|
+
readonly pkgVersion: "2.81.0";
|
|
17
21
|
/**
|
|
18
22
|
* The current generation of the Runtime layer.
|
|
19
23
|
*/
|
|
20
|
-
readonly generation:
|
|
24
|
+
readonly generation: 4;
|
|
21
25
|
};
|
|
22
26
|
/**
|
|
23
27
|
* Runtime's compatibility details that is exposed to the Loader layer.
|
|
@@ -43,10 +47,10 @@ export declare const dataStoreSupportRequirementsForRuntime: ILayerCompatSupport
|
|
|
43
47
|
* Validates that the Loader layer is compatible with this Runtime.
|
|
44
48
|
* @internal
|
|
45
49
|
*/
|
|
46
|
-
export declare function validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined, disposeFn: (error?: ICriticalContainerError) => void,
|
|
50
|
+
export declare function validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined, disposeFn: (error?: ICriticalContainerError) => void, mc: MonitoringContext): void;
|
|
47
51
|
/**
|
|
48
52
|
* Validates that the DataStore layer is compatible with this Runtime.
|
|
49
53
|
* @internal
|
|
50
54
|
*/
|
|
51
|
-
export declare function validateDatastoreCompatibility(maybeDataStoreCompatDetailsForRuntime: ILayerCompatDetails | undefined, disposeFn: () => void,
|
|
55
|
+
export declare function validateDatastoreCompatibility(maybeDataStoreCompatDetailsForRuntime: ILayerCompatDetails | undefined, disposeFn: () => void, mc: MonitoringContext): void;
|
|
52
56
|
//# sourceMappingURL=runtimeLayerCompatState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeLayerCompatState.d.ts","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"runtimeLayerCompatState.d.ts","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAKrF,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,0CAA0C,CAAC;AAIlD;;GAEG;AACH,eAAO,MAAM,6CAA6C,sEACU,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;IACpC;;OAEG;;IAEH;;OAEG;;CAEM,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,mBAM3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mCAAmC,EAAE,+BAUjD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gCAAgC,EAAE,mBAM9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sCAAsC,EAAE,+BAUpD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,kCAAkC,EAAE,mBAAmB,GAAG,SAAS,EACnE,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,EACpD,EAAE,EAAE,iBAAiB,GACnB,IAAI,CAmBN;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,qCAAqC,EAAE,mBAAmB,GAAG,SAAS,EACtE,SAAS,EAAE,MAAM,IAAI,EACrB,EAAE,EAAE,iBAAiB,GACnB,IAAI,CAUN"}
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.validateDatastoreCompatibility = exports.validateLoaderCompatibility = exports.dataStoreSupportRequirementsForRuntime = exports.runtimeCompatDetailsForDataStore = exports.loaderSupportRequirementsForRuntime = exports.runtimeCompatDetailsForLoader = exports.runtimeCoreCompatDetails = void 0;
|
|
7
|
+
exports.validateDatastoreCompatibility = exports.validateLoaderCompatibility = exports.dataStoreSupportRequirementsForRuntime = exports.runtimeCompatDetailsForDataStore = exports.loaderSupportRequirementsForRuntime = exports.runtimeCompatDetailsForLoader = exports.runtimeCoreCompatDetails = exports.disableStrictLoaderLayerCompatibilityCheckKey = void 0;
|
|
8
|
+
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
8
9
|
const internal_1 = require("@fluidframework/runtime-definitions/internal");
|
|
9
10
|
const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
10
11
|
const packageVersion_js_1 = require("./packageVersion.js");
|
|
12
|
+
/**
|
|
13
|
+
* The config key to disable strict loader layer compatibility check.
|
|
14
|
+
*/
|
|
15
|
+
exports.disableStrictLoaderLayerCompatibilityCheckKey = "Fluid.ContainerRuntime.DisableStrictLoaderLayerCompatibilityCheck";
|
|
11
16
|
/**
|
|
12
17
|
* The core compatibility details of the Runtime layer that is the same across all layer boundaries.
|
|
13
18
|
* @internal
|
|
@@ -20,7 +25,7 @@ exports.runtimeCoreCompatDetails = {
|
|
|
20
25
|
/**
|
|
21
26
|
* The current generation of the Runtime layer.
|
|
22
27
|
*/
|
|
23
|
-
generation:
|
|
28
|
+
generation: client_utils_1.generation,
|
|
24
29
|
};
|
|
25
30
|
/**
|
|
26
31
|
* Runtime's compatibility details that is exposed to the Loader layer.
|
|
@@ -78,16 +83,21 @@ exports.dataStoreSupportRequirementsForRuntime = {
|
|
|
78
83
|
* Validates that the Loader layer is compatible with this Runtime.
|
|
79
84
|
* @internal
|
|
80
85
|
*/
|
|
81
|
-
function validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime, disposeFn,
|
|
82
|
-
|
|
86
|
+
function validateLoaderCompatibility(maybeLoaderCompatDetailsForRuntime, disposeFn, mc) {
|
|
87
|
+
// By default, use strictCompatibilityCheck here - If the Loader doesn't provide compatibility details,
|
|
88
|
+
// assume it's a very old version and should be considered incompatible,
|
|
89
|
+
// since Loader can drift far from the Runtime causing issues.
|
|
90
|
+
// Can be disabled via config `disableStrictLoaderLayerCompatibilityCheckKey`.
|
|
91
|
+
const disableStrictLoaderLayerCompatibilityCheck = mc.config.getBoolean(exports.disableStrictLoaderLayerCompatibilityCheckKey);
|
|
92
|
+
(0, internal_2.validateLayerCompatibility)("runtime", "loader", exports.runtimeCompatDetailsForLoader, exports.loaderSupportRequirementsForRuntime, maybeLoaderCompatDetailsForRuntime, disposeFn, mc, disableStrictLoaderLayerCompatibilityCheck !== true /* strictCompatibilityCheck */);
|
|
83
93
|
}
|
|
84
94
|
exports.validateLoaderCompatibility = validateLoaderCompatibility;
|
|
85
95
|
/**
|
|
86
96
|
* Validates that the DataStore layer is compatible with this Runtime.
|
|
87
97
|
* @internal
|
|
88
98
|
*/
|
|
89
|
-
function validateDatastoreCompatibility(maybeDataStoreCompatDetailsForRuntime, disposeFn,
|
|
90
|
-
(0, internal_2.validateLayerCompatibility)("runtime", "dataStore", exports.runtimeCompatDetailsForDataStore, exports.dataStoreSupportRequirementsForRuntime, maybeDataStoreCompatDetailsForRuntime, disposeFn,
|
|
99
|
+
function validateDatastoreCompatibility(maybeDataStoreCompatDetailsForRuntime, disposeFn, mc) {
|
|
100
|
+
(0, internal_2.validateLayerCompatibility)("runtime", "dataStore", exports.runtimeCompatDetailsForDataStore, exports.dataStoreSupportRequirementsForRuntime, maybeDataStoreCompatDetailsForRuntime, disposeFn, mc);
|
|
91
101
|
}
|
|
92
102
|
exports.validateDatastoreCompatibility = validateDatastoreCompatibility;
|
|
93
103
|
//# sourceMappingURL=runtimeLayerCompatState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeLayerCompatState.js","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"runtimeLayerCompatState.js","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAIs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CAAsE,EACtE,SAAqB,EACrB,EAAqB;IAErB,IAAA,qCAA0B,EACzB,SAAS,EACT,WAAW,EACX,wCAAgC,EAChC,8CAAsC,EACtC,qCAAqC,EACrC,SAAS,EACT,EAAE,CACF,CAAC;AACH,CAAC;AAdD,wEAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tgeneration,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tencodeHandlesInContainerRuntime,\n\tnotifiesReadOnlyState,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype MonitoringContext,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The config key to disable strict loader layer compatibility check.\n */\nexport const disableStrictLoaderLayerCompatibilityCheckKey =\n\t\"Fluid.ContainerRuntime.DisableStrictLoaderLayerCompatibilityCheck\";\n\n/**\n * The core compatibility details of the Runtime layer that is the same across all layer boundaries.\n * @internal\n */\nexport const runtimeCoreCompatDetails = {\n\t/**\n\t * The package version of the Runtime layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Runtime layer.\n\t */\n\tgeneration,\n} as const;\n\n/**\n * Runtime's compatibility details that is exposed to the Loader layer.\n * @internal\n */\nexport const runtimeCompatDetailsForLoader: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / Loader boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Loader layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const loaderSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Loader must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that Loader layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Loader must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Runtime's compatibility details that is exposed to the DataStore layer.\n * @internal\n */\nexport const runtimeCompatDetailsForDataStore: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / DataStore boundary.\n\t */\n\tsupportedFeatures: new Set<string>([encodeHandlesInContainerRuntime, notifiesReadOnlyState]),\n};\n\n/**\n * The requirements that the DataStore layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const dataStoreSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that DataStore must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that DataStore layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the DataStore must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Loader layer is compatible with this Runtime.\n * @internal\n */\nexport function validateLoaderCompatibility(\n\tmaybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n\tmc: MonitoringContext,\n): void {\n\t// By default, use strictCompatibilityCheck here - If the Loader doesn't provide compatibility details,\n\t// assume it's a very old version and should be considered incompatible,\n\t// since Loader can drift far from the Runtime causing issues.\n\t// Can be disabled via config `disableStrictLoaderLayerCompatibilityCheckKey`.\n\tconst disableStrictLoaderLayerCompatibilityCheck = mc.config.getBoolean(\n\t\tdisableStrictLoaderLayerCompatibilityCheckKey,\n\t);\n\n\tvalidateLayerCompatibility(\n\t\t\"runtime\",\n\t\t\"loader\",\n\t\truntimeCompatDetailsForLoader,\n\t\tloaderSupportRequirementsForRuntime,\n\t\tmaybeLoaderCompatDetailsForRuntime,\n\t\tdisposeFn,\n\t\tmc,\n\t\tdisableStrictLoaderLayerCompatibilityCheck !== true /* strictCompatibilityCheck */,\n\t);\n}\n\n/**\n * Validates that the DataStore layer is compatible with this Runtime.\n * @internal\n */\nexport function validateDatastoreCompatibility(\n\tmaybeDataStoreCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n\tmc: MonitoringContext,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"runtime\",\n\t\t\"dataStore\",\n\t\truntimeCompatDetailsForDataStore,\n\t\tdataStoreSupportRequirementsForRuntime,\n\t\tmaybeDataStoreCompatDetailsForRuntime,\n\t\tdisposeFn,\n\t\tmc,\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerClientElection.d.ts","sourceRoot":"","sources":["../../src/summary/summarizerClientElection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,KAAK,EACX,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEzE,MAAM,WAAW,+BAAgC,SAAQ,MAAM;IAC9D,CAAC,KAAK,EAAE,0BAA0B,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC/D;AAED,MAAM,WAAW,yBAChB,SAAQ,cAAc,CAAC,+BAA+B,CAAC;IACvD,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7C;AAED;;;;GAIG;AACH,qBAAa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AAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7C;AAED;;;;GAIG;AACH,qBAAa,wBACZ,SAAQ,iBAAiB,CAAC,+BAA+B,CACzD,YAAW,yBAAyB;IAwBnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;aAClB,cAAc,EAAE,sBAAsB;IACtD,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IAzBxC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B,CAAqB;IACvD;;;;OAIG;IACH,OAAO,CAAC,eAAe,CAAK;IAE5B,IAAW,eAAe,IAAI,MAAM,GAAG,SAAS,CAE/C;IACD,IAAW,eAAe,IAAI,MAAM,GAAG,SAAS,CAE/C;gBAGiB,MAAM,EAAE,mBAAmB,EAC3B,iBAAiB,EAAE,cAAc,CAAC,0BAA0B,CAAC,EAC9D,cAAc,EAAE,sBAAsB,EACrC,sBAAsB,EAAE,MAAM;IA0DzC,SAAS,IAAI,mBAAmB;WAUzB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO;IAS/D,gBAAuB,2BAA2B,YAAa,cAAc,KAAG,OAAO,CACZ;CAC3E"}
|
|
@@ -58,6 +58,7 @@ class SummarizerClientElection extends client_utils_1.TypedEventEmitter {
|
|
|
58
58
|
lastSummaryAckSeqForClient: this.lastSummaryAckSeqForClient,
|
|
59
59
|
electionSequenceNumber,
|
|
60
60
|
nextElectedClientId: this.clientElection.peekNextElectedClient()?.clientId,
|
|
61
|
+
opsWithoutSummary,
|
|
61
62
|
});
|
|
62
63
|
this.lastReportedSeq = sequenceNumber;
|
|
63
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerClientElection.js","sourceRoot":"","sources":["../../src/summary/summarizerClientElection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAGjE,0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IAAI,CAAC,0BAA0B,GAAG,SAAS,CAAC;YAC5C,IAAI,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,GAAG,CAAC,EAAE,CAAC;gBACnE,iEAAiE;gBACjE,kEAAkE;gBAClE,mEAAmE;gBACnE,4BAA4B;gBAC5B,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;YACxD,CAAC;YACD,yDAAyD;YACzD,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,SAAS;QACf,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,GACjE,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC;QACjC,OAAO;YACN,eAAe;YACf,eAAe;YACf,sBAAsB,EAAE,IAAI,CAAC,0BAA0B,IAAI,sBAAsB;SACjF,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,gBAAgB,CAAC,MAAsB;QACpD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;QACtC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,+BAA+B;YAC/B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,wBAAwB,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC;;AAxGF,4DA4GC;AAFuB,oDAA2B,GAAG,CAAC,OAAuB,EAAW,EAAE,CACzF,OAAO,CAAC,YAAY,CAAC,WAAW,IAAI,OAAO,CAAC,IAAI,KAAK,yCAAoB,AADxB,CACyB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type { IEvent, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport type { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport { MessageType } from \"@fluidframework/driver-definitions/internal\";\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type {\n\tIOrderedClientElection,\n\tISerializedElection,\n\tITrackedClient,\n} from \"./orderedClientElection.js\";\nimport { summarizerClientType } from \"./summarizerTypes.js\";\nimport type { ISummaryCollectionOpEvents } from \"./summaryCollection.js\";\n\nexport interface ISummarizerClientElectionEvents extends IEvent {\n\t(event: \"electedSummarizerChanged\", handler: () => void): void;\n}\n\nexport interface ISummarizerClientElection\n\textends IEventProvider<ISummarizerClientElectionEvents> {\n\treadonly electedClientId: string | undefined;\n\treadonly electedParentId: string | undefined;\n}\n\n/**\n * This class encapsulates logic around tracking the elected summarizer client.\n * It will handle updating the elected client when a summary ack hasn't been seen\n * for some configured number of ops.\n */\nexport class SummarizerClientElection\n\textends TypedEventEmitter<ISummarizerClientElectionEvents>\n\timplements ISummarizerClientElection\n{\n\t/**\n\t * Used to calculate number of ops since last summary ack for the current elected client.\n\t * This will be undefined if there is no elected summarizer, or no summary ack has been\n\t * observed since this client was elected.\n\t * When a summary ack comes in, this will be set to the sequence number of the summary ack.\n\t */\n\tprivate lastSummaryAckSeqForClient: number | undefined;\n\t/**\n\t * Used to prevent excess logging by recording the sequence number that we last reported at,\n\t * and making sure we don't report another event to telemetry. If things work as intended,\n\t * this is not needed, otherwise it could report an event on every op in worst case scenario.\n\t */\n\tprivate lastReportedSeq = 0;\n\n\tpublic get electedClientId(): string | undefined {\n\t\treturn this.clientElection.electedClient?.clientId;\n\t}\n\tpublic get electedParentId(): string | undefined {\n\t\treturn this.clientElection.electedParent?.clientId;\n\t}\n\n\tconstructor(\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly summaryCollection: IEventProvider<ISummaryCollectionOpEvents>,\n\t\tpublic readonly clientElection: IOrderedClientElection,\n\t\tprivate readonly maxOpsSinceLastSummary: number,\n\t) {\n\t\tsuper();\n\t\t// On every inbound op, if enough ops pass without seeing a summary ack (per elected client),\n\t\t// elect a new client and log to telemetry.\n\t\tthis.summaryCollection.on(\"default\", ({ sequenceNumber }) => {\n\t\t\tconst electedClientId = this.electedClientId;\n\t\t\tif (electedClientId === undefined) {\n\t\t\t\t// Reset election if no elected client, but eligible clients are connected.\n\t\t\t\t// This should be uncommon, but is possible if the initial state of the\n\t\t\t\t// ordered client election contains an undefined client id or one not found\n\t\t\t\t// in the quorum (the latter would already log an error).\n\t\t\t\tif (this.clientElection.eligibleCount > 0) {\n\t\t\t\t\tthis.clientElection.resetElectedClient(sequenceNumber);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst electionSequenceNumber = this.clientElection.electionSequenceNumber;\n\t\t\tconst opsWithoutSummary =\n\t\t\t\tsequenceNumber - (this.lastSummaryAckSeqForClient ?? electionSequenceNumber);\n\t\t\tif (opsWithoutSummary > this.maxOpsSinceLastSummary) {\n\t\t\t\t// Log and elect a new summarizer client.\n\t\t\t\tconst opsSinceLastReport = sequenceNumber - this.lastReportedSeq;\n\t\t\t\tif (opsSinceLastReport > this.maxOpsSinceLastSummary) {\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"ElectedClientNotSummarizing\",\n\t\t\t\t\t\telectedClientId,\n\t\t\t\t\t\tlastSummaryAckSeqForClient: this.lastSummaryAckSeqForClient,\n\t\t\t\t\t\telectionSequenceNumber,\n\t\t\t\t\t\tnextElectedClientId: this.clientElection.peekNextElectedClient()?.clientId,\n\t\t\t\t\t\topsWithoutSummary,\n\t\t\t\t\t});\n\t\t\t\t\tthis.lastReportedSeq = sequenceNumber;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// When a summary ack comes in, reset our op seq counter.\n\t\tthis.summaryCollection.on(MessageType.SummaryAck, (op) => {\n\t\t\tthis.lastSummaryAckSeqForClient = op.sequenceNumber;\n\t\t});\n\n\t\t// Use oldest client election for unanimously and deterministically deciding\n\t\t// which client should summarize.\n\t\tthis.clientElection.on(\"election\", (client, sequenceNumber) => {\n\t\t\tthis.lastSummaryAckSeqForClient = undefined;\n\t\t\tif (client === undefined && this.clientElection.eligibleCount > 0) {\n\t\t\t\t// If no client is valid for election, reset to the oldest again.\n\t\t\t\t// Also make extra sure not to get stuck in an infinite loop here:\n\t\t\t\t// If there are no eligible clients, just wait until a client joins\n\t\t\t\t// and will be auto-elected.\n\t\t\t\tthis.clientElection.resetElectedClient(sequenceNumber);\n\t\t\t}\n\t\t\t// Election can trigger a change in SummaryManager state.\n\t\t\tthis.emit(\"electedSummarizerChanged\");\n\t\t});\n\t}\n\n\tpublic serialize(): ISerializedElection {\n\t\tconst { electedClientId, electedParentId, electionSequenceNumber } =\n\t\t\tthis.clientElection.serialize();\n\t\treturn {\n\t\t\telectedClientId,\n\t\t\telectedParentId,\n\t\t\telectionSequenceNumber: this.lastSummaryAckSeqForClient ?? electionSequenceNumber,\n\t\t};\n\t}\n\n\tpublic static isClientEligible(client: ITrackedClient): boolean {\n\t\tconst details = client.client.details;\n\t\tif (details === undefined) {\n\t\t\t// Very old clients back-compat\n\t\t\treturn true;\n\t\t}\n\t\treturn SummarizerClientElection.clientDetailsPermitElection(details);\n\t}\n\n\tpublic static readonly clientDetailsPermitElection = (details: IClientDetails): boolean =>\n\t\tdetails.capabilities.interactive || details.type === summarizerClientType;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerNodeWithGc.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,KAAK,EACX,sBAAsB,EACtB,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,8CAA8C,CAAC;AAUtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAEX,mBAAmB,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;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,OAAO,GAAG,qBAAqB;IAgBlF,OAAO,CAAC,WAAW;IAoBnB;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,GAAG,IAAI;IAsBzF;;OAEG;IACI,YAAY,IAAI,IAAI;IAM3B;;;OAGG;IACH,SAAS,CAAC,+BAA+B,CACxC,cAAc,EAAE,MAAM,EACtB,uBAAuB,EAAE,MAAM,GAC7B,IAAI;IAgCP;;OAEG;IACI,WAAW;IACjB;;OAEG;IACH,mBAAmB,EAAE,mBAAmB;IACxC;;OAEG;IACH,EAAE,EAAE,MAAM;IACV;;;;OAIG;IACH,WAAW,EAAE,8BAA8B,EAC3C,MAAM,GAAE,2BAAgC,EACxC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,sBAAsB,CAAC,GACjE,qBAAqB;IAuCxB;;;;;;;;OAQG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"summarizerNodeWithGc.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,KAAK,EACX,sBAAsB,EACtB,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,8CAA8C,CAAC;AAUtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAEX,mBAAmB,EACnB,2BAA2B,EAE3B,qBAAqB,EACrB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,yBAChB,SAAQ,qBAA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,yBAYD,CAAC"}
|
|
@@ -282,6 +282,7 @@ class SummarizerNodeWithGC extends summarizerNode_js_1.SummarizerNode {
|
|
|
282
282
|
// If the child route used routes are not defined, initialize it now and it can be used for all child nodes
|
|
283
283
|
// created until this summarization process is completed. This is an optimization to unpack the used routes
|
|
284
284
|
// only when needed.
|
|
285
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy
|
|
285
286
|
if (this.wipChildNodesUsedRoutes === undefined) {
|
|
286
287
|
this.wipChildNodesUsedRoutes = (0, internal_2.unpackChildNodesUsedRoutes)(this.usedRoutes);
|
|
287
288
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerNodeWithGc.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA0E;AAS1E,qEAAoF;AACpF,uEAIkD;AAElD,gDAA2E;AAE3E,2DAAqD;AAkBrD;;;;;;;;;;;;GAYG;AACH,MAAa,oBAAqB,SAAQ,kCAAc;IA+BvD;;;OAGG;IACH,YACC,MAA4B,EAC5B,mBAAwC,EACxC,MAAmC,EACnC,gBAAwB,EACxB,oBAA4B;IAC5B;;OAEG;IACH,kCAA2C,EAC3C,gBAAuC,EACtB,WAAmE,EACpF,kBAAiE;IACjE;;OAEG;IACH,WAAoB;QAEpB,KAAK,CACJ,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,gBAAgB,EAChB,oBAAoB,EACpB,kCAAkC,EAClC,gBAAgB,EAChB,WAAW,CACX,CAAC;QAhBe,gBAAW,GAAX,WAAW,CAAwD;QAjCrF,4FAA4F;QACpF,wBAAmB,GAAY,KAAK,CAAC;QAS7C,mHAAmH;QACnH,iHAAiH;QACjH,iHAAiH;QACzG,eAAU,GAAa,CAAC,EAAE,CAAC,CAAC;QAsCnC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,KAAK,IAAI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served.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIGarbageCollectionData,\n\tCreateChildSummarizerNodeParam,\n\tIGarbageCollectionDetailsBase,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { unpackChildNodesUsedRoutes } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tLoggingError,\n\tTelemetryDataTag,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { cloneGCData, unpackChildNodesGCDetails } from \"../../gc/index.js\";\n\nimport { SummarizerNode } from \"./summarizerNode.js\";\nimport type {\n\tICreateChildDetails,\n\tIStartSummaryResult,\n\tISummarizerNodeRootContract,\n\tPendingSummaryInfo,\n\tValidateSummaryResult,\n} from \"./summarizerNodeUtils.js\";\n\nexport interface IRootSummarizerNodeWithGC\n\textends ISummarizerNodeWithGC,\n\t\tISummarizerNodeRootContract {}\n\n// Extend PendingSummaryInfo to add used routes tracking it.\ninterface PendingSummaryInfoWithGC extends PendingSummaryInfo {\n\tserializedUsedRoutes: string | undefined;\n}\n\n/**\n * Extends the functionality of SummarizerNode to manage this node's garbage collection data:\n *\n * - Adds a new API `getGCData` to return GC data of this node.\n *\n * - Caches the result of `getGCData` to be used if nothing changes between summaries.\n *\n * - Manages the used routes of this node. These are used to identify if this node is referenced in the document\n * and to determine if the node's used state changed since last summary.\n *\n *- Adds trackState param to summarize. If trackState is false, it bypasses the SummarizerNode and calls\n * directly into summarizeInternal method.\n */\nexport class SummarizerNodeWithGC extends SummarizerNode implements IRootSummarizerNodeWithGC {\n\t// Tracks the work-in-progress used routes during summary.\n\tprivate wipSerializedUsedRoutes: string | undefined;\n\n\t// Tracks the work-in-progress used routes of child nodes during summary.\n\tprivate wipChildNodesUsedRoutes: Map<string, string[]> | undefined;\n\n\t// This is the last known used routes of this node as seen by the server as part of a summary.\n\tprivate referenceUsedRoutes: string[] | undefined;\n\n\t// The base GC details of this node used to initialize the GC state.\n\tprivate readonly baseGCDetailsP: Promise<IGarbageCollectionDetailsBase>;\n\n\t// Keeps track of whether we have loaded the base details to ensure that we only do it once.\n\tprivate baseGCDetailsLoaded: boolean = false;\n\n\t// The base GC details for the child nodes. This is passed to child nodes when creating them.\n\tprivate readonly childNodesBaseGCDetailsP: Promise<\n\t\tMap<string, IGarbageCollectionDetailsBase>\n\t>;\n\n\tprivate gcData: IGarbageCollectionData | undefined;\n\n\t// Set used routes to have self route by default. This makes the node referenced by default. This is done to ensure\n\t// that this node is not marked as collected when running GC has been disabled. Once, the option to disable GC is\n\t// removed (from runGC flag in IContainerRuntimeOptions), this should be changed to be have no routes by default.\n\tprivate usedRoutes: string[] = [\"\"];\n\n\t// True if GC is disabled for this node. If so, do not track GC specific state for a summary.\n\tprivate readonly gcDisabled: boolean;\n\n\t/**\n\t * Do not call constructor directly.\n\t * Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.\n\t */\n\tpublic constructor(\n\t\tlogger: ITelemetryBaseLogger,\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\tconfig: ISummarizerNodeConfigWithGC,\n\t\t_summaryHandleId: string,\n\t\tchangeSequenceNumber: number,\n\t\t/**\n\t\t * Summary reference sequence number, i.e. last sequence number seen when it was created\n\t\t */\n\t\tlastSummaryReferenceSequenceNumber?: number,\n\t\twipSummaryLogger?: ITelemetryBaseLogger,\n\t\tprivate readonly getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n\t\t/**\n\t\t * A unique id of this node to be logged when sending telemetry.\n\t\t */\n\t\ttelemetryId?: string,\n\t) {\n\t\tsuper(\n\t\t\tlogger,\n\t\t\tsummarizeInternalFn,\n\t\t\tconfig,\n\t\t\t_summaryHandleId,\n\t\t\tchangeSequenceNumber,\n\t\t\tlastSummaryReferenceSequenceNumber,\n\t\t\twipSummaryLogger,\n\t\t\ttelemetryId,\n\t\t);\n\n\t\tthis.gcDisabled = config.gcDisabled === true;\n\n\t\tthis.baseGCDetailsP = new LazyPromise(async () => {\n\t\t\treturn (await getBaseGCDetailsFn?.()) ?? { usedRoutes: [] };\n\t\t});\n\n\t\tthis.childNodesBaseGCDetailsP = new LazyPromise(async () => {\n\t\t\tawait this.loadBaseGCDetails();\n\t\t\treturn unpackChildNodesGCDetails({ gcData: this.gcData, usedRoutes: this.usedRoutes });\n\t\t});\n\t}\n\n\t/**\n\t * Loads state from this node's initial GC summary details. This contains the following data from the last summary\n\t * seen by the server for this client:\n\t * - usedRoutes: This is used to figure out if the used state of this node changed since last summary.\n\t * - gcData: The garbage collection data of this node that is required for running GC.\n\t */\n\tprivate async loadBaseGCDetails(): Promise<void> {\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tconst baseGCDetails = await this.baseGCDetailsP;\n\n\t\t// Possible race - If there were parallel calls to loadBaseGCDetails, we want to make sure that we update\n\t\t// the state from the base details only once.\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseGCDetailsLoaded = true;\n\n\t\t// Update GC data, used routes and reference used routes. The used routes are sorted because they are compared\n\t\t// across GC runs to check if they changed. Sorting ensures that the elements are in the same order.\n\t\t// If the GC details has GC data, initialize our GC data from it.\n\t\tif (baseGCDetails.gcData !== undefined) {\n\t\t\tthis.gcData = cloneGCData(baseGCDetails.gcData);\n\t\t}\n\t\tif (baseGCDetails.usedRoutes !== undefined) {\n\t\t\tthis.usedRoutes = [...baseGCDetails.usedRoutes].sort();\n\t\t\tthis.referenceUsedRoutes = [...baseGCDetails.usedRoutes].sort();\n\t\t}\n\t}\n\n\t/**\n\t * Returns the GC data of this node. If nothing has changed since last summary, it tries to reuse the data from\n\t * the previous summary. Else, it gets new GC data from the underlying Fluid object.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tassert(\n\t\t\t!this.gcDisabled,\n\t\t\t0x1b2 /* \"Getting GC data should not be called when GC is disabled!\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.getGCDataFn !== undefined,\n\t\t\t0x1b3 /* \"GC data cannot be retrieved without getGCDataFn\" */,\n\t\t);\n\n\t\t// Load GC details from the initial summary, if not already loaded. If this is the first time this function is\n\t\t// called and the node's data has not changed since last summary, the GC data in initial details is returned.\n\t\tawait this.loadBaseGCDetails();\n\n\t\t// If there is no new data since last summary and we have GC data from the previous run, return it. The previous\n\t\t// GC data may not be available if loaded from a snapshot with either GC disabled or before GC was added.\n\t\t// Note - canReuseHandle is checked to be consistent with summarize - generate GC data for nodes for which\n\t\t// summary must be generated.\n\t\tif (\n\t\t\tthis.canReuseHandle &&\n\t\t\t!fullGC &&\n\t\t\t!this.hasDataChanged() &&\n\t\t\tthis.gcData !== undefined\n\t\t) {\n\t\t\treturn cloneGCData(this.gcData);\n\t\t}\n\n\t\tconst gcData = await this.getGCDataFn(fullGC);\n\t\tthis.gcData = cloneGCData(gcData);\n\t\treturn gcData;\n\t}\n\n\t/**\n\t * Called during the start of a summary. Updates the work-in-progress used routes.\n\t */\n\tpublic startSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryBaseLogger,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult {\n\t\t// If GC is disabled, skip setting wip used routes since we should not track GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tassert(\n\t\t\t\tthis.wipSerializedUsedRoutes === undefined,\n\t\t\t\t0x1b4 /* \"We should not already be tracking used routes when to track a new summary\" */,\n\t\t\t);\n\t\t}\n\t\treturn super.startSummary(referenceSequenceNumber, summaryLogger, latestSummaryRefSeqNum);\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct for all nodes, i.e., GC should have run for non-skipped nodes.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when running GC.\n\t * In that case, the children will not have work-in-progress state.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tprotected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {\n\t\tif (this.wasGCMissed()) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\treason: \"NodeDidNotRunGC\",\n\t\t\t\tid: {\n\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\tvalue: this.telemetryNodeId,\n\t\t\t\t},\n\t\t\t\t// These errors are usually transient and should go away when summarize / GC is retried.\n\t\t\t\tretryAfterSeconds: 1,\n\t\t\t};\n\t\t}\n\t\treturn super.validateSummaryCore(parentSkipRecursion);\n\t}\n\n\tprivate wasGCMissed(): boolean {\n\t\t// If GC is disabled, it should not have run so it was not missed.\n\t\t// Otherwise, GC should have been called on this node and wipSerializedUsedRoutes must be set.\n\t\tif (this.gcDisabled || this.wipSerializedUsedRoutes !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t\t/**\n\t\t * The absence of wip used routes indicates that GC was not run on this node. This can happen if:\n\t\t * 1. A child node was created after GC was already run on the parent. For example, a data store\n\t\t * is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this\n\t\t * case, the parent will pass on used routes to the child nodes and it will have wip used routes.\n\t\t * 2. A new node was created but GC was never run on it. This can mean that the GC data generated\n\t\t * during summarize is incomplete.\n\t\t *\n\t\t * This happens due to scenarios such as data store created during summarize. Such errors should go away when\n\t\t * summarize is attempted again.\n\t\t */\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending\n\t * summary queue. We track this until we get an ack from the server for this summary.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t */\n\tprotected completeSummaryCore(proposalHandle: string, parentSkipRecursion: boolean): void {\n\t\tlet wipSerializedUsedRoutes: string | undefined;\n\t\t// If GC is disabled, don't set wip used routes.\n\t\tif (!this.gcDisabled) {\n\t\t\twipSerializedUsedRoutes = this.wipSerializedUsedRoutes;\n\t\t}\n\n\t\tsuper.completeSummaryCore(proposalHandle, parentSkipRecursion);\n\n\t\t// If GC is disabled, skip setting pending summary with GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst pendingSummaryInfo = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (pendingSummaryInfo !== undefined) {\n\t\t\t\tconst pendingSummaryInfoWithGC = {\n\t\t\t\t\tserializedUsedRoutes: wipSerializedUsedRoutes,\n\t\t\t\t\t...pendingSummaryInfo,\n\t\t\t\t};\n\t\t\t\tthis.pendingSummaries.set(proposalHandle, pendingSummaryInfoWithGC);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clears the work-in-progress state.\n\t */\n\tpublic clearSummary(): void {\n\t\tthis.wipSerializedUsedRoutes = undefined;\n\t\tthis.wipChildNodesUsedRoutes = undefined;\n\t\tsuper.clearSummary();\n\t}\n\n\t/**\n\t * Called when we get an ack from the server for a summary we sent. Update the reference state of this node\n\t * from the state in the pending summary queue.\n\t */\n\tprotected refreshLatestSummaryFromPending(\n\t\tproposalHandle: string,\n\t\treferenceSequenceNumber: number,\n\t): void {\n\t\t// If GC is disabled, skip setting referenced used routes since we are not tracking GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst pendingSummaryInfo = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (pendingSummaryInfo !== undefined) {\n\t\t\t\t// If a pending summary exists, it must have used routes since GC is enabled.\n\t\t\t\tconst summaryNodeWithGC = pendingSummaryInfo as PendingSummaryInfoWithGC;\n\t\t\t\tif (summaryNodeWithGC.serializedUsedRoutes === undefined) {\n\t\t\t\t\tconst error = new LoggingError(\"MissingGCStateInPendingSummary\", {\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\treferenceSequenceNumber,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tid: this.telemetryNodeId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\t\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: error.message,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tthis.referenceUsedRoutes = JSON.parse(\n\t\t\t\t\tsummaryNodeWithGC.serializedUsedRoutes,\n\t\t\t\t) as string[];\n\t\t\t}\n\t\t}\n\n\t\treturn super.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);\n\t}\n\n\t/**\n\t * Override the createChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic createChild(\n\t\t/**\n\t\t * Summarize function\n\t\t */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\tconfig: ISummarizerNodeConfigWithGC = {},\n\t\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t): ISummarizerNodeWithGC {\n\t\tassert(!this.children.has(id), 0x1b6 /* \"Create SummarizerNode child already exists\" */);\n\t\t/**\n\t\t * Update the child node's base GC details from this node's current GC details instead of updating from the base\n\t\t * GC details of this node. This will handle scenarios where the GC details was updated during refresh from\n\t\t * snapshot and the child node wasn't created then. If a child is created after that, its GC details should be\n\t\t * the one from the downloaded snapshot and not the base GC details.\n\t\t */\n\t\tconst getChildBaseGCDetailsFn = async (): Promise<IGarbageCollectionDetailsBase> => {\n\t\t\tconst childNodesBaseGCDetails = await this.childNodesBaseGCDetailsP;\n\t\t\treturn childNodesBaseGCDetails.get(id) ?? {};\n\t\t};\n\n\t\tconst createDetails: ICreateChildDetails = this.getCreateDetailsForChild(id, createParam);\n\t\tconst child = new SummarizerNodeWithGC(\n\t\t\tthis.logger,\n\t\t\tsummarizeInternalFn,\n\t\t\t{\n\t\t\t\t...config,\n\t\t\t\t// Propagate our gcDisabled state to the child if its not explicity specified in child's config.\n\t\t\t\tgcDisabled: config.gcDisabled ?? this.gcDisabled,\n\t\t\t},\n\t\t\tcreateDetails.summaryHandleId,\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.lastSummaryReferenceSequenceNumber,\n\t\t\tthis.wipSummaryLogger,\n\t\t\tgetGCDataFn,\n\t\t\tgetChildBaseGCDetailsFn,\n\t\t\tcreateDetails.telemetryNodeId,\n\t\t);\n\n\t\t// There may be additional state that has to be updated in this child. For example, if a summary is being\n\t\t// tracked, the child's summary tracking state needs to be updated too.\n\t\tthis.maybeUpdateChildState(child, id);\n\n\t\tthis.children.set(id, child);\n\t\treturn child;\n\t}\n\n\t/**\n\t * Updates the state of the child if required. For example, if a summary is currently being tracked, the child's\n\t * summary tracking state needs to be updated too.\n\t * Also, in case a child node gets realized in between Summary Op and Summary Ack, let's initialize the child's\n\t * pending summary as well. Finally, if the pendingSummaries entries have serializedRoutes, replicate them to the\n\t * pendingSummaries from the child nodes.\n\t * @param child - The child node whose state is to be updated.\n\t * @param id - Initial id or path part of this node\n\t */\n\tprotected maybeUpdateChildState(child: SummarizerNodeWithGC, id: string): void {\n\t\tsuper.maybeUpdateChildState(child, id);\n\n\t\t// If GC has run on this node and summarization isn't complete, this.wipSerializedUsedRoutes will be defined.\n\t\t// In that case, update the used routes of the child node. This can happen in scenarios where a data store\n\t\t// doesn't have any ops but its reference state changed. So, it gets realized during summarize after GC ran\n\t\t// so GC would not have run on this node which is fine.\n\t\tif (this.wipSerializedUsedRoutes !== undefined) {\n\t\t\t// If the child route used routes are not defined, initialize it now and it can be used for all child nodes\n\t\t\t// created until this summarization process is completed. This is an optimization to unpack the used routes\n\t\t\t// only when needed.\n\t\t\tif (this.wipChildNodesUsedRoutes === undefined) {\n\t\t\t\tthis.wipChildNodesUsedRoutes = unpackChildNodesUsedRoutes(this.usedRoutes);\n\t\t\t}\n\t\t\tchild.updateUsedRoutes(this.wipChildNodesUsedRoutes.get(id) ?? [\"\"]);\n\t\t}\n\n\t\t// In case we have pending summaries on the parent, let's initialize it on the child.\n\t\tfor (const [key, pendingSummary] of this.pendingSummaries.entries()) {\n\t\t\tconst pendingSummaryWithGC = pendingSummary as PendingSummaryInfoWithGC;\n\t\t\tif (pendingSummaryWithGC.serializedUsedRoutes !== undefined) {\n\t\t\t\tconst childNodeUsedRoutes = unpackChildNodesUsedRoutes(\n\t\t\t\t\tJSON.parse(pendingSummaryWithGC.serializedUsedRoutes) as string[],\n\t\t\t\t);\n\t\t\t\tconst newSerializedRoutes = childNodeUsedRoutes.get(id) ?? [\"\"];\n\t\t\t\tconst childPendingSummaryInfo = {\n\t\t\t\t\t...pendingSummaryWithGC,\n\t\t\t\t\tserializedUsedRoutes: JSON.stringify(newSerializedRoutes),\n\t\t\t\t};\n\t\t\t\tchild.addPendingSummary(key, childPendingSummaryInfo);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Deletes the child node with the given id.\n\t */\n\tpublic deleteChild(id: string): void {\n\t\tthis.children.delete(id);\n\t}\n\n\t/**\n\t * Override the getChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic getChild(id: string): ISummarizerNodeWithGC | undefined {\n\t\treturn this.children.get(id) as SummarizerNodeWithGC;\n\t}\n\n\tpublic isReferenced(): boolean {\n\t\treturn this.usedRoutes.includes(\"\") || this.usedRoutes.includes(\"/\");\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]): void {\n\t\t// Sort the given routes before updating. This will ensure that the routes compared in hasUsedStateChanged()\n\t\t// are in the same order.\n\t\tthis.usedRoutes = usedRoutes.sort();\n\n\t\t// If GC is not disabled and a summary is in progress, update the work-in-progress used routes so that it can\n\t\t// be tracked for this summary.\n\t\tif (!this.gcDisabled && this.isSummaryInProgress()) {\n\t\t\tthis.wipSerializedUsedRoutes = JSON.stringify(this.usedRoutes);\n\t\t}\n\t}\n\n\t/**\n\t * Override the hasChanged method. If this node data or its used state changed, the node is considered changed.\n\t */\n\tprotected hasChanged(): boolean {\n\t\treturn this.hasDataChanged() || this.hasUsedStateChanged();\n\t}\n\n\t/**\n\t * This tells whether the data in this node has changed or not.\n\t */\n\tprivate hasDataChanged(): boolean {\n\t\treturn super.hasChanged();\n\t}\n\n\t/**\n\t * This tells whether the used state of this node has changed since last successful summary. If the used routes\n\t * of this node changed, its used state is considered changed. Basically, if this node or any of its child nodes\n\t * was previously used and became unused (or vice versa), its used state has changed.\n\t */\n\tprivate hasUsedStateChanged(): boolean {\n\t\t// If GC is disabled, it should not affect summary state, return false.\n\t\tif (this.gcDisabled) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tthis.referenceUsedRoutes === undefined ||\n\t\t\tJSON.stringify(this.usedRoutes) !== JSON.stringify(this.referenceUsedRoutes)\n\t\t);\n\t}\n}\n\n/**\n * Creates a root summarizer node with GC functionality built-in.\n * @param logger - Logger to use within SummarizerNode\n * @param summarizeInternalFn - Function to generate summary\n * @param changeSequenceNumber - Sequence number of latest change to new node/subtree\n * @param referenceSequenceNumber - Reference sequence number of last acked summary,\n * or undefined if not loaded from summary\n * @param config - Configure behavior of summarizer node\n * @param getGCDataFn - Function to get the GC data of this node\n * @param baseGCDetailsP - Function to get the initial GC details of this node\n */\nexport const createRootSummarizerNodeWithGC = (\n\tlogger: ITelemetryBaseLogger,\n\tsummarizeInternalFn: SummarizeInternalFn,\n\tchangeSequenceNumber: number,\n\treferenceSequenceNumber: number | undefined,\n\tconfig: ISummarizerNodeConfigWithGC = {},\n\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n): IRootSummarizerNodeWithGC =>\n\tnew SummarizerNodeWithGC(\n\t\tlogger,\n\t\tsummarizeInternalFn,\n\t\tconfig,\n\t\t\"\" /* summaryHandleId */,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber,\n\t\tundefined /* wipSummaryLogger */,\n\t\tgetGCDataFn,\n\t\tgetBaseGCDetailsFn,\n\t\t\"\" /* telemetryId */,\n\t);\n"]}
|
|
1
|
+
{"version":3,"file":"summarizerNodeWithGc.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA0E;AAS1E,qEAAoF;AACpF,uEAIkD;AAElD,gDAA2E;AAE3E,2DAAqD;AAkBrD;;;;;;;;;;;;GAYG;AACH,MAAa,oBAAqB,SAAQ,kCAAc;IA+BvD;;;OAGG;IACH,YACC,MAA4B,EAC5B,mBAAwC,EACxC,MAAmC,EACnC,gBAAwB,EACxB,oBAA4B;IAC5B;;OAEG;IACH,kCAA2C,EAC3C,gBAAuC,EACtB,WAAmE,EACpF,kBAAiE;IACjE;;OAEG;IACH,WAAoB;QAEpB,KAAK,CACJ,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,gBAAgB,EAChB,oBAAoB,EACpB,kCAAkC,EAClC,gBAAgB,EAChB,WAAW,CACX,CAAC;QAhBe,gBAAW,GAAX,WAAW,CAAwD;QAjCrF,4FAA4F;QACpF,wBAAmB,GAAY,KAAK,CAAC;QAS7C,mHAAmH;QACnH,iHAAiH;QACjH,iHAAiH;QACzG,eAAU,GAAa,CAAC,EAAE,CAAC,CAAC;QAsCnC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC;QAE7C,IAAI,CAAC,cAAc,GAAG,IAAI,sBAAW,CAAC,KAAK,IAAI,EA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6GAA6G;QAC7G,+BAA+B;QAC/B,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,mBAAmB,EAAE,EAAE,CAAC;YACpD,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChE,CAAC;IACF,CAAC;IAED;;OAEG;IACO,UAAU;QACnB,OAAO,IAAI,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC5D,CAAC;IAED;;OAEG;IACK,cAAc;QACrB,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACK,mBAAmB;QAC1B,uEAAuE;QACvE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACd,CAAC;QAED,OAAO,CACN,IAAI,CAAC,mBAAmB,KAAK,SAAS;YACtC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAC5E,CAAC;IACH,CAAC;CACD;AA9bD,oDA8bC;AAED;;;;;;;;;;GAUG;AACI,MAAM,8BAA8B,GAAG,CAC7C,MAA4B,EAC5B,mBAAwC,EACxC,oBAA4B,EAC5B,uBAA2C,EAC3C,SAAsC,EAAE,EACxC,WAAmE,EACnE,kBAAiE,EACrC,EAAE,CAC9B,IAAI,oBAAoB,CACvB,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,EAAE,CAAC,qBAAqB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,CAAC,sBAAsB,EAChC,WAAW,EACX,kBAAkB,EAClB,EAAE,CAAC,iBAAiB,CACpB,CAAC;AApBU,QAAA,8BAA8B,kCAoBxC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIGarbageCollectionData,\n\tCreateChildSummarizerNodeParam,\n\tIGarbageCollectionDetailsBase,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { unpackChildNodesUsedRoutes } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tLoggingError,\n\tTelemetryDataTag,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { cloneGCData, unpackChildNodesGCDetails } from \"../../gc/index.js\";\n\nimport { SummarizerNode } from \"./summarizerNode.js\";\nimport type {\n\tICreateChildDetails,\n\tIStartSummaryResult,\n\tISummarizerNodeRootContract,\n\tPendingSummaryInfo,\n\tValidateSummaryResult,\n} from \"./summarizerNodeUtils.js\";\n\nexport interface IRootSummarizerNodeWithGC\n\textends ISummarizerNodeWithGC,\n\t\tISummarizerNodeRootContract {}\n\n// Extend PendingSummaryInfo to add used routes tracking it.\ninterface PendingSummaryInfoWithGC extends PendingSummaryInfo {\n\tserializedUsedRoutes: string | undefined;\n}\n\n/**\n * Extends the functionality of SummarizerNode to manage this node's garbage collection data:\n *\n * - Adds a new API `getGCData` to return GC data of this node.\n *\n * - Caches the result of `getGCData` to be used if nothing changes between summaries.\n *\n * - Manages the used routes of this node. These are used to identify if this node is referenced in the document\n * and to determine if the node's used state changed since last summary.\n *\n *- Adds trackState param to summarize. If trackState is false, it bypasses the SummarizerNode and calls\n * directly into summarizeInternal method.\n */\nexport class SummarizerNodeWithGC extends SummarizerNode implements IRootSummarizerNodeWithGC {\n\t// Tracks the work-in-progress used routes during summary.\n\tprivate wipSerializedUsedRoutes: string | undefined;\n\n\t// Tracks the work-in-progress used routes of child nodes during summary.\n\tprivate wipChildNodesUsedRoutes: Map<string, string[]> | undefined;\n\n\t// This is the last known used routes of this node as seen by the server as part of a summary.\n\tprivate referenceUsedRoutes: string[] | undefined;\n\n\t// The base GC details of this node used to initialize the GC state.\n\tprivate readonly baseGCDetailsP: Promise<IGarbageCollectionDetailsBase>;\n\n\t// Keeps track of whether we have loaded the base details to ensure that we only do it once.\n\tprivate baseGCDetailsLoaded: boolean = false;\n\n\t// The base GC details for the child nodes. This is passed to child nodes when creating them.\n\tprivate readonly childNodesBaseGCDetailsP: Promise<\n\t\tMap<string, IGarbageCollectionDetailsBase>\n\t>;\n\n\tprivate gcData: IGarbageCollectionData | undefined;\n\n\t// Set used routes to have self route by default. This makes the node referenced by default. This is done to ensure\n\t// that this node is not marked as collected when running GC has been disabled. Once, the option to disable GC is\n\t// removed (from runGC flag in IContainerRuntimeOptions), this should be changed to be have no routes by default.\n\tprivate usedRoutes: string[] = [\"\"];\n\n\t// True if GC is disabled for this node. If so, do not track GC specific state for a summary.\n\tprivate readonly gcDisabled: boolean;\n\n\t/**\n\t * Do not call constructor directly.\n\t * Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.\n\t */\n\tpublic constructor(\n\t\tlogger: ITelemetryBaseLogger,\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\tconfig: ISummarizerNodeConfigWithGC,\n\t\t_summaryHandleId: string,\n\t\tchangeSequenceNumber: number,\n\t\t/**\n\t\t * Summary reference sequence number, i.e. last sequence number seen when it was created\n\t\t */\n\t\tlastSummaryReferenceSequenceNumber?: number,\n\t\twipSummaryLogger?: ITelemetryBaseLogger,\n\t\tprivate readonly getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n\t\t/**\n\t\t * A unique id of this node to be logged when sending telemetry.\n\t\t */\n\t\ttelemetryId?: string,\n\t) {\n\t\tsuper(\n\t\t\tlogger,\n\t\t\tsummarizeInternalFn,\n\t\t\tconfig,\n\t\t\t_summaryHandleId,\n\t\t\tchangeSequenceNumber,\n\t\t\tlastSummaryReferenceSequenceNumber,\n\t\t\twipSummaryLogger,\n\t\t\ttelemetryId,\n\t\t);\n\n\t\tthis.gcDisabled = config.gcDisabled === true;\n\n\t\tthis.baseGCDetailsP = new LazyPromise(async () => {\n\t\t\treturn (await getBaseGCDetailsFn?.()) ?? { usedRoutes: [] };\n\t\t});\n\n\t\tthis.childNodesBaseGCDetailsP = new LazyPromise(async () => {\n\t\t\tawait this.loadBaseGCDetails();\n\t\t\treturn unpackChildNodesGCDetails({ gcData: this.gcData, usedRoutes: this.usedRoutes });\n\t\t});\n\t}\n\n\t/**\n\t * Loads state from this node's initial GC summary details. This contains the following data from the last summary\n\t * seen by the server for this client:\n\t * - usedRoutes: This is used to figure out if the used state of this node changed since last summary.\n\t * - gcData: The garbage collection data of this node that is required for running GC.\n\t */\n\tprivate async loadBaseGCDetails(): Promise<void> {\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tconst baseGCDetails = await this.baseGCDetailsP;\n\n\t\t// Possible race - If there were parallel calls to loadBaseGCDetails, we want to make sure that we update\n\t\t// the state from the base details only once.\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseGCDetailsLoaded = true;\n\n\t\t// Update GC data, used routes and reference used routes. The used routes are sorted because they are compared\n\t\t// across GC runs to check if they changed. Sorting ensures that the elements are in the same order.\n\t\t// If the GC details has GC data, initialize our GC data from it.\n\t\tif (baseGCDetails.gcData !== undefined) {\n\t\t\tthis.gcData = cloneGCData(baseGCDetails.gcData);\n\t\t}\n\t\tif (baseGCDetails.usedRoutes !== undefined) {\n\t\t\tthis.usedRoutes = [...baseGCDetails.usedRoutes].sort();\n\t\t\tthis.referenceUsedRoutes = [...baseGCDetails.usedRoutes].sort();\n\t\t}\n\t}\n\n\t/**\n\t * Returns the GC data of this node. If nothing has changed since last summary, it tries to reuse the data from\n\t * the previous summary. Else, it gets new GC data from the underlying Fluid object.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tassert(\n\t\t\t!this.gcDisabled,\n\t\t\t0x1b2 /* \"Getting GC data should not be called when GC is disabled!\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.getGCDataFn !== undefined,\n\t\t\t0x1b3 /* \"GC data cannot be retrieved without getGCDataFn\" */,\n\t\t);\n\n\t\t// Load GC details from the initial summary, if not already loaded. If this is the first time this function is\n\t\t// called and the node's data has not changed since last summary, the GC data in initial details is returned.\n\t\tawait this.loadBaseGCDetails();\n\n\t\t// If there is no new data since last summary and we have GC data from the previous run, return it. The previous\n\t\t// GC data may not be available if loaded from a snapshot with either GC disabled or before GC was added.\n\t\t// Note - canReuseHandle is checked to be consistent with summarize - generate GC data for nodes for which\n\t\t// summary must be generated.\n\t\tif (\n\t\t\tthis.canReuseHandle &&\n\t\t\t!fullGC &&\n\t\t\t!this.hasDataChanged() &&\n\t\t\tthis.gcData !== undefined\n\t\t) {\n\t\t\treturn cloneGCData(this.gcData);\n\t\t}\n\n\t\tconst gcData = await this.getGCDataFn(fullGC);\n\t\tthis.gcData = cloneGCData(gcData);\n\t\treturn gcData;\n\t}\n\n\t/**\n\t * Called during the start of a summary. Updates the work-in-progress used routes.\n\t */\n\tpublic startSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryBaseLogger,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult {\n\t\t// If GC is disabled, skip setting wip used routes since we should not track GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tassert(\n\t\t\t\tthis.wipSerializedUsedRoutes === undefined,\n\t\t\t\t0x1b4 /* \"We should not already be tracking used routes when to track a new summary\" */,\n\t\t\t);\n\t\t}\n\t\treturn super.startSummary(referenceSequenceNumber, summaryLogger, latestSummaryRefSeqNum);\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct for all nodes, i.e., GC should have run for non-skipped nodes.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when running GC.\n\t * In that case, the children will not have work-in-progress state.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tprotected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {\n\t\tif (this.wasGCMissed()) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\treason: \"NodeDidNotRunGC\",\n\t\t\t\tid: {\n\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\tvalue: this.telemetryNodeId,\n\t\t\t\t},\n\t\t\t\t// These errors are usually transient and should go away when summarize / GC is retried.\n\t\t\t\tretryAfterSeconds: 1,\n\t\t\t};\n\t\t}\n\t\treturn super.validateSummaryCore(parentSkipRecursion);\n\t}\n\n\tprivate wasGCMissed(): boolean {\n\t\t// If GC is disabled, it should not have run so it was not missed.\n\t\t// Otherwise, GC should have been called on this node and wipSerializedUsedRoutes must be set.\n\t\tif (this.gcDisabled || this.wipSerializedUsedRoutes !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t\t/**\n\t\t * The absence of wip used routes indicates that GC was not run on this node. This can happen if:\n\t\t * 1. A child node was created after GC was already run on the parent. For example, a data store\n\t\t * is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this\n\t\t * case, the parent will pass on used routes to the child nodes and it will have wip used routes.\n\t\t * 2. A new node was created but GC was never run on it. This can mean that the GC data generated\n\t\t * during summarize is incomplete.\n\t\t *\n\t\t * This happens due to scenarios such as data store created during summarize. Such errors should go away when\n\t\t * summarize is attempted again.\n\t\t */\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending\n\t * summary queue. We track this until we get an ack from the server for this summary.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t */\n\tprotected completeSummaryCore(proposalHandle: string, parentSkipRecursion: boolean): void {\n\t\tlet wipSerializedUsedRoutes: string | undefined;\n\t\t// If GC is disabled, don't set wip used routes.\n\t\tif (!this.gcDisabled) {\n\t\t\twipSerializedUsedRoutes = this.wipSerializedUsedRoutes;\n\t\t}\n\n\t\tsuper.completeSummaryCore(proposalHandle, parentSkipRecursion);\n\n\t\t// If GC is disabled, skip setting pending summary with GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst pendingSummaryInfo = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (pendingSummaryInfo !== undefined) {\n\t\t\t\tconst pendingSummaryInfoWithGC = {\n\t\t\t\t\tserializedUsedRoutes: wipSerializedUsedRoutes,\n\t\t\t\t\t...pendingSummaryInfo,\n\t\t\t\t};\n\t\t\t\tthis.pendingSummaries.set(proposalHandle, pendingSummaryInfoWithGC);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clears the work-in-progress state.\n\t */\n\tpublic clearSummary(): void {\n\t\tthis.wipSerializedUsedRoutes = undefined;\n\t\tthis.wipChildNodesUsedRoutes = undefined;\n\t\tsuper.clearSummary();\n\t}\n\n\t/**\n\t * Called when we get an ack from the server for a summary we sent. Update the reference state of this node\n\t * from the state in the pending summary queue.\n\t */\n\tprotected refreshLatestSummaryFromPending(\n\t\tproposalHandle: string,\n\t\treferenceSequenceNumber: number,\n\t): void {\n\t\t// If GC is disabled, skip setting referenced used routes since we are not tracking GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst pendingSummaryInfo = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (pendingSummaryInfo !== undefined) {\n\t\t\t\t// If a pending summary exists, it must have used routes since GC is enabled.\n\t\t\t\tconst summaryNodeWithGC = pendingSummaryInfo as PendingSummaryInfoWithGC;\n\t\t\t\tif (summaryNodeWithGC.serializedUsedRoutes === undefined) {\n\t\t\t\t\tconst error = new LoggingError(\"MissingGCStateInPendingSummary\", {\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\treferenceSequenceNumber,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tid: this.telemetryNodeId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\t\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: error.message,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tthis.referenceUsedRoutes = JSON.parse(\n\t\t\t\t\tsummaryNodeWithGC.serializedUsedRoutes,\n\t\t\t\t) as string[];\n\t\t\t}\n\t\t}\n\n\t\treturn super.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);\n\t}\n\n\t/**\n\t * Override the createChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic createChild(\n\t\t/**\n\t\t * Summarize function\n\t\t */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\tconfig: ISummarizerNodeConfigWithGC = {},\n\t\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t): ISummarizerNodeWithGC {\n\t\tassert(!this.children.has(id), 0x1b6 /* \"Create SummarizerNode child already exists\" */);\n\t\t/**\n\t\t * Update the child node's base GC details from this node's current GC details instead of updating from the base\n\t\t * GC details of this node. This will handle scenarios where the GC details was updated during refresh from\n\t\t * snapshot and the child node wasn't created then. If a child is created after that, its GC details should be\n\t\t * the one from the downloaded snapshot and not the base GC details.\n\t\t */\n\t\tconst getChildBaseGCDetailsFn = async (): Promise<IGarbageCollectionDetailsBase> => {\n\t\t\tconst childNodesBaseGCDetails = await this.childNodesBaseGCDetailsP;\n\t\t\treturn childNodesBaseGCDetails.get(id) ?? {};\n\t\t};\n\n\t\tconst createDetails: ICreateChildDetails = this.getCreateDetailsForChild(id, createParam);\n\t\tconst child = new SummarizerNodeWithGC(\n\t\t\tthis.logger,\n\t\t\tsummarizeInternalFn,\n\t\t\t{\n\t\t\t\t...config,\n\t\t\t\t// Propagate our gcDisabled state to the child if its not explicity specified in child's config.\n\t\t\t\tgcDisabled: config.gcDisabled ?? this.gcDisabled,\n\t\t\t},\n\t\t\tcreateDetails.summaryHandleId,\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.lastSummaryReferenceSequenceNumber,\n\t\t\tthis.wipSummaryLogger,\n\t\t\tgetGCDataFn,\n\t\t\tgetChildBaseGCDetailsFn,\n\t\t\tcreateDetails.telemetryNodeId,\n\t\t);\n\n\t\t// There may be additional state that has to be updated in this child. For example, if a summary is being\n\t\t// tracked, the child's summary tracking state needs to be updated too.\n\t\tthis.maybeUpdateChildState(child, id);\n\n\t\tthis.children.set(id, child);\n\t\treturn child;\n\t}\n\n\t/**\n\t * Updates the state of the child if required. For example, if a summary is currently being tracked, the child's\n\t * summary tracking state needs to be updated too.\n\t * Also, in case a child node gets realized in between Summary Op and Summary Ack, let's initialize the child's\n\t * pending summary as well. Finally, if the pendingSummaries entries have serializedRoutes, replicate them to the\n\t * pendingSummaries from the child nodes.\n\t * @param child - The child node whose state is to be updated.\n\t * @param id - Initial id or path part of this node\n\t */\n\tprotected maybeUpdateChildState(child: SummarizerNodeWithGC, id: string): void {\n\t\tsuper.maybeUpdateChildState(child, id);\n\n\t\t// If GC has run on this node and summarization isn't complete, this.wipSerializedUsedRoutes will be defined.\n\t\t// In that case, update the used routes of the child node. This can happen in scenarios where a data store\n\t\t// doesn't have any ops but its reference state changed. So, it gets realized during summarize after GC ran\n\t\t// so GC would not have run on this node which is fine.\n\t\tif (this.wipSerializedUsedRoutes !== undefined) {\n\t\t\t// If the child route used routes are not defined, initialize it now and it can be used for all child nodes\n\t\t\t// created until this summarization process is completed. This is an optimization to unpack the used routes\n\t\t\t// only when needed.\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy\n\t\t\tif (this.wipChildNodesUsedRoutes === undefined) {\n\t\t\t\tthis.wipChildNodesUsedRoutes = unpackChildNodesUsedRoutes(this.usedRoutes);\n\t\t\t}\n\t\t\tchild.updateUsedRoutes(this.wipChildNodesUsedRoutes.get(id) ?? [\"\"]);\n\t\t}\n\n\t\t// In case we have pending summaries on the parent, let's initialize it on the child.\n\t\tfor (const [key, pendingSummary] of this.pendingSummaries.entries()) {\n\t\t\tconst pendingSummaryWithGC = pendingSummary as PendingSummaryInfoWithGC;\n\t\t\tif (pendingSummaryWithGC.serializedUsedRoutes !== undefined) {\n\t\t\t\tconst childNodeUsedRoutes = unpackChildNodesUsedRoutes(\n\t\t\t\t\tJSON.parse(pendingSummaryWithGC.serializedUsedRoutes) as string[],\n\t\t\t\t);\n\t\t\t\tconst newSerializedRoutes = childNodeUsedRoutes.get(id) ?? [\"\"];\n\t\t\t\tconst childPendingSummaryInfo = {\n\t\t\t\t\t...pendingSummaryWithGC,\n\t\t\t\t\tserializedUsedRoutes: JSON.stringify(newSerializedRoutes),\n\t\t\t\t};\n\t\t\t\tchild.addPendingSummary(key, childPendingSummaryInfo);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Deletes the child node with the given id.\n\t */\n\tpublic deleteChild(id: string): void {\n\t\tthis.children.delete(id);\n\t}\n\n\t/**\n\t * Override the getChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic getChild(id: string): ISummarizerNodeWithGC | undefined {\n\t\treturn this.children.get(id) as SummarizerNodeWithGC;\n\t}\n\n\tpublic isReferenced(): boolean {\n\t\treturn this.usedRoutes.includes(\"\") || this.usedRoutes.includes(\"/\");\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]): void {\n\t\t// Sort the given routes before updating. This will ensure that the routes compared in hasUsedStateChanged()\n\t\t// are in the same order.\n\t\tthis.usedRoutes = usedRoutes.sort();\n\n\t\t// If GC is not disabled and a summary is in progress, update the work-in-progress used routes so that it can\n\t\t// be tracked for this summary.\n\t\tif (!this.gcDisabled && this.isSummaryInProgress()) {\n\t\t\tthis.wipSerializedUsedRoutes = JSON.stringify(this.usedRoutes);\n\t\t}\n\t}\n\n\t/**\n\t * Override the hasChanged method. If this node data or its used state changed, the node is considered changed.\n\t */\n\tprotected hasChanged(): boolean {\n\t\treturn this.hasDataChanged() || this.hasUsedStateChanged();\n\t}\n\n\t/**\n\t * This tells whether the data in this node has changed or not.\n\t */\n\tprivate hasDataChanged(): boolean {\n\t\treturn super.hasChanged();\n\t}\n\n\t/**\n\t * This tells whether the used state of this node has changed since last successful summary. If the used routes\n\t * of this node changed, its used state is considered changed. Basically, if this node or any of its child nodes\n\t * was previously used and became unused (or vice versa), its used state has changed.\n\t */\n\tprivate hasUsedStateChanged(): boolean {\n\t\t// If GC is disabled, it should not affect summary state, return false.\n\t\tif (this.gcDisabled) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tthis.referenceUsedRoutes === undefined ||\n\t\t\tJSON.stringify(this.usedRoutes) !== JSON.stringify(this.referenceUsedRoutes)\n\t\t);\n\t}\n}\n\n/**\n * Creates a root summarizer node with GC functionality built-in.\n * @param logger - Logger to use within SummarizerNode\n * @param summarizeInternalFn - Function to generate summary\n * @param changeSequenceNumber - Sequence number of latest change to new node/subtree\n * @param referenceSequenceNumber - Reference sequence number of last acked summary,\n * or undefined if not loaded from summary\n * @param config - Configure behavior of summarizer node\n * @param getGCDataFn - Function to get the GC data of this node\n * @param baseGCDetailsP - Function to get the initial GC details of this node\n */\nexport const createRootSummarizerNodeWithGC = (\n\tlogger: ITelemetryBaseLogger,\n\tsummarizeInternalFn: SummarizeInternalFn,\n\tchangeSequenceNumber: number,\n\treferenceSequenceNumber: number | undefined,\n\tconfig: ISummarizerNodeConfigWithGC = {},\n\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n): IRootSummarizerNodeWithGC =>\n\tnew SummarizerNodeWithGC(\n\t\tlogger,\n\t\tsummarizeInternalFn,\n\t\tconfig,\n\t\t\"\" /* summaryHandleId */,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber,\n\t\tundefined /* wipSummaryLogger */,\n\t\tgetGCDataFn,\n\t\tgetBaseGCDetailsFn,\n\t\t\"\" /* telemetryId */,\n\t);\n"]}
|
|
@@ -8,6 +8,7 @@ import type { IEventProvider, ITelemetryBaseProperties, ITelemetryBaseLogger } f
|
|
|
8
8
|
import type { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
9
9
|
import type { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
10
10
|
import type { ISummaryStats } from "@fluidframework/runtime-definitions/internal";
|
|
11
|
+
import type { TelemetryContext } from "@fluidframework/runtime-utils/internal";
|
|
11
12
|
import type { ITelemetryLoggerExt, ITelemetryLoggerPropertyBag } from "@fluidframework/telemetry-utils/internal";
|
|
12
13
|
import type { SummarizeReason } from "./summarizerUtils.js";
|
|
13
14
|
import type { EnqueueSummarizeResult, ISummarizeResults } from "./summaryDelayLoadedModule/index.js";
|
|
@@ -129,6 +130,10 @@ export interface ISubmitSummaryOptions extends ISummarizeOptions {
|
|
|
129
130
|
* The sequence number of the latest summary used to validate if summary state is correct before summarizing
|
|
130
131
|
*/
|
|
131
132
|
readonly latestSummaryRefSeqNum: number;
|
|
133
|
+
/**
|
|
134
|
+
* Shared telemetry context for the current summarize attempt.
|
|
135
|
+
*/
|
|
136
|
+
telemetryContext?: TelemetryContext;
|
|
132
137
|
}
|
|
133
138
|
/**
|
|
134
139
|
* @legacy @beta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerTypes.d.ts","sourceRoot":"","sources":["../../src/summary/summ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