@fluidframework/container-runtime 2.0.0-internal.1.4.4 → 2.0.0-internal.2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/batchManager.d.ts +2 -3
- package/dist/batchManager.d.ts.map +1 -1
- package/dist/batchManager.js +3 -8
- package/dist/batchManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +43 -16
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +107 -82
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +4 -20
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +17 -47
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +2 -5
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +3 -11
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +1 -10
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +43 -51
- package/dist/garbageCollection.js.map +1 -1
- package/dist/gcSweepReadyUsageDetection.d.ts.map +1 -1
- package/dist/gcSweepReadyUsageDetection.js +3 -12
- package/dist/gcSweepReadyUsageDetection.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +6 -26
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +42 -62
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summarizer.js +7 -2
- package/dist/summarizer.js.map +1 -1
- package/dist/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summarizerHeuristics.js +0 -3
- package/dist/summarizerHeuristics.js.map +1 -1
- package/dist/summarizerTypes.d.ts +19 -2
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryFormat.d.ts +4 -2
- package/dist/summaryFormat.d.ts.map +1 -1
- package/dist/summaryFormat.js.map +1 -1
- package/dist/summaryManager.d.ts.map +1 -1
- package/dist/summaryManager.js +10 -6
- package/dist/summaryManager.js.map +1 -1
- package/lib/batchManager.d.ts +2 -3
- package/lib/batchManager.d.ts.map +1 -1
- package/lib/batchManager.js +3 -8
- package/lib/batchManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +43 -16
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +108 -83
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +4 -20
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +18 -48
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +2 -5
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +3 -11
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +1 -10
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +42 -50
- package/lib/garbageCollection.js.map +1 -1
- package/lib/gcSweepReadyUsageDetection.d.ts.map +1 -1
- package/lib/gcSweepReadyUsageDetection.js +3 -12
- package/lib/gcSweepReadyUsageDetection.js.map +1 -1
- package/lib/index.d.ts +3 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +6 -26
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +42 -62
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summarizer.js +7 -2
- package/lib/summarizer.js.map +1 -1
- package/lib/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summarizerHeuristics.js +0 -3
- package/lib/summarizerHeuristics.js.map +1 -1
- package/lib/summarizerTypes.d.ts +19 -2
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryFormat.d.ts +4 -2
- package/lib/summaryFormat.d.ts.map +1 -1
- package/lib/summaryFormat.js.map +1 -1
- package/lib/summaryManager.d.ts.map +1 -1
- package/lib/summaryManager.js +10 -6
- package/lib/summaryManager.js.map +1 -1
- package/package.json +22 -65
- package/src/batchManager.ts +7 -11
- package/src/containerRuntime.ts +149 -100
- package/src/dataStoreContext.ts +20 -62
- package/src/dataStores.ts +2 -10
- package/src/garbageCollection.ts +45 -55
- package/src/gcSweepReadyUsageDetection.ts +2 -10
- package/src/index.ts +2 -3
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +57 -96
- package/src/scheduleManager.ts +1 -0
- package/src/summarizer.ts +6 -6
- package/src/summarizerHeuristics.ts +0 -3
- package/src/summarizerTypes.ts +20 -7
- package/src/summaryFormat.ts +4 -2
- package/src/summaryManager.ts +18 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryFormat.js","sourceRoot":"","sources":["../src/summaryFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAEtD,+DAA4D;AAC5D,+EAA6G;AAC7G,6EAA8F;AAC9F,2DAAgD;AAyChD,SAAgB,0BAA0B,CAAC,UAAwC;IAC/E,IAAI,UAAU,CAAC,oBAAoB,EAAE;QACjC;;;WAGG;QACH,OAAO,UAAU,CAAC,oBAAoB,CAAC;KAC1C;SAAM,IAAI,UAAU,CAAC,qBAAqB,KAAK,KAAK,EAAE;QACnD;;;WAGG;QACH,OAAO,CAAC,CAAC;KACZ;IACD;;;OAGG;IACH,OAAO,CAAC,CAAC;AACb,CAAC;AAnBD,gEAmBC;AAED,SAAgB,mBAAmB,CAAC,UAAwC;IACxE,OAAO,CAAC,CAA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gB,GAAG,WAAW,CAAC;AAE5C;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,CAAC,wBAAgB,EAAE,UAAU,EAAE,kBAAkB,EAAE,qBAAa,EAAE,6BAAS,CAAC,CAAC;AAEjG,QAAA,2BAA2B,GAAG,YAAY,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,SAAgB,yBAAyB,CAAC,eAAsC;IAC5E,eAAe,CAAC,OAAO,GAAG;QACtB,IAAI,EAAE,kCAAW,CAAC,IAAI;QACtB,IAAI,EAAE,EAAE,CAAC,sCAAgB,CAAC,EAAE,eAAe,CAAC,OAAO,EAAE;KACxD,CAAC;IACF,eAAe,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;AAC1C,CAAC;AAND,8DAMC;AAEM,KAAK,UAAU,2BAA2B,CAC7C,OAAgC,EAChC,QAAuB;IAEvB,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAY,EACjC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,mCAA2B,CAAC,CAAC,CAAC;IAC1D,qFAAqF;IACrF,mGAAmG;IACnG,uFAAuF;IACvF,0FAA0F;IAC1F,MAAM,aAAa,GAAG,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAA,qBAAM,EAAC,aAAa,GAAG,CAAC,EACpB,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACjD,OAAO,UAAU,CAAC;AACtB,CAAC;AAdD,kEAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport { ISequencedDocumentMessage, ISnapshotTree, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { channelsTreeName, ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { gcTreeKey } from \"./garbageCollection\";\n\ntype OmitAttributesVersions<T> = Omit<T, \"snapshotFormatVersion\" | \"summaryFormatVersion\">;\ninterface IFluidDataStoreAttributes0 {\n readonly snapshotFormatVersion?: undefined;\n readonly summaryFormatVersion?: undefined;\n pkg: string;\n /**\n * This tells whether a data store is root. Root data stores are never collected.\n * Non-root data stores may be collected if they are not used. If this is not present, default it to\n * true. This will ensure that older data stores are incorrectly collected.\n */\n readonly isRootDataStore?: boolean;\n}\ninterface IFluidDataStoreAttributes1 extends OmitAttributesVersions<IFluidDataStoreAttributes0> {\n readonly snapshotFormatVersion: \"0.1\";\n readonly summaryFormatVersion?: undefined;\n}\ninterface IFluidDataStoreAttributes2 extends OmitAttributesVersions<IFluidDataStoreAttributes1> {\n /** Switch from snapshotFormatVersion to summaryFormatVersion */\n readonly snapshotFormatVersion?: undefined;\n readonly summaryFormatVersion: 2;\n /**\n * True if channels are not isolated in .channels subtrees, otherwise isolated.\n * This is required in both datastore attributes as well as the root container,\n * because reused summary handles may cause different format versions in each\n * datastore subtree within the summary.\n */\n readonly disableIsolatedChannels?: true;\n}\n/**\n * Added IFluidDataStoreAttributes similar to IChannelAttributes which will tell the attributes of a\n * store like the package, snapshotFormatVersion to take different decisions based on a particular\n * snapshotFormatVersion.\n */\nexport type ReadFluidDataStoreAttributes =\n | IFluidDataStoreAttributes0\n | IFluidDataStoreAttributes1\n | IFluidDataStoreAttributes2;\nexport type WriteFluidDataStoreAttributes = IFluidDataStoreAttributes1 | IFluidDataStoreAttributes2;\n\nexport function getAttributesFormatVersion(attributes: ReadFluidDataStoreAttributes): number {\n if (attributes.summaryFormatVersion) {\n /**\n * Version 2+: Introduces .channels trees for isolation of\n * channel trees from data store objects.\n */\n return attributes.summaryFormatVersion;\n } else if (attributes.snapshotFormatVersion === \"0.1\") {\n /**\n * Version 1: from this version the pkg within the data store\n * attributes blob is a JSON array rather than a string.\n */\n return 1;\n }\n /**\n * Version 0: format version is missing from summary.\n * This indicates it is an older version.\n */\n return 0;\n}\n\nexport function hasIsolatedChannels(attributes: ReadFluidDataStoreAttributes): boolean {\n return !!attributes.summaryFormatVersion && !attributes.disableIsolatedChannels;\n}\nexport interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {\n readonly summaryFormatVersion: 1;\n /** The last message processed at the time of summary. Only primitive property types are added to the summary. */\n readonly message: ISummaryMetadataMessage | undefined;\n /** True if channels are not isolated in .channels subtrees, otherwise isolated. */\n readonly disableIsolatedChannels?: true;\n /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */\n readonly summaryNumber?: number;\n}\n\nexport interface ICreateContainerMetadata {\n /** Runtime version of the container when it was first created */\n createContainerRuntimeVersion?: string;\n /** Timestamp of the container when it was first created */\n createContainerTimestamp?: number;\n}\n\nexport type GCVersion = number;\nexport interface IGCMetadata {\n /**\n * The version of the GC code that was run to generate the GC data that is written in the summary.\n * Also, used to determine whether GC is enabled for this container or not:\n * - A value of 0 or undefined means GC is disabled.\n * - A value greater than 0 means GC is enabled.\n */\n readonly gcFeature?: GCVersion;\n /** If this is present, the session for this container will expire after this time and the container will close */\n readonly sessionExpiryTimeoutMs?: number;\n /**\n * Tells whether the GC sweep phase is enabled for this container.\n * - True means sweep phase is enabled.\n * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n */\n readonly sweepEnabled?: boolean;\n}\n\n/** The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary. */\nexport type ISummaryMetadataMessage = Pick<ISequencedDocumentMessage,\n | \"clientId\"\n | \"clientSequenceNumber\"\n | \"minimumSequenceNumber\"\n | \"referenceSequenceNumber\"\n | \"sequenceNumber\"\n | \"timestamp\"\n | \"type\">;\n\n/**\n * Extracts the properties from an ISequencedDocumentMessage as defined by ISummaryMetadataMessage. This message is\n * added to the metadata blob in summary.\n */\nexport const extractSummaryMetadataMessage = (\n message?: ISequencedDocumentMessage,\n): ISummaryMetadataMessage | undefined => message === undefined ? undefined : {\n clientId: message.clientId,\n clientSequenceNumber: message.clientSequenceNumber,\n minimumSequenceNumber: message.minimumSequenceNumber,\n referenceSequenceNumber: message.referenceSequenceNumber,\n sequenceNumber: message.sequenceNumber,\n timestamp: message.timestamp,\n type: message.type,\n};\n\nexport function getMetadataFormatVersion(metadata?: IContainerRuntimeMetadata): number {\n /**\n * Version 2+: Introduces runtime sequence number for data verification.\n *\n * Version 1+: Introduces .metadata blob and .channels trees for isolation of\n * data store trees from container-level objects.\n * Also introduces enableGC option stored in the summary.\n *\n * Version 0: metadata blob missing; format version is missing from summary.\n * This indicates it is an older version.\n */\n return metadata?.summaryFormatVersion ?? 0;\n}\n\nexport const aliasBlobName = \".aliases\";\nexport const metadataBlobName = \".metadata\";\nexport const chunksBlobName = \".chunks\";\nexport const electedSummarizerBlobName = \".electedSummarizer\";\nexport const blobsTreeName = \".blobs\";\n\nexport function rootHasIsolatedChannels(metadata?: IContainerRuntimeMetadata): boolean {\n return !!metadata && !metadata.disableIsolatedChannels;\n}\n\nexport function getGCVersion(metadata?: IGCMetadata): GCVersion {\n if (!metadata) {\n // Force to 0/disallowed in prior versions\n return 0;\n }\n return metadata.gcFeature ?? 0;\n}\n\nexport const protocolTreeName = \".protocol\";\n\n/**\n * List of tree IDs at the container level which are reserved.\n * This is for older versions of summaries that do not yet have an\n * isolated data stores namespace. Without the namespace, this must\n * be used to prevent name collisions with data store IDs.\n */\nexport const nonDataStorePaths = [protocolTreeName, \".logTail\", \".serviceProtocol\", blobsTreeName, gcTreeKey];\n\nexport const dataStoreAttributesBlobName = \".component\";\n\n/**\n * Modifies summary tree and stats to put tree under .channels tree.\n *\n * @param summarizeResult - Summary tree and stats to modify\n *\n * @example\n * Converts from:\n * ```typescript\n * {\n * type: SummaryType.Tree,\n * tree: { a: {...}, b: {...}, c: {...} },\n * }\n * ```\n *\n * to:\n *\n * ```typescript\n * {\n * type: SummaryType.Tree,\n * tree: {\n * \".channels\": {\n * type: SummaryType.Tree,\n * tree: { a: {...}, b: {...}, c: {...} }\n * },\n * },\n * }\n * ```\n * And adds +1 to treeNodeCount in stats.\n */\nexport function wrapSummaryInChannelsTree(summarizeResult: ISummaryTreeWithStats): void {\n summarizeResult.summary = {\n type: SummaryType.Tree,\n tree: { [channelsTreeName]: summarizeResult.summary },\n };\n summarizeResult.stats.treeNodeCount++;\n}\n\nexport async function getFluidDataStoreAttributes(\n storage: IDocumentStorageService,\n snapshot: ISnapshotTree,\n): Promise<ReadFluidDataStoreAttributes> {\n const attributes = await readAndParse<ReadFluidDataStoreAttributes>(\n storage, snapshot.blobs[dataStoreAttributesBlobName]);\n // Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.\n // For snapshotFormatVersion = \"0.1\" (1) or above, pkg is jsonified, otherwise it is just a string.\n // However the feature of loading a detached container from snapshot, is added when the\n // snapshotFormatVersion is at least \"0.1\" (1), so we don't expect it to be anything else.\n const formatVersion = getAttributesFormatVersion(attributes);\n assert(formatVersion > 0,\n 0x1d5 /* Invalid snapshot format version */);\n return attributes;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"summaryFormat.js","sourceRoot":"","sources":["../src/summaryFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAEtD,+DAA4D;AAC5D,+EAA6G;AAC7G,6EAA8F;AAC9F,2DAAgD;AAyChD,SAAgB,0BAA0B,CAAC,UAAwC;IAC/E,IAAI,UAAU,CAAC,oBAAoB,EAAE;QACjC;;;WAGG;QACH,OAAO,UAAU,CAAC,oBAAoB,CAAC;KAC1C;SAAM,IAAI,UAAU,CAAC,qBAAqB,KAAK,KAAK,EAAE;QACnD;;;WAGG;QACH,OAAO,CAAC,CAAC;KACZ;IACD;;;OAGG;IACH,OAAO,CAAC,CAAC;AACb,CAAC;AAnBD,gEAmBC;AAED,SAAgB,mBAAmB,CAAC,UAAwC;IACxE,OAAO,CAAC,CAAC,UAAU,CAAC,oBAAoB,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC;AACpF,CAAC;AAFD,kDAEC;AAiDD;;;GAGG;AACI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EAAE,qBAAa,EAAE,6BAAS,CAAC,CAAC;AAEjG,QAAA,2BAA2B,GAAG,YAAY,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,SAAgB,yBAAyB,CAAC,eAAsC;IAC5E,eAAe,CAAC,OAAO,GAAG;QACtB,IAAI,EAAE,kCAAW,CAAC,IAAI;QACtB,IAAI,EAAE,EAAE,CAAC,sCAAgB,CAAC,EAAE,eAAe,CAAC,OAAO,EAAE;KACxD,CAAC;IACF,eAAe,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;AAC1C,CAAC;AAND,8DAMC;AAEM,KAAK,UAAU,2BAA2B,CAC7C,OAAgC,EAChC,QAAuB;IAEvB,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAY,EACjC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,mCAA2B,CAAC,CAAC,CAAC;IAC1D,qFAAqF;IACrF,mGAAmG;IACnG,uFAAuF;IACvF,0FAA0F;IAC1F,MAAM,aAAa,GAAG,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAA,qBAAM,EAAC,aAAa,GAAG,CAAC,EACpB,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACjD,OAAO,UAAU,CAAC;AACtB,CAAC;AAdD,kEAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport { ISequencedDocumentMessage, ISnapshotTree, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { channelsTreeName, ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { gcTreeKey } from \"./garbageCollection\";\n\ntype OmitAttributesVersions<T> = Omit<T, \"snapshotFormatVersion\" | \"summaryFormatVersion\">;\ninterface IFluidDataStoreAttributes0 {\n readonly snapshotFormatVersion?: undefined;\n readonly summaryFormatVersion?: undefined;\n pkg: string;\n /**\n * This tells whether a data store is root. Root data stores are never collected.\n * Non-root data stores may be collected if they are not used. If this is not present, default it to\n * true. This will ensure that older data stores are incorrectly collected.\n */\n readonly isRootDataStore?: boolean;\n}\ninterface IFluidDataStoreAttributes1 extends OmitAttributesVersions<IFluidDataStoreAttributes0> {\n readonly snapshotFormatVersion: \"0.1\";\n readonly summaryFormatVersion?: undefined;\n}\ninterface IFluidDataStoreAttributes2 extends OmitAttributesVersions<IFluidDataStoreAttributes1> {\n /** Switch from snapshotFormatVersion to summaryFormatVersion */\n readonly snapshotFormatVersion?: undefined;\n readonly summaryFormatVersion: 2;\n /**\n * True if channels are not isolated in .channels subtrees, otherwise isolated.\n * This is required in both datastore attributes as well as the root container,\n * because reused summary handles may cause different format versions in each\n * datastore subtree within the summary.\n */\n readonly disableIsolatedChannels?: true;\n}\n/**\n * Added IFluidDataStoreAttributes similar to IChannelAttributes which will tell the attributes of a\n * store like the package, snapshotFormatVersion to take different decisions based on a particular\n * snapshotFormatVersion.\n */\nexport type ReadFluidDataStoreAttributes =\n | IFluidDataStoreAttributes0\n | IFluidDataStoreAttributes1\n | IFluidDataStoreAttributes2;\nexport type WriteFluidDataStoreAttributes = IFluidDataStoreAttributes1 | IFluidDataStoreAttributes2;\n\nexport function getAttributesFormatVersion(attributes: ReadFluidDataStoreAttributes): number {\n if (attributes.summaryFormatVersion) {\n /**\n * Version 2+: Introduces .channels trees for isolation of\n * channel trees from data store objects.\n */\n return attributes.summaryFormatVersion;\n } else if (attributes.snapshotFormatVersion === \"0.1\") {\n /**\n * Version 1: from this version the pkg within the data store\n * attributes blob is a JSON array rather than a string.\n */\n return 1;\n }\n /**\n * Version 0: format version is missing from summary.\n * This indicates it is an older version.\n */\n return 0;\n}\n\nexport function hasIsolatedChannels(attributes: ReadFluidDataStoreAttributes): boolean {\n return !!attributes.summaryFormatVersion && !attributes.disableIsolatedChannels;\n}\nexport interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {\n readonly summaryFormatVersion: 1;\n /** The last message processed at the time of summary. Only primitive property types are added to the summary. */\n readonly message: ISummaryMetadataMessage | undefined;\n /** True if channels are not isolated in .channels subtrees, otherwise isolated. */\n readonly disableIsolatedChannels?: true;\n /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */\n readonly summaryNumber?: number;\n}\n\nexport interface ICreateContainerMetadata {\n /** Runtime version of the container when it was first created */\n createContainerRuntimeVersion?: string;\n /** Timestamp of the container when it was first created */\n createContainerTimestamp?: number;\n}\n\nexport type GCVersion = number;\nexport interface IGCMetadata {\n /**\n * The version of the GC code that was run to generate the GC data that is written in the summary.\n * Also, used to determine whether GC is enabled for this container or not:\n * - A value of 0 or undefined means GC is disabled.\n * - A value greater than 0 means GC is enabled.\n */\n readonly gcFeature?: GCVersion;\n /**\n * Tells whether the GC sweep phase is enabled for this container.\n * - True means sweep phase is enabled.\n * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n */\n readonly sweepEnabled?: boolean;\n /** If this is present, the session for this container will expire after this time and the container will close */\n readonly sessionExpiryTimeoutMs?: number;\n /** How long to wait after an object is unreferenced before deleting it via GC Sweep */\n readonly sweepTimeoutMs?: number;\n}\n\n/** The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary. */\nexport type ISummaryMetadataMessage = Pick<ISequencedDocumentMessage,\n | \"clientId\"\n | \"clientSequenceNumber\"\n | \"minimumSequenceNumber\"\n | \"referenceSequenceNumber\"\n | \"sequenceNumber\"\n | \"timestamp\"\n | \"type\">;\n\n/**\n * Extracts the properties from an ISequencedDocumentMessage as defined by ISummaryMetadataMessage. This message is\n * added to the metadata blob in summary.\n */\nexport const extractSummaryMetadataMessage = (\n message?: ISequencedDocumentMessage,\n): ISummaryMetadataMessage | undefined => message === undefined ? undefined : {\n clientId: message.clientId,\n clientSequenceNumber: message.clientSequenceNumber,\n minimumSequenceNumber: message.minimumSequenceNumber,\n referenceSequenceNumber: message.referenceSequenceNumber,\n sequenceNumber: message.sequenceNumber,\n timestamp: message.timestamp,\n type: message.type,\n};\n\nexport function getMetadataFormatVersion(metadata?: IContainerRuntimeMetadata): number {\n /**\n * Version 2+: Introduces runtime sequence number for data verification.\n *\n * Version 1+: Introduces .metadata blob and .channels trees for isolation of\n * data store trees from container-level objects.\n * Also introduces enableGC option stored in the summary.\n *\n * Version 0: metadata blob missing; format version is missing from summary.\n * This indicates it is an older version.\n */\n return metadata?.summaryFormatVersion ?? 0;\n}\n\nexport const aliasBlobName = \".aliases\";\nexport const metadataBlobName = \".metadata\";\nexport const chunksBlobName = \".chunks\";\nexport const electedSummarizerBlobName = \".electedSummarizer\";\nexport const blobsTreeName = \".blobs\";\n\nexport function rootHasIsolatedChannels(metadata?: IContainerRuntimeMetadata): boolean {\n return !!metadata && !metadata.disableIsolatedChannels;\n}\n\nexport function getGCVersion(metadata?: IGCMetadata): GCVersion {\n if (!metadata) {\n // Force to 0/disallowed in prior versions\n return 0;\n }\n return metadata.gcFeature ?? 0;\n}\n\nexport const protocolTreeName = \".protocol\";\n\n/**\n * List of tree IDs at the container level which are reserved.\n * This is for older versions of summaries that do not yet have an\n * isolated data stores namespace. Without the namespace, this must\n * be used to prevent name collisions with data store IDs.\n */\nexport const nonDataStorePaths = [protocolTreeName, \".logTail\", \".serviceProtocol\", blobsTreeName, gcTreeKey];\n\nexport const dataStoreAttributesBlobName = \".component\";\n\n/**\n * Modifies summary tree and stats to put tree under .channels tree.\n *\n * @param summarizeResult - Summary tree and stats to modify\n *\n * @example\n * Converts from:\n * ```typescript\n * {\n * type: SummaryType.Tree,\n * tree: { a: {...}, b: {...}, c: {...} },\n * }\n * ```\n *\n * to:\n *\n * ```typescript\n * {\n * type: SummaryType.Tree,\n * tree: {\n * \".channels\": {\n * type: SummaryType.Tree,\n * tree: { a: {...}, b: {...}, c: {...} }\n * },\n * },\n * }\n * ```\n * And adds +1 to treeNodeCount in stats.\n */\nexport function wrapSummaryInChannelsTree(summarizeResult: ISummaryTreeWithStats): void {\n summarizeResult.summary = {\n type: SummaryType.Tree,\n tree: { [channelsTreeName]: summarizeResult.summary },\n };\n summarizeResult.stats.treeNodeCount++;\n}\n\nexport async function getFluidDataStoreAttributes(\n storage: IDocumentStorageService,\n snapshot: ISnapshotTree,\n): Promise<ReadFluidDataStoreAttributes> {\n const attributes = await readAndParse<ReadFluidDataStoreAttributes>(\n storage, snapshot.blobs[dataStoreAttributesBlobName]);\n // Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.\n // For snapshotFormatVersion = \"0.1\" (1) or above, pkg is jsonified, otherwise it is just a string.\n // However the feature of loading a detached container from snapshot, is added when the\n // snapshotFormatVersion is at least \"0.1\" (1), so we don't expect it to be anything else.\n const formatVersion = getAttributesFormatVersion(attributes);\n assert(formatVersion > 0,\n 0x1d5 /* Invalid snapshot format version */);\n return attributes;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryManager.d.ts","sourceRoot":"","sources":["../src/summaryManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACH,WAAW,EAEd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,oBAAY,mBAAmB;IAC3B,GAAG,IAAI;IACP,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,QAAQ,IAAI;CACf;
|
|
1
|
+
{"version":3,"file":"summaryManager.d.ts","sourceRoot":"","sources":["../src/summaryManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB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jD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,SAAS,CAAS;IAE1B,IAAW,QAAQ,YAElB;IAED,IAAW,YAAY,wBAAyB;gBAG3B,cAAc,EAAE,yBAAyB,EACzC,cAAc,EAAE,eAAe,EAC/B,iBAAiB,EAC9B,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,eAAe,GAAG,kBAAkB,CAAC,EACrF,YAAY,EAAE,gBAAgB;IAC9B;2CACuC;IACtB,mBAAmB,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,EAC/C,cAAc,EAAE,UAAU,EAC3C,EACI,cAAsC,EACtC,uBAAwD,GAC3D,GAAE,QAAQ,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAM,EAC/B,iBAAiB,CAAC,qBAAS;IAehD;;;OAGG;IACI,KAAK,IAAI,IAAI;IAKpB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAM9B;IAEF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAEjC;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CACyC;IAEpF,OAAO,CAAC,uBAAuB;IA4B/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CA+BhC;IAEF,OAAO,CAAC,kBAAkB;IAsG1B,OAAO,CAAC,IAAI;IAWZ;;;;OAIG;YACW,6BAA6B;IAqD3C,SAAgB,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAMjE;IAEF,SAAgB,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAM/D;IAEK,OAAO;CAMjB"}
|
package/dist/summaryManager.js
CHANGED
|
@@ -116,15 +116,19 @@ class SummaryManager {
|
|
|
116
116
|
// enforce connectedState.clientId === clientElection.electedClientId. But once we're Running, we should
|
|
117
117
|
// only transition to Stopping when the electedParentId changes. Stopping the summarizer without
|
|
118
118
|
// changing the electedParent will just cause us to transition to Starting again.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return { shouldSummarize: false, stopReason: "parentShouldNotSummarize" };
|
|
119
|
+
// New Parent has been elected and it is not the current client, or
|
|
120
|
+
if (this.connectedState.clientId !== this.clientElection.electedParentId) {
|
|
121
|
+
return { shouldSummarize: false, stopReason: "notElectedParent" };
|
|
123
122
|
}
|
|
124
|
-
|
|
123
|
+
// We are not already running the summarizer and we are not the current elected client id.
|
|
124
|
+
if (this.state !== SummaryManagerState.Running &&
|
|
125
|
+
this.connectedState.clientId !== this.clientElection.electedClientId) {
|
|
126
|
+
return { shouldSummarize: false, stopReason: "notElectedClient" };
|
|
127
|
+
}
|
|
128
|
+
if (!this.connectedState.connected) {
|
|
125
129
|
return { shouldSummarize: false, stopReason: "parentNotConnected" };
|
|
126
130
|
}
|
|
127
|
-
|
|
131
|
+
if (this.disposed) {
|
|
128
132
|
(0, common_utils_1.assert)(false, 0x260 /* "Disposed should mean disconnected!" */);
|
|
129
133
|
}
|
|
130
134
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryManager.js","sourceRoot":"","sources":["../src/summaryManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAsD;AACtD,qEAAgF;AAChF,2EAAqE;AAQrE,6CAA0C;AAE1C,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAE5C,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,2DAAO,CAAA;IACP,qEAAY,CAAA;IACZ,mEAAW,CAAA;IACX,qEAAY,CAAA;AAChB,CAAC,EALW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAK9B;AAuCD;;;;GAIG;AACH,MAAa,cAAc;IAevB,YACqB,cAAyC,EACzC,cAA+B,EAC/B,iBACoE,EACrF,YAA8B;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AAC,iBAAiB,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;SAC1D;QACD,OAAO,qBAAqB,CAAC;IACjC,CAAC;IAkBM,OAAO;QACV,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,0BAA0B,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC5E,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC3D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACjE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;;AAvTL,wCAwTC;AAvP2B,kCAAmB,GAAG,CAAC,KAA0B,EAAE,EAAE,CACzE,KAAK,KAAK,mBAAmB,CAAC,QAAQ,IAAI,KAAK,KAAK,mBAAmB,CAAC,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEvent, IEventProvider, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { ChildLogger, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { ISummarizerClientElection } from \"./summarizerClientElection\";\nimport { IThrottler } from \"./throttler\";\nimport {\n ISummarizer,\n SummarizerStopReason,\n} from \"./summarizerTypes\";\nimport { SummaryCollection } from \"./summaryCollection\";\nimport { Summarizer } from \"./summarizer\";\n\nconst defaultInitialDelayMs = 5000;\nconst defaultOpsToBypassInitialDelay = 4000;\n\nexport enum SummaryManagerState {\n Off = 0,\n Starting = 1,\n Running = 2,\n Stopping = 3,\n}\n\n// Please note that all reasons in this list are not errors,\n// and thus they are not raised today to parent container as error.\n// If this needs to be changed in future, we should re-evaluate what and how we raise to summarizer\ntype StopReason = Extract<SummarizerStopReason, \"parentNotConnected\" | \"parentShouldNotSummarize\">;\ntype ShouldSummarizeState =\n | { shouldSummarize: true; }\n | { shouldSummarize: false; stopReason: StopReason; };\n\nexport interface IConnectedEvents extends IEvent {\n (event: \"connected\", listener: (clientId: string) => void);\n (event: \"disconnected\", listener: () => void);\n}\n\n/**\n * IConnectedState describes an object that SummaryManager can watch to observe connection/disconnection.\n *\n * Under current implementation, its role will be fulfilled by the ContainerRuntime, but this could be replaced\n * with anything else that fulfills the contract if we want to shift the layer that the SummaryManager lives at.\n */\nexport interface IConnectedState extends IEventProvider<IConnectedEvents> {\n readonly connected: boolean;\n\n /**\n * Under current implementation this is undefined if we've never connected, otherwise it's the clientId from our\n * latest connection (even if we've since disconnected!). Although this happens to be the behavior we want in\n * SummaryManager, I suspect that globally we may eventually want to modify this behavior (e.g. make clientId\n * undefined while disconnected). To protect against this, let's assume this field can't be trusted while\n * disconnected and instead separately track \"latest clientId\" in SummaryManager.\n */\n readonly clientId: string | undefined;\n}\n\nexport interface ISummaryManagerConfig {\n initialDelayMs: number;\n opsToBypassInitialDelay: number;\n}\n\n/**\n * SummaryManager is created by parent container (i.e. interactive container with clientType !== \"summarizer\") only.\n * It observes changes in calculated summarizer and reacts to changes by either creating summarizer client or\n * stopping existing summarizer client.\n */\nexport class SummaryManager implements IDisposable {\n private readonly logger: ITelemetryLogger;\n private readonly opsToBypassInitialDelay: number;\n private readonly initialDelayMs: number;\n private latestClientId: string | undefined;\n private state = SummaryManagerState.Off;\n private summarizer?: ISummarizer;\n private _disposed = false;\n\n public get disposed() {\n return this._disposed;\n }\n\n public get currentState() { return this.state; }\n\n constructor(\n private readonly clientElection: ISummarizerClientElection,\n private readonly connectedState: IConnectedState,\n private readonly summaryCollection:\n Pick<SummaryCollection, \"opsSinceLastAck\" | \"addOpListener\" | \"removeOpListener\">,\n parentLogger: ITelemetryLogger,\n /** Creates summarizer by asking interactive container to spawn summarizing container and\n * get back its Summarizer instance. */\n private readonly requestSummarizerFn: () => Promise<ISummarizer>,\n private readonly startThrottler: IThrottler,\n {\n initialDelayMs = defaultInitialDelayMs,\n opsToBypassInitialDelay = defaultOpsToBypassInitialDelay,\n }: Readonly<Partial<ISummaryManagerConfig>> = {},\n private readonly disableHeuristics?: boolean,\n ) {\n this.logger = ChildLogger.create(\n parentLogger,\n \"SummaryManager\",\n { all: { clientId: () => this.latestClientId } });\n\n this.connectedState.on(\"connected\", this.handleConnected);\n this.connectedState.on(\"disconnected\", this.handleDisconnected);\n this.latestClientId = this.connectedState.clientId;\n\n this.opsToBypassInitialDelay = opsToBypassInitialDelay;\n this.initialDelayMs = initialDelayMs;\n }\n\n /**\n * Until start is called, the SummaryManager won't begin attempting to start summarization. This ensures there's\n * a window between construction and starting where the caller can attach listeners.\n */\n public start(): void {\n this.clientElection.on(\"electedSummarizerChanged\", this.refreshSummarizer);\n this.refreshSummarizer();\n }\n\n private readonly handleConnected = (clientId: string) => {\n this.latestClientId = clientId;\n // If we have a summarizer, it should have been either cancelled on disconnected by now.\n // But because of lastSummary process, it can still hang around, so there is not much we can\n // check or assert.\n this.refreshSummarizer();\n };\n\n private readonly handleDisconnected = () => {\n this.refreshSummarizer();\n };\n\n private static readonly isStartingOrRunning = (state: SummaryManagerState) =>\n state === SummaryManagerState.Starting || state === SummaryManagerState.Running;\n\n private getShouldSummarizeState(): ShouldSummarizeState {\n // Note that if we're in the Running state, the electedClient may be a summarizer client, so we can't\n // enforce connectedState.clientId === clientElection.electedClientId. But once we're Running, we should\n // only transition to Stopping when the electedParentId changes. Stopping the summarizer without\n // changing the electedParent will just cause us to transition to Starting again.\n if (this.connectedState.clientId !== this.clientElection.electedParentId ||\n (this.state !== SummaryManagerState.Running &&\n this.connectedState.clientId !== this.clientElection.electedClientId)) {\n return { shouldSummarize: false, stopReason: \"parentShouldNotSummarize\" };\n } else if (!this.connectedState.connected) {\n return { shouldSummarize: false, stopReason: \"parentNotConnected\" };\n } else if (this.disposed) {\n assert(false, 0x260 /* \"Disposed should mean disconnected!\" */);\n } else {\n return { shouldSummarize: true };\n }\n }\n\n private readonly refreshSummarizer = () => {\n // Transition states depending on shouldSummarize, which is a calculated property\n // that is only true if this client is connected and is the elected summarizer.\n const shouldSummarizeState = this.getShouldSummarizeState();\n switch (this.state) {\n case SummaryManagerState.Off: {\n if (shouldSummarizeState.shouldSummarize) {\n this.startSummarization();\n }\n return;\n }\n case SummaryManagerState.Starting: {\n // Cannot take any action until summarizer is created\n // state transition will occur after creation\n return;\n }\n case SummaryManagerState.Running: {\n if (shouldSummarizeState.shouldSummarize === false) {\n this.stop(shouldSummarizeState.stopReason);\n }\n return;\n }\n case SummaryManagerState.Stopping: {\n // Cannot take any action until running summarizer finishes\n // state transition will occur after it stops\n return;\n }\n default: {\n return;\n }\n }\n };\n\n private startSummarization() {\n assert(this.state === SummaryManagerState.Off, 0x261 /* \"Expected: off\" */);\n this.state = SummaryManagerState.Starting;\n\n assert(this.summarizer === undefined, 0x262 /* \"Old summarizer is still working!\" */);\n\n this.delayBeforeCreatingSummarizer().then(async (startWithInitialDelay: boolean) => {\n // Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore\n // but only if creation was delayed. If it was not, then we want to ensure we always create\n // a summarizer to kick off lastSummary. Without that, we would not be able to summarize and get\n // document out of broken state if it has too many ops and ordering service keeps nacking main\n // container (and thus it goes into cycle of reconnects)\n // If we can't run the LastSummary, simply return as to avoid paying the cost of launching\n // the summarizer at all.\n const shouldSummarizeStateEarlyStage = this.getShouldSummarizeState();\n if (startWithInitialDelay &&\n shouldSummarizeStateEarlyStage.shouldSummarize === false) {\n return `early exit ${shouldSummarizeStateEarlyStage.stopReason}`;\n }\n\n // We transition to Running before requesting the summarizer, because after requesting we can't predict\n // when the electedClient will be replaced with the new summarizer client.\n // The alternative would be to let connectedState.clientId !== clientElection.electedClientId when\n // state === Starting || state === Running.\n assert(this.state === SummaryManagerState.Starting, 0x263 /* \"Expected: starting\" */);\n this.state = SummaryManagerState.Running;\n\n const summarizer = await this.requestSummarizerFn();\n this.summarizer = summarizer;\n\n // Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore\n // If we can't run the LastSummary, simply return as to avoid paying the cost of launching\n // the summarizer at all.\n const shouldSummarizeState = this.getShouldSummarizeState();\n if (shouldSummarizeState.shouldSummarize === false) {\n // In order to allow the last summary to run, we not only need a stop reason that would\n // allow it but also, startWithInitialDelay to be false (start the summarization immediately),\n // which would happen when we have a high enough number of unsummarized ops.\n if (startWithInitialDelay || !Summarizer.stopReasonCanRunLastSummary(shouldSummarizeState.stopReason)) {\n this.state = SummaryManagerState.Starting;\n summarizer.stop(shouldSummarizeState.stopReason);\n return `early exit after starting summarizer ${shouldSummarizeState.stopReason}`;\n }\n this.logger.sendTelemetryEvent({\n eventName: \"LastAttemptToSummarize\",\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const clientId = this.latestClientId!;\n\n return PerformanceEvent.timedExecAsync(\n this.logger,\n { eventName: \"RunningSummarizer\", attempt: this.startThrottler.numAttempts },\n async () => summarizer.run(clientId, this.disableHeuristics),\n );\n }).then((reason: string) => {\n this.logger.sendTelemetryEvent({\n eventName: \"EndingSummarizer\",\n reason,\n });\n }).catch((error) => {\n this.logger.sendTelemetryEvent(\n {\n eventName: \"EndingSummarizer\",\n reason: \"exception\",\n },\n error);\n\n // Most of exceptions happen due to container being closed while loading it, due to\n // summarizer container loosing connection while load.\n // Not worth reporting such errors as errors. That said, we might miss some real errors if\n // we ignore blindly, so try to narrow signature we are looking for - skip logging\n // error only if this client should no longer be a summarizer (which in practice\n // means it also lost connection), and error happened on load (we do not have summarizer).\n // We could annotate the error raised in Container.load where the container closed during load with no error\n // and check for that case here, but that does not seem to be necessary.\n if (this.getShouldSummarizeState().shouldSummarize || this.summarizer !== undefined) {\n // Report any failure as an error unless it was due to cancellation (like \"disconnected\" error)\n // If failure happened on container load, we may not yet realized that socket disconnected, so check\n // offlineError.\n const category = error?.errorType === DriverErrorType.offlineError ? \"generic\" : \"error\";\n this.logger.sendTelemetryEvent(\n {\n eventName: \"SummarizerException\",\n category,\n },\n error);\n }\n }).finally(() => {\n assert(this.state !== SummaryManagerState.Off, 0x264 /* \"Expected: Not Off\" */);\n this.state = SummaryManagerState.Off;\n\n this.summarizer?.close();\n this.summarizer = undefined;\n\n if (this.getShouldSummarizeState().shouldSummarize) {\n this.startSummarization();\n }\n });\n }\n\n private stop(reason: SummarizerStopReason) {\n if (!SummaryManager.isStartingOrRunning(this.state)) {\n return;\n }\n this.state = SummaryManagerState.Stopping;\n\n // Stopping the running summarizer client should trigger a change\n // in states when the running summarizer closes\n this.summarizer?.stop(reason);\n }\n\n /**\n * Implements initial delay before creating summarizer\n * @returns `true`, if creation is delayed due to heuristics (not many ops to summarize).\n * `false` if summarizer should start immediately due to too many unsummarized ops.\n */\n private async delayBeforeCreatingSummarizer(): Promise<boolean> {\n // throttle creation of new summarizer containers to prevent spamming the server with websocket connections\n let delayMs = this.startThrottler.getDelay();\n\n // We have been elected the summarizer. Some day we may be able to summarize with a live document but for\n // now we play it safe and launch a second copy.\n this.logger.sendTelemetryEvent({\n eventName: \"CreatingSummarizer\",\n throttlerDelay: delayMs,\n initialDelay: this.initialDelayMs,\n startThrottlerMaxDelayMs: this.startThrottler.maxDelayMs,\n opsSinceLastAck: this.summaryCollection.opsSinceLastAck,\n opsToBypassInitialDelay: this.opsToBypassInitialDelay,\n });\n\n // This delay helps ensure that last summarizer that might be left from previous client\n // has enough time to complete its last summary and thus new summarizer not conflict with previous one.\n // If, however, there are too many unsummarized ops, try to resolve it as quickly as possible, with\n // understanding that we may see nacks because of such quick action.\n // A better design would be for summarizer election logic to always select current summarizer as\n // summarizing client (i.e. clientType === \"summarizer\" can be elected) to ensure that nobody else can\n // summarizer while it finishes its work and moves to exit.\n // It also helps with pure boot scenario (single client) to offset expensive work a bit out from\n // critical boot sequence.\n let startWithInitialDelay = false;\n if (this.summaryCollection.opsSinceLastAck < this.opsToBypassInitialDelay) {\n startWithInitialDelay = true;\n delayMs = Math.max(delayMs, this.initialDelayMs);\n }\n\n if (delayMs > 0) {\n let timer;\n let resolveOpPromiseFn;\n // Create a listener that will break the delay if we've exceeded the initial delay ops count.\n const opsListenerFn = () => {\n if (this.summaryCollection.opsSinceLastAck >= this.opsToBypassInitialDelay) {\n clearTimeout(timer);\n resolveOpPromiseFn();\n }\n };\n // Create a Promise that will resolve when the delay expires.\n const delayPromise = new Promise<void>((resolve) => {\n timer = setTimeout(() => resolve(), delayMs);\n });\n // Create a Promise that will resolve if the ops count passes the threshold.\n const opPromise = new Promise<void>((resolve) => { resolveOpPromiseFn = resolve; });\n this.summaryCollection.addOpListener(opsListenerFn);\n await Promise.race([delayPromise, opPromise]);\n this.summaryCollection.removeOpListener(opsListenerFn);\n }\n return startWithInitialDelay;\n }\n\n public readonly summarizeOnDemand: ISummarizer[\"summarizeOnDemand\"] = (...args) => {\n if (this.summarizer === undefined) {\n throw Error(\"No running summarizer client\");\n // TODO: could spawn a summarizer client temporarily.\n }\n return this.summarizer.summarizeOnDemand(...args);\n };\n\n public readonly enqueueSummarize: ISummarizer[\"enqueueSummarize\"] = (...args) => {\n if (this.summarizer === undefined) {\n throw Error(\"No running summarizer client\");\n // TODO: could spawn a summarizer client temporarily.\n }\n return this.summarizer.enqueueSummarize(...args);\n };\n\n public dispose() {\n this.clientElection.off(\"electedSummarizerChanged\", this.refreshSummarizer);\n this.connectedState.off(\"connected\", this.handleConnected);\n this.connectedState.off(\"disconnected\", this.handleDisconnected);\n this._disposed = true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"summaryManager.js","sourceRoot":"","sources":["../src/summaryManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAsD;AACtD,qEAAgF;AAChF,2EAAqE;AAQrE,6CAA0C;AAE1C,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAE5C,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,2DAAO,CAAA;IACP,qE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CAAC,CAAC,CAAC;YACH,4EAA4E;YAC5E,MAAM,SAAS,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,GAAG,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YACpF,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;YACpD,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;SAC1D;QACD,OAAO,qBAAqB,CAAC;IACjC,CAAC;IAkBM,OAAO;QACV,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,0BAA0B,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC5E,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC3D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACjE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;;AAjUL,wCAkUC;AAjQ2B,kCAAmB,GAAG,CAAC,KAA0B,EAAE,EAAE,CACzE,KAAK,KAAK,mBAAmB,CAAC,QAAQ,IAAI,KAAK,KAAK,mBAAmB,CAAC,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEvent, IEventProvider, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { ChildLogger, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { ISummarizerClientElection } from \"./summarizerClientElection\";\nimport { IThrottler } from \"./throttler\";\nimport {\n ISummarizer,\n SummarizerStopReason,\n} from \"./summarizerTypes\";\nimport { SummaryCollection } from \"./summaryCollection\";\nimport { Summarizer } from \"./summarizer\";\n\nconst defaultInitialDelayMs = 5000;\nconst defaultOpsToBypassInitialDelay = 4000;\n\nexport enum SummaryManagerState {\n Off = 0,\n Starting = 1,\n Running = 2,\n Stopping = 3,\n}\n\n// Please note that all reasons in this list are not errors,\n// and thus they are not raised today to parent container as error.\n// If this needs to be changed in future, we should re-evaluate what and how we raise to summarizer\ntype StopReason = Extract<SummarizerStopReason,\n \"parentNotConnected\" | \"notElectedParent\" | \"notElectedClient\">;\ntype ShouldSummarizeState =\n | { shouldSummarize: true; }\n | { shouldSummarize: false; stopReason: StopReason; };\n\nexport interface IConnectedEvents extends IEvent {\n (event: \"connected\", listener: (clientId: string) => void);\n (event: \"disconnected\", listener: () => void);\n}\n\n/**\n * IConnectedState describes an object that SummaryManager can watch to observe connection/disconnection.\n *\n * Under current implementation, its role will be fulfilled by the ContainerRuntime, but this could be replaced\n * with anything else that fulfills the contract if we want to shift the layer that the SummaryManager lives at.\n */\nexport interface IConnectedState extends IEventProvider<IConnectedEvents> {\n readonly connected: boolean;\n\n /**\n * Under current implementation this is undefined if we've never connected, otherwise it's the clientId from our\n * latest connection (even if we've since disconnected!). Although this happens to be the behavior we want in\n * SummaryManager, I suspect that globally we may eventually want to modify this behavior (e.g. make clientId\n * undefined while disconnected). To protect against this, let's assume this field can't be trusted while\n * disconnected and instead separately track \"latest clientId\" in SummaryManager.\n */\n readonly clientId: string | undefined;\n}\n\nexport interface ISummaryManagerConfig {\n initialDelayMs: number;\n opsToBypassInitialDelay: number;\n}\n\n/**\n * SummaryManager is created by parent container (i.e. interactive container with clientType !== \"summarizer\") only.\n * It observes changes in calculated summarizer and reacts to changes by either creating summarizer client or\n * stopping existing summarizer client.\n */\nexport class SummaryManager implements IDisposable {\n private readonly logger: ITelemetryLogger;\n private readonly opsToBypassInitialDelay: number;\n private readonly initialDelayMs: number;\n private latestClientId: string | undefined;\n private state = SummaryManagerState.Off;\n private summarizer?: ISummarizer;\n private _disposed = false;\n\n public get disposed() {\n return this._disposed;\n }\n\n public get currentState() { return this.state; }\n\n constructor(\n private readonly clientElection: ISummarizerClientElection,\n private readonly connectedState: IConnectedState,\n private readonly summaryCollection:\n Pick<SummaryCollection, \"opsSinceLastAck\" | \"addOpListener\" | \"removeOpListener\">,\n parentLogger: ITelemetryLogger,\n /** Creates summarizer by asking interactive container to spawn summarizing container and\n * get back its Summarizer instance. */\n private readonly requestSummarizerFn: () => Promise<ISummarizer>,\n private readonly startThrottler: IThrottler,\n {\n initialDelayMs = defaultInitialDelayMs,\n opsToBypassInitialDelay = defaultOpsToBypassInitialDelay,\n }: Readonly<Partial<ISummaryManagerConfig>> = {},\n private readonly disableHeuristics?: boolean,\n ) {\n this.logger = ChildLogger.create(\n parentLogger,\n \"SummaryManager\",\n { all: { clientId: () => this.latestClientId } });\n\n this.connectedState.on(\"connected\", this.handleConnected);\n this.connectedState.on(\"disconnected\", this.handleDisconnected);\n this.latestClientId = this.connectedState.clientId;\n\n this.opsToBypassInitialDelay = opsToBypassInitialDelay;\n this.initialDelayMs = initialDelayMs;\n }\n\n /**\n * Until start is called, the SummaryManager won't begin attempting to start summarization. This ensures there's\n * a window between construction and starting where the caller can attach listeners.\n */\n public start(): void {\n this.clientElection.on(\"electedSummarizerChanged\", this.refreshSummarizer);\n this.refreshSummarizer();\n }\n\n private readonly handleConnected = (clientId: string) => {\n this.latestClientId = clientId;\n // If we have a summarizer, it should have been either cancelled on disconnected by now.\n // But because of lastSummary process, it can still hang around, so there is not much we can\n // check or assert.\n this.refreshSummarizer();\n };\n\n private readonly handleDisconnected = () => {\n this.refreshSummarizer();\n };\n\n private static readonly isStartingOrRunning = (state: SummaryManagerState) =>\n state === SummaryManagerState.Starting || state === SummaryManagerState.Running;\n\n private getShouldSummarizeState(): ShouldSummarizeState {\n // Note that if we're in the Running state, the electedClient may be a summarizer client, so we can't\n // enforce connectedState.clientId === clientElection.electedClientId. But once we're Running, we should\n // only transition to Stopping when the electedParentId changes. Stopping the summarizer without\n // changing the electedParent will just cause us to transition to Starting again.\n\n // New Parent has been elected and it is not the current client, or\n if (this.connectedState.clientId !== this.clientElection.electedParentId) {\n return { shouldSummarize: false, stopReason: \"notElectedParent\" };\n }\n\n // We are not already running the summarizer and we are not the current elected client id.\n if (this.state !== SummaryManagerState.Running &&\n this.connectedState.clientId !== this.clientElection.electedClientId) {\n return { shouldSummarize: false, stopReason: \"notElectedClient\" };\n }\n\n if (!this.connectedState.connected) {\n return { shouldSummarize: false, stopReason: \"parentNotConnected\" };\n }\n\n if (this.disposed) {\n assert(false, 0x260 /* \"Disposed should mean disconnected!\" */);\n } else {\n return { shouldSummarize: true };\n }\n }\n\n private readonly refreshSummarizer = () => {\n // Transition states depending on shouldSummarize, which is a calculated property\n // that is only true if this client is connected and is the elected summarizer.\n const shouldSummarizeState = this.getShouldSummarizeState();\n switch (this.state) {\n case SummaryManagerState.Off: {\n if (shouldSummarizeState.shouldSummarize) {\n this.startSummarization();\n }\n return;\n }\n case SummaryManagerState.Starting: {\n // Cannot take any action until summarizer is created\n // state transition will occur after creation\n return;\n }\n case SummaryManagerState.Running: {\n if (shouldSummarizeState.shouldSummarize === false) {\n this.stop(shouldSummarizeState.stopReason);\n }\n return;\n }\n case SummaryManagerState.Stopping: {\n // Cannot take any action until running summarizer finishes\n // state transition will occur after it stops\n return;\n }\n default: {\n return;\n }\n }\n };\n\n private startSummarization() {\n assert(this.state === SummaryManagerState.Off, 0x261 /* \"Expected: off\" */);\n this.state = SummaryManagerState.Starting;\n\n assert(this.summarizer === undefined, 0x262 /* \"Old summarizer is still working!\" */);\n\n this.delayBeforeCreatingSummarizer().then(async (startWithInitialDelay: boolean) => {\n // Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore\n // but only if creation was delayed. If it was not, then we want to ensure we always create\n // a summarizer to kick off lastSummary. Without that, we would not be able to summarize and get\n // document out of broken state if it has too many ops and ordering service keeps nacking main\n // container (and thus it goes into cycle of reconnects)\n // If we can't run the LastSummary, simply return as to avoid paying the cost of launching\n // the summarizer at all.\n const shouldSummarizeStateEarlyStage = this.getShouldSummarizeState();\n if (startWithInitialDelay &&\n shouldSummarizeStateEarlyStage.shouldSummarize === false) {\n return `early exit ${shouldSummarizeStateEarlyStage.stopReason}`;\n }\n\n // We transition to Running before requesting the summarizer, because after requesting we can't predict\n // when the electedClient will be replaced with the new summarizer client.\n // The alternative would be to let connectedState.clientId !== clientElection.electedClientId when\n // state === Starting || state === Running.\n assert(this.state === SummaryManagerState.Starting, 0x263 /* \"Expected: starting\" */);\n this.state = SummaryManagerState.Running;\n\n const summarizer = await this.requestSummarizerFn();\n this.summarizer = summarizer;\n\n // Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore\n // If we can't run the LastSummary, simply return as to avoid paying the cost of launching\n // the summarizer at all.\n const shouldSummarizeState = this.getShouldSummarizeState();\n if (shouldSummarizeState.shouldSummarize === false) {\n // In order to allow the last summary to run, we not only need a stop reason that would\n // allow it but also, startWithInitialDelay to be false (start the summarization immediately),\n // which would happen when we have a high enough number of unsummarized ops.\n if (startWithInitialDelay || !Summarizer.stopReasonCanRunLastSummary(shouldSummarizeState.stopReason)) {\n this.state = SummaryManagerState.Starting;\n summarizer.stop(shouldSummarizeState.stopReason);\n return `early exit after starting summarizer ${shouldSummarizeState.stopReason}`;\n }\n this.logger.sendTelemetryEvent({\n eventName: \"LastAttemptToSummarize\",\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const clientId = this.latestClientId!;\n\n return PerformanceEvent.timedExecAsync(\n this.logger,\n { eventName: \"RunningSummarizer\", attempt: this.startThrottler.numAttempts },\n async () => summarizer.run(clientId, this.disableHeuristics),\n );\n }).then((reason: string) => {\n this.logger.sendTelemetryEvent({\n eventName: \"EndingSummarizer\",\n reason,\n });\n }).catch((error) => {\n this.logger.sendTelemetryEvent(\n {\n eventName: \"EndingSummarizer\",\n reason: \"exception\",\n },\n error);\n\n // Most of exceptions happen due to container being closed while loading it, due to\n // summarizer container loosing connection while load.\n // Not worth reporting such errors as errors. That said, we might miss some real errors if\n // we ignore blindly, so try to narrow signature we are looking for - skip logging\n // error only if this client should no longer be a summarizer (which in practice\n // means it also lost connection), and error happened on load (we do not have summarizer).\n // We could annotate the error raised in Container.load where the container closed during load with no error\n // and check for that case here, but that does not seem to be necessary.\n if (this.getShouldSummarizeState().shouldSummarize || this.summarizer !== undefined) {\n // Report any failure as an error unless it was due to cancellation (like \"disconnected\" error)\n // If failure happened on container load, we may not yet realized that socket disconnected, so check\n // offlineError.\n const category = error?.errorType === DriverErrorType.offlineError ? \"generic\" : \"error\";\n this.logger.sendTelemetryEvent(\n {\n eventName: \"SummarizerException\",\n category,\n },\n error);\n }\n }).finally(() => {\n assert(this.state !== SummaryManagerState.Off, 0x264 /* \"Expected: Not Off\" */);\n this.state = SummaryManagerState.Off;\n\n this.summarizer?.close();\n this.summarizer = undefined;\n\n if (this.getShouldSummarizeState().shouldSummarize) {\n this.startSummarization();\n }\n });\n }\n\n private stop(reason: SummarizerStopReason) {\n if (!SummaryManager.isStartingOrRunning(this.state)) {\n return;\n }\n this.state = SummaryManagerState.Stopping;\n\n // Stopping the running summarizer client should trigger a change\n // in states when the running summarizer closes\n this.summarizer?.stop(reason);\n }\n\n /**\n * Implements initial delay before creating summarizer\n * @returns `true`, if creation is delayed due to heuristics (not many ops to summarize).\n * `false` if summarizer should start immediately due to too many unsummarized ops.\n */\n private async delayBeforeCreatingSummarizer(): Promise<boolean> {\n // throttle creation of new summarizer containers to prevent spamming the server with websocket connections\n let delayMs = this.startThrottler.getDelay();\n\n // We have been elected the summarizer. Some day we may be able to summarize with a live document but for\n // now we play it safe and launch a second copy.\n this.logger.sendTelemetryEvent({\n eventName: \"CreatingSummarizer\",\n throttlerDelay: delayMs,\n initialDelay: this.initialDelayMs,\n startThrottlerMaxDelayMs: this.startThrottler.maxDelayMs,\n opsSinceLastAck: this.summaryCollection.opsSinceLastAck,\n opsToBypassInitialDelay: this.opsToBypassInitialDelay,\n });\n\n // This delay helps ensure that last summarizer that might be left from previous client\n // has enough time to complete its last summary and thus new summarizer not conflict with previous one.\n // If, however, there are too many unsummarized ops, try to resolve it as quickly as possible, with\n // understanding that we may see nacks because of such quick action.\n // A better design would be for summarizer election logic to always select current summarizer as\n // summarizing client (i.e. clientType === \"summarizer\" can be elected) to ensure that nobody else can\n // summarizer while it finishes its work and moves to exit.\n // It also helps with pure boot scenario (single client) to offset expensive work a bit out from\n // critical boot sequence.\n let startWithInitialDelay = false;\n if (this.summaryCollection.opsSinceLastAck < this.opsToBypassInitialDelay) {\n startWithInitialDelay = true;\n delayMs = Math.max(delayMs, this.initialDelayMs);\n }\n\n if (delayMs > 0) {\n let timer;\n let resolveOpPromiseFn;\n // Create a listener that will break the delay if we've exceeded the initial delay ops count.\n const opsListenerFn = () => {\n if (this.summaryCollection.opsSinceLastAck >= this.opsToBypassInitialDelay) {\n clearTimeout(timer);\n resolveOpPromiseFn();\n }\n };\n // Create a Promise that will resolve when the delay expires.\n const delayPromise = new Promise<void>((resolve) => {\n timer = setTimeout(() => resolve(), delayMs);\n });\n // Create a Promise that will resolve if the ops count passes the threshold.\n const opPromise = new Promise<void>((resolve) => { resolveOpPromiseFn = resolve; });\n this.summaryCollection.addOpListener(opsListenerFn);\n await Promise.race([delayPromise, opPromise]);\n this.summaryCollection.removeOpListener(opsListenerFn);\n }\n return startWithInitialDelay;\n }\n\n public readonly summarizeOnDemand: ISummarizer[\"summarizeOnDemand\"] = (...args) => {\n if (this.summarizer === undefined) {\n throw Error(\"No running summarizer client\");\n // TODO: could spawn a summarizer client temporarily.\n }\n return this.summarizer.summarizeOnDemand(...args);\n };\n\n public readonly enqueueSummarize: ISummarizer[\"enqueueSummarize\"] = (...args) => {\n if (this.summarizer === undefined) {\n throw Error(\"No running summarizer client\");\n // TODO: could spawn a summarizer client temporarily.\n }\n return this.summarizer.enqueueSummarize(...args);\n };\n\n public dispose() {\n this.clientElection.off(\"electedSummarizerChanged\", this.refreshSummarizer);\n this.connectedState.off(\"connected\", this.handleConnected);\n this.connectedState.off(\"disconnected\", this.handleDisconnected);\n this._disposed = true;\n }\n}\n"]}
|
package/lib/batchManager.d.ts
CHANGED
|
@@ -16,14 +16,13 @@ export declare type BatchMessage = IBatchMessage & {
|
|
|
16
16
|
* Helper class that manages partial batch & rollback.
|
|
17
17
|
*/
|
|
18
18
|
export declare class BatchManager {
|
|
19
|
+
private readonly hardLimit;
|
|
19
20
|
readonly softLimit?: number | undefined;
|
|
20
21
|
private pendingBatch;
|
|
21
22
|
private batchContentSize;
|
|
22
|
-
private static readonly hardLimit;
|
|
23
23
|
get length(): number;
|
|
24
24
|
get limit(): number;
|
|
25
|
-
|
|
26
|
-
constructor(softLimit?: number | undefined);
|
|
25
|
+
constructor(hardLimit: number, softLimit?: number | undefined);
|
|
27
26
|
push(message: BatchMessage): boolean;
|
|
28
27
|
get empty(): boolean;
|
|
29
28
|
popBatch(): BatchMessage[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batchManager.d.ts","sourceRoot":"","sources":["../src/batchManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AACH,oBAAY,YAAY,GAAG,aAAa,GAAG;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,uBAAuB,CAAC;IAC7C,uBAAuB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"batchManager.d.ts","sourceRoot":"","sources":["../src/batchManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AACH,oBAAY,YAAY,GAAG,aAAa,GAAG;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,uBAAuB,CAAC;IAC7C,uBAAuB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;IAQjB,OAAO,CAAC,QAAQ,CAAC,SAAS;aACV,SAAS,CAAC;IAR9B,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,gBAAgB,CAAK;IAE7B,IAAW,MAAM,WAAuC;IACxD,IAAW,KAAK,WAA6B;gBAGxB,SAAS,EAAE,MAAM,EAClB,SAAS,CAAC,oBAAQ;IAG/B,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO;IA2B3C,IAAW,KAAK,YAA6C;IAEtD,QAAQ;IAOf;;OAEG;IACI,UAAU;sCAGqB,YAAY,KAAK,IAAI;;CAY9D"}
|
package/lib/batchManager.js
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* Helper class that manages partial batch & rollback.
|
|
7
7
|
*/
|
|
8
8
|
export class BatchManager {
|
|
9
|
-
constructor(softLimit) {
|
|
9
|
+
constructor(hardLimit, softLimit) {
|
|
10
|
+
this.hardLimit = hardLimit;
|
|
10
11
|
this.softLimit = softLimit;
|
|
11
12
|
this.pendingBatch = [];
|
|
12
13
|
this.batchContentSize = 0;
|
|
13
14
|
}
|
|
14
15
|
get length() { return this.pendingBatch.length; }
|
|
15
|
-
get limit() { return
|
|
16
|
-
static get limit() { return BatchManager.hardLimit; }
|
|
16
|
+
get limit() { return this.hardLimit; }
|
|
17
17
|
push(message) {
|
|
18
18
|
const contentSize = this.batchContentSize + message.contents.length;
|
|
19
19
|
const opCount = this.pendingBatch.length;
|
|
@@ -61,9 +61,4 @@ export class BatchManager {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
// The actual limit is 1Mb (socket.io and Kafka limits)
|
|
65
|
-
// We can't estimate it fully, as we
|
|
66
|
-
// - do not know what properties relay service will add
|
|
67
|
-
// - we do not stringify final op, thus we do not know how much escaping will be added.
|
|
68
|
-
BatchManager.hardLimit = 950 * 1024;
|
|
69
64
|
//# sourceMappingURL=batchManager.js.map
|
package/lib/batchManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batchManager.js","sourceRoot":"","sources":["../src/batchManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;GAEG;AACH,MAAM,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"batchManager.js","sourceRoot":"","sources":["../src/batchManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;GAEG;AACH,MAAM,OAAO,YAAY;IAOrB,YACqB,SAAiB,EAClB,SAAkB;QADjB,cAAS,GAAT,SAAS,CAAQ;QAClB,cAAS,GAAT,SAAS,CAAS;QAR9B,iBAAY,GAAmB,EAAE,CAAC;QAClC,qBAAgB,GAAG,CAAC,CAAC;IAQzB,CAAC;IANL,IAAW,MAAM,KAAK,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAOtC,IAAI,CAAC,OAAqB;QAC7B,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QACpE,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QAEzC,2DAA2D;QAC3D,iEAAiE;QACjE,sGAAsG;QACtG,iGAAiG;QACjG,gFAAgF;QAChF,MAAM,iBAAiB,GAAG,WAAW,GAAG,GAAG,GAAG,OAAO,CAAC;QAEtD,0DAA0D;QAC1D,wGAAwG;QACxG,0DAA0D;QAC1D,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,iBAAiB,IAAI,IAAI,CAAC,SAAS,EAAE;YACxF,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,iBAAiB,IAAI,IAAI,CAAC,KAAK,EAAE;YACjC,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC;QACpC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;IAEtD,QAAQ;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;OAEG;IACI,UAAU;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QAC5C,OAAO;YACH,QAAQ,EAAE,CAAC,OAAwC,EAAE,EAAE;gBACnD,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,UAAU,GAAG;oBACpD,CAAC,EAAE,CAAC;oBACJ,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACrC,IAAI,CAAC,gBAAgB,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACjD,OAAO,CAAC,OAAO,CAAC,CAAC;iBACpB;gBAED,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC;YAC1C,CAAC;SACJ,CAAC;IACN,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IBatchMessage } from \"@fluidframework/container-definitions\";\nimport { ContainerRuntimeMessage } from \"./containerRuntime\";\n\n/**\n * Message type used by BatchManager\n */\nexport type BatchMessage = IBatchMessage & {\n localOpMetadata: unknown;\n deserializedContent: ContainerRuntimeMessage;\n referenceSequenceNumber: number;\n};\n\n/**\n * Helper class that manages partial batch & rollback.\n */\nexport class BatchManager {\n private pendingBatch: BatchMessage[] = [];\n private batchContentSize = 0;\n\n public get length() { return this.pendingBatch.length; }\n public get limit() { return this.hardLimit; }\n\n constructor(\n private readonly hardLimit: number,\n public readonly softLimit?: number,\n ) { }\n\n public push(message: BatchMessage): boolean {\n const contentSize = this.batchContentSize + message.contents.length;\n const opCount = this.pendingBatch.length;\n\n // Attempt to estimate batch size, aka socket message size.\n // Each op has pretty large envelope, estimating to be 200 bytes.\n // Also content will be strigified, and that adds a lot of overhead due to a lot of escape characters.\n // Not taking it into account, as compression work should help there - compressed payload will be\n // initially stored as base64, and that requires only 2 extra escape characters.\n const socketMessageSize = contentSize + 200 * opCount;\n\n // If we were provided soft limit, check for exceeding it.\n // But only if we have any ops, as the intention here is to flush existing ops (on exceeding this limit)\n // and start over. That's not an option if we have no ops.\n if (this.softLimit !== undefined && this.length > 0 && socketMessageSize >= this.softLimit) {\n return false;\n }\n\n if (socketMessageSize >= this.limit) {\n return false;\n }\n\n this.batchContentSize = contentSize;\n this.pendingBatch.push(message);\n return true;\n }\n\n public get empty() { return this.pendingBatch.length === 0; }\n\n public popBatch() {\n const batch = this.pendingBatch;\n this.pendingBatch = [];\n this.batchContentSize = 0;\n return batch;\n }\n\n /**\n * Capture the pending state at this point\n */\n public checkpoint() {\n const startPoint = this.pendingBatch.length;\n return {\n rollback: (process: (message: BatchMessage) => void) => {\n for (let i = this.pendingBatch.length; i > startPoint;) {\n i--;\n const message = this.pendingBatch[i];\n this.batchContentSize -= message.contents.length;\n process(message);\n }\n\n this.pendingBatch.length = startPoint;\n },\n };\n }\n}\n"]}
|
|
@@ -11,7 +11,7 @@ import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
|
11
11
|
import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISignalMessage, ISummaryTree, MessageType } from "@fluidframework/protocol-definitions";
|
|
12
12
|
import { FlushMode, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IGarbageCollectionData, NamedFluidDataStoreRegistryEntries, ISummaryTreeWithStats, IDataStore, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
13
13
|
import { BatchMessage } from "./batchManager";
|
|
14
|
-
import { SubmitSummaryResult, ISubmitSummaryOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerOptions, ISummarizerRuntime } from "./summarizerTypes";
|
|
14
|
+
import { SubmitSummaryResult, ISubmitSummaryOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerOptions, ISummarizerRuntime, IRefreshSummaryAckOptions } from "./summarizerTypes";
|
|
15
15
|
import { GCNodeType, IGarbageCollectionRuntime, IGCStats } from "./garbageCollection";
|
|
16
16
|
export declare enum ContainerMessageType {
|
|
17
17
|
FluidDataStoreOp = "component",
|
|
@@ -55,11 +55,6 @@ export interface ISummaryBaseConfiguration {
|
|
|
55
55
|
}
|
|
56
56
|
export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
|
|
57
57
|
state: "enabled";
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated Please move all implementations to {@link ISummaryConfigurationHeuristics.minIdleTime} and
|
|
60
|
-
* {@link ISummaryConfigurationHeuristics.maxIdleTime} instead.
|
|
61
|
-
*/
|
|
62
|
-
idleTime?: number;
|
|
63
58
|
/**
|
|
64
59
|
* Defines the maximum allowed time, since the last received Ack, before running the summary
|
|
65
60
|
* with reason maxTime.
|
|
@@ -197,6 +192,17 @@ export interface ISummaryRuntimeOptions {
|
|
|
197
192
|
* */
|
|
198
193
|
summarizerOptions?: Readonly<Partial<ISummarizerOptions>>;
|
|
199
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Options for op compression.
|
|
197
|
+
* @experimental - Not ready for use
|
|
198
|
+
*/
|
|
199
|
+
export interface ICompressionRuntimeOptions {
|
|
200
|
+
/**
|
|
201
|
+
* The minimum size the content payload must exceed before it is compressed.
|
|
202
|
+
* Compression is disabled if undefined.
|
|
203
|
+
*/
|
|
204
|
+
readonly minimumSize?: number;
|
|
205
|
+
}
|
|
200
206
|
/**
|
|
201
207
|
* Options for container runtime.
|
|
202
208
|
*/
|
|
@@ -223,6 +229,22 @@ export interface IContainerRuntimeOptions {
|
|
|
223
229
|
* Save enough runtime state to be able to serialize upon request and load to the same state in a new container.
|
|
224
230
|
*/
|
|
225
231
|
readonly enableOfflineLoad?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Enables the runtime to compress ops.
|
|
234
|
+
* @experimental Not ready for use.
|
|
235
|
+
*/
|
|
236
|
+
readonly compressionOptions?: ICompressionRuntimeOptions;
|
|
237
|
+
/**
|
|
238
|
+
* If specified, when in FlushMode.TurnBased, if the size of the ops between JS turns exceeds this value,
|
|
239
|
+
* an error will be thrown and the container will close.
|
|
240
|
+
*
|
|
241
|
+
* If unspecified, the limit is 950 * 1024.
|
|
242
|
+
*
|
|
243
|
+
* 'Infinity' will disable any limit.
|
|
244
|
+
*
|
|
245
|
+
* @experimental This config should be driven by the connection with the service and will be moved in the future.
|
|
246
|
+
*/
|
|
247
|
+
readonly maxBatchSizeInBytes?: number;
|
|
226
248
|
}
|
|
227
249
|
/**
|
|
228
250
|
* The summary tree returned by the root node. It adds state relevant to the root of the tree.
|
|
@@ -264,7 +286,7 @@ export declare function isRuntimeMessage(message: ISequencedDocumentMessage): bo
|
|
|
264
286
|
/**
|
|
265
287
|
* Unpacks runtime messages
|
|
266
288
|
*
|
|
267
|
-
* @remarks This API makes no promises regarding backward-
|
|
289
|
+
* @remarks This API makes no promises regarding backward-compatibility. This is internal API.
|
|
268
290
|
* @param message - message (as it observed in storage / service)
|
|
269
291
|
* @returns unpacked runtime message
|
|
270
292
|
*
|
|
@@ -334,12 +356,13 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
334
356
|
private readonly maxConsecutiveReconnects;
|
|
335
357
|
private readonly defaultMaxConsecutiveReconnects;
|
|
336
358
|
private _orderSequentiallyCalls;
|
|
337
|
-
private _flushMode;
|
|
338
|
-
private
|
|
359
|
+
private readonly _flushMode;
|
|
360
|
+
private flushMicroTaskExists;
|
|
339
361
|
private _connected;
|
|
340
362
|
private readonly savedOps;
|
|
341
363
|
private baseSnapshotBlobs?;
|
|
342
364
|
private consecutiveReconnects;
|
|
365
|
+
private compressedOpCount;
|
|
343
366
|
/**
|
|
344
367
|
* Used to delay transition to "connected" state while we upload
|
|
345
368
|
* attachment blobs that were added while disconnected
|
|
@@ -423,17 +446,23 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
423
446
|
processSignal(message: ISignalMessage, local: boolean): void;
|
|
424
447
|
getRootDataStore(id: string, wait?: boolean): Promise<IFluidRouter>;
|
|
425
448
|
private getRootDataStoreChannel;
|
|
426
|
-
|
|
427
|
-
|
|
449
|
+
/**
|
|
450
|
+
* Flush the pending ops manually.
|
|
451
|
+
* This method is expected to be called at the end of a batch.
|
|
452
|
+
*/
|
|
453
|
+
private flush;
|
|
428
454
|
protected flushBatch(batch: BatchMessage[]): void;
|
|
429
455
|
orderSequentially(callback: () => void): void;
|
|
430
|
-
private trackOrderSequentiallyCalls;
|
|
431
456
|
createDataStore(pkg: string | string[]): Promise<IDataStore>;
|
|
432
457
|
createDetachedRootDataStore(pkg: Readonly<string[]>, rootDataStoreId: string): IFluidDataStoreContextDetached;
|
|
433
458
|
createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;
|
|
434
459
|
_createDataStoreWithProps(pkg: string | string[], props?: any, id?: string): Promise<IDataStore>;
|
|
435
460
|
private _createDataStore;
|
|
436
461
|
private canSendOps;
|
|
462
|
+
/**
|
|
463
|
+
* Are we in the middle of batching ops together?
|
|
464
|
+
*/
|
|
465
|
+
private currentlyBatching;
|
|
437
466
|
getQuorum(): IQuorumClients;
|
|
438
467
|
getAudience(): IAudience;
|
|
439
468
|
/**
|
|
@@ -496,10 +525,8 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
496
525
|
* Implementation of IGarbageCollectionRuntime::updateUsedRoutes.
|
|
497
526
|
* After GC has run, called to notify this container's nodes of routes that are used in it.
|
|
498
527
|
* @param usedRoutes - The routes that are used in all nodes in this Container.
|
|
499
|
-
* @param gcTimestamp - The time when GC was run that generated these used routes. If any node node becomes
|
|
500
|
-
* unreferenced as part of this GC run, this should be used to update the time when it happens.
|
|
501
528
|
*/
|
|
502
|
-
updateUsedRoutes(usedRoutes: string[]
|
|
529
|
+
updateUsedRoutes(usedRoutes: string[]): void;
|
|
503
530
|
/**
|
|
504
531
|
* When running GC in test mode, this is called to delete objects whose routes are unused. This enables testing
|
|
505
532
|
* scenarios with accessing deleted content.
|
|
@@ -576,7 +603,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
576
603
|
private reSubmit;
|
|
577
604
|
private rollback;
|
|
578
605
|
/** Implementation of ISummarizerInternalsProvider.refreshLatestSummaryAck */
|
|
579
|
-
refreshLatestSummaryAck(
|
|
606
|
+
refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
|
|
580
607
|
/**
|
|
581
608
|
* Fetches the latest snapshot from storage and uses it to refresh SummarizerNode's
|
|
582
609
|
* internal state as it should be considered the latest summary ack.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAgD,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EAEb,QAAQ,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