@fluidframework/container-runtime 2.0.0-internal.2.2.1 → 2.0.0-internal.2.3.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/.eslintrc.js +19 -8
- package/dist/batchTracker.d.ts +1 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +45 -34
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +135 -102
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +54 -8
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +143 -72
- 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 +6 -8
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +12 -9
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +41 -35
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +41 -20
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +205 -150
- package/dist/garbageCollection.js.map +1 -1
- package/dist/garbageCollectionConstants.d.ts +7 -3
- package/dist/garbageCollectionConstants.d.ts.map +1 -1
- package/dist/garbageCollectionConstants.js +10 -8
- package/dist/garbageCollectionConstants.js.map +1 -1
- package/dist/garbageCollectionTombstoneUtils.d.ts +14 -0
- package/dist/garbageCollectionTombstoneUtils.d.ts.map +1 -0
- package/dist/garbageCollectionTombstoneUtils.js +23 -0
- package/dist/garbageCollectionTombstoneUtils.js.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +13 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +35 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +25 -1
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +2 -2
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +2 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +24 -10
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +2 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +30 -17
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +34 -2
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +114 -5
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +5 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +24 -14
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +17 -2
- package/dist/opLifecycle/remoteMessageProcessor.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/runningSummarizer.d.ts.map +1 -1
- package/dist/runningSummarizer.js +0 -1
- package/dist/runningSummarizer.js.map +1 -1
- package/dist/scheduleManager.d.ts +0 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +9 -20
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summarizer.d.ts +0 -1
- package/dist/summarizer.d.ts.map +1 -1
- package/dist/summarizer.js +2 -1
- package/dist/summarizer.js.map +1 -1
- package/dist/summarizerTypes.d.ts +1 -0
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryFormat.d.ts.map +1 -1
- package/dist/summaryFormat.js +1 -2
- package/dist/summaryFormat.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +45 -34
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +137 -104
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +54 -8
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +140 -69
- 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 +7 -9
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +12 -9
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +44 -38
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +41 -20
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +201 -146
- package/lib/garbageCollection.js.map +1 -1
- package/lib/garbageCollectionConstants.d.ts +7 -3
- package/lib/garbageCollectionConstants.d.ts.map +1 -1
- package/lib/garbageCollectionConstants.js +9 -7
- package/lib/garbageCollectionConstants.js.map +1 -1
- package/lib/garbageCollectionTombstoneUtils.d.ts +14 -0
- package/lib/garbageCollectionTombstoneUtils.d.ts.map +1 -0
- package/lib/garbageCollectionTombstoneUtils.js +19 -0
- package/lib/garbageCollectionTombstoneUtils.js.map +1 -0
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +13 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +35 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +25 -1
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +2 -2
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +1 -1
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +24 -10
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +2 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +30 -17
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +34 -2
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +112 -4
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +5 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +24 -14
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +17 -2
- package/lib/opLifecycle/remoteMessageProcessor.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/runningSummarizer.d.ts.map +1 -1
- package/lib/runningSummarizer.js +0 -1
- package/lib/runningSummarizer.js.map +1 -1
- package/lib/scheduleManager.d.ts +0 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +9 -20
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summarizer.d.ts +0 -1
- package/lib/summarizer.d.ts.map +1 -1
- package/lib/summarizer.js +2 -1
- package/lib/summarizer.js.map +1 -1
- package/lib/summarizerTypes.d.ts +1 -0
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryFormat.d.ts.map +1 -1
- package/lib/summaryFormat.js +1 -2
- package/lib/summaryFormat.js.map +1 -1
- package/package.json +20 -19
- package/src/batchTracker.ts +1 -1
- package/src/blobManager.ts +159 -111
- package/src/containerRuntime.ts +202 -73
- package/src/dataStoreContext.ts +15 -16
- package/src/dataStores.ts +61 -45
- package/src/garbageCollection.ts +258 -183
- package/src/garbageCollectionConstants.ts +10 -7
- package/src/garbageCollectionTombstoneUtils.ts +28 -0
- package/src/index.ts +2 -5
- package/src/opLifecycle/batchManager.ts +59 -1
- package/src/opLifecycle/definitions.ts +27 -1
- package/src/opLifecycle/index.ts +2 -1
- package/src/opLifecycle/opCompressor.ts +29 -12
- package/src/opLifecycle/opDecompressor.ts +39 -18
- package/src/opLifecycle/opSplitter.ts +141 -7
- package/src/opLifecycle/outbox.ts +32 -16
- package/src/opLifecycle/remoteMessageProcessor.ts +19 -3
- package/src/packageVersion.ts +1 -1
- package/src/runningSummarizer.ts +0 -1
- package/src/scheduleManager.ts +19 -30
- package/src/summarizer.ts +1 -1
- package/src/summarizerTypes.ts +1 -0
- package/src/summaryFormat.ts +1 -2
package/lib/summarizer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizer.js","sourceRoot":"","sources":["../src/summarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAW,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC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;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { Deferred } from \"@fluidframework/common-utils\";\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ILoader, LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { UsageError } from \"@fluidframework/container-utils\";\nimport { DriverErrorType, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { requestFluidObject } from \"@fluidframework/runtime-utils\";\nimport {\n ChildLogger,\n IFluidErrorBase,\n isFluidError,\n LoggingError,\n wrapErrorAndLog,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n FluidObject,\n IFluidHandleContext,\n IFluidHandle,\n IRequest,\n} from \"@fluidframework/core-interfaces\";\nimport { ISummaryConfiguration } from \"./containerRuntime\";\nimport { ICancellableSummarizerController } from \"./runWhileConnectedCoordinator\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\nimport { IAckedSummary, SummaryCollection } from \"./summaryCollection\";\nimport { SummarizerHandle } from \"./summarizerHandle\";\nimport { RunningSummarizer } from \"./runningSummarizer\";\nimport {\n ISummarizer,\n ISummarizerInternalsProvider,\n ISummarizerRuntime,\n ISummarizingWarning,\n SummarizerStopReason,\n} from \"./summarizerTypes\";\nimport { SummarizeHeuristicData } from \"./summarizerHeuristics\";\nimport { SummarizeResultBuilder } from \"./summaryGenerator\";\nimport { IConnectableRuntime } from \".\";\n\nconst summarizingError = \"summarizingError\";\n\nexport class SummarizingWarning extends LoggingError implements ISummarizingWarning, IFluidErrorBase {\n readonly errorType = summarizingError;\n readonly canRetry = true;\n\n constructor(\n errorMessage: string,\n readonly logged: boolean = false,\n ) {\n super(errorMessage);\n }\n\n static wrap(error: any, logged: boolean = false, logger: ITelemetryLogger) {\n const newErrorFn = (errMsg: string) => new SummarizingWarning(errMsg, logged);\n return wrapErrorAndLog<SummarizingWarning>(error, newErrorFn, logger);\n }\n}\n\nexport const createSummarizingWarning =\n (errorMessage: string, logged: boolean) => new SummarizingWarning(errorMessage, logged);\n\n/**\n * Summarizer is responsible for coordinating when to generate and send summaries.\n * It is the main entry point for summary work.\n * It is created only by summarizing container (i.e. one with clientType === \"summarizer\")\n */\nexport class Summarizer extends EventEmitter implements ISummarizer {\n public get IFluidLoadable() { return this; }\n public get ISummarizer() { return this; }\n\n private readonly logger: ITelemetryLogger;\n private runningSummarizer?: RunningSummarizer;\n private _disposed: boolean = false;\n private starting: boolean = false;\n\n private readonly innerHandle: IFluidHandle<this>;\n\n public get handle(): IFluidHandle<this> { return this.innerHandle; }\n private readonly stopDeferred = new Deferred<SummarizerStopReason>();\n\n constructor(\n url: string,\n /** Reference to runtime that created this object.\n * i.e. runtime with clientType === \"summarizer\"\n */\n private readonly runtime: ISummarizerRuntime,\n private readonly configurationGetter: () => ISummaryConfiguration,\n /** Represents an object that can generate summary.\n * In practical terms, it's same runtime (this.runtime) with clientType === \"summarizer\".\n */\n private readonly internalsProvider: ISummarizerInternalsProvider,\n handleContext: IFluidHandleContext,\n public readonly summaryCollection: SummaryCollection,\n private readonly runCoordinatorCreateFn:\n (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>,\n ) {\n super();\n this.logger = ChildLogger.create(this.runtime.logger, \"Summarizer\");\n this.innerHandle = new SummarizerHandle(this, url, handleContext);\n }\n\n /**\n * Creates a Summarizer and its underlying client.\n * Note that different implementations of ILoader will handle the URL differently.\n * ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's\n * starting with \"/\" as relative to the Container. The general ILoader\n * interface will expect an absolute URL and will not handle \"/\".\n * @param loader - the loader that resolves the request\n * @param url - the URL used to resolve the container\n */\n public static async create(\n loader: ILoader,\n url: string): Promise<ISummarizer> {\n const request: IRequest = {\n headers: {\n [LoaderHeader.cache]: false,\n [LoaderHeader.clientDetails]: {\n capabilities: { interactive: false },\n type: summarizerClientType,\n },\n [DriverHeader.summarizingClient]: true,\n [LoaderHeader.reconnect]: false,\n },\n url,\n };\n\n const resolvedContainer = await loader.resolve(request);\n const fluidObject =\n await requestFluidObject<FluidObject<ISummarizer>>(resolvedContainer, { url: \"_summarizer\" });\n if (fluidObject.ISummarizer === undefined) {\n throw new UsageError(\"Fluid object does not implement ISummarizer\");\n }\n return fluidObject.ISummarizer;\n }\n\n public async run(onBehalfOf: string): Promise<SummarizerStopReason> {\n try {\n return await this.runCore(onBehalfOf);\n } catch (error) {\n this.stop(\"summarizerException\");\n throw SummarizingWarning.wrap(error, false /* logged */, this.logger);\n } finally {\n this.close();\n }\n }\n\n /**\n * Stops the summarizer from running. This will complete\n * the run promise, and also close the container.\n * @param reason - reason code for stopping\n */\n public stop(reason: SummarizerStopReason) {\n this.stopDeferred.resolve(reason);\n }\n\n public close() {\n // This will result in \"summarizerClientDisconnected\" stop reason recorded in telemetry,\n // unless stop() was called earlier\n this.dispose();\n this.runtime.closeFn();\n }\n\n private async runCore(onBehalfOf: string): Promise<SummarizerStopReason> {\n const runCoordinator: ICancellableSummarizerController = await this.runCoordinatorCreateFn(this.runtime);\n\n // Wait for either external signal to cancel, or loss of connectivity.\n const stopP = Promise.race([runCoordinator.waitCancelled, this.stopDeferred.promise]);\n void stopP.then((reason) => {\n this.logger.sendTelemetryEvent({\n eventName: \"StoppingSummarizer\",\n onBehalfOf,\n reason,\n });\n });\n\n if (runCoordinator.cancelled) {\n return runCoordinator.waitCancelled;\n }\n\n const runningSummarizer = await this.start(onBehalfOf, runCoordinator);\n\n // Wait for either external signal to cancel, or loss of connectivity.\n const stopReason = await stopP;\n\n // There are two possible approaches here:\n // 1. Propagate cancellation from this.stopDeferred to runCoordinator. This will ensure that we move to the exit\n // faster, including breaking out of the RunningSummarizer.trySummarize() faster.\n // We could create new coordinator and pass it to waitStop() -> trySummarizeOnce(\"lastSummary\") flow.\n // The con of this approach is that we might cancel active summary, and lastSummary will fail because it\n // did not wait for ack/nack from previous summary. Plus we disregard any 429 kind of info from service\n // that way (i.e. trySummarize() loop might have been waiting for 5 min because storage told us so).\n // In general, it's more wasted resources.\n // 2. We can not do it and make waitStop() do last summary only if there was no active summary. This ensures\n // that client behaves properly (from server POV) and we do not waste resources. But, it may mean we wait\n // substantially longer for trySummarize() retries to play out and thus this summary loop may run into\n // conflict with new summarizer client starting on different client.\n // As of now, #2 is implemented. It's more forward looking, as issue #7279 suggests changing design for new\n // summarizer client to not be created until current summarizer fully moves to exit, and that would reduce\n // cons of #2 substantially.\n\n // Cleanup after running\n await runningSummarizer.waitStop(\n !runCoordinator.cancelled && Summarizer.stopReasonCanRunLastSummary(stopReason));\n\n // Propagate reason and ensure that if someone is waiting for cancellation token, they are moving to exit\n runCoordinator.stop(stopReason);\n\n return stopReason;\n }\n\n /**\n * Should we try to run a last summary for the given stop reason?\n * Currently only allows \"parentNotConnected\"\n * @param stopReason - SummarizerStopReason\n * @returns - true if the stop reason can run a last summary\n */\n public static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean {\n return stopReason === \"parentNotConnected\";\n }\n\n /**\n * Put the summarizer in a started state, including creating and initializing the RunningSummarizer.\n * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user\n * (in the on-demand case).\n * @param onBehalfOf - ID of the client that requested that the summarizer start\n * @param runCoordinator - cancellation token\n * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.\n * @returns - Promise that is fulfilled when the RunningSummarizer is ready\n */\n private async start(\n onBehalfOf: string,\n runCoordinator: ICancellableSummarizerController): Promise<RunningSummarizer> {\n if (this.runningSummarizer) {\n if (this.runningSummarizer.disposed) {\n throw new UsageError(\"Starting a disposed summarizer\");\n }\n return this.runningSummarizer;\n }\n if (this.starting) {\n throw new UsageError(\"Attempting to start a summarizer that is already starting\");\n }\n this.starting = true;\n // Initialize values and first ack (time is not exact)\n this.logger.sendTelemetryEvent({\n eventName: \"RunningSummarizer\",\n onBehalfOf,\n initSummarySeqNumber: this.runtime.deltaManager.initialSequenceNumber,\n config: JSON.stringify(this.configurationGetter()),\n });\n\n // Summarizing container ID (with clientType === \"summarizer\")\n const clientId = this.runtime.clientId;\n if (clientId === undefined) {\n throw new UsageError(\"clientId should be defined if connected.\");\n }\n\n const runningSummarizer = await RunningSummarizer.start(\n this.logger,\n this.summaryCollection.createWatcher(clientId),\n this.configurationGetter(),\n async (...args) => this.internalsProvider.submitSummary(...args), // submitSummaryCallback\n new SummarizeHeuristicData(\n this.runtime.deltaManager.lastSequenceNumber,\n { /** summary attempt baseline for heuristics */\n refSequenceNumber: this.runtime.deltaManager.initialSequenceNumber,\n summaryTime: Date.now(),\n } as const,\n ),\n (errorMessage: string) => {\n if (!this._disposed) {\n this.logger.sendErrorEvent({ eventName: \"summarizingError\" },\n createSummarizingWarning(errorMessage, true));\n }\n },\n this.summaryCollection,\n runCoordinator /* cancellationToken */,\n (reason) => runCoordinator.stop(reason), /* stopSummarizerCallback */\n this.runtime,\n );\n this.runningSummarizer = runningSummarizer;\n this.starting = false;\n\n // Handle summary acks\n // Note: no exceptions are thrown from handleSummaryAcks handler as it handles all exceptions\n this.handleSummaryAcks().catch((error) => {\n this.logger.sendErrorEvent({ eventName: \"HandleSummaryAckFatalError\" }, error);\n });\n\n return runningSummarizer;\n }\n\n /**\n * Disposes of resources after running. This cleanup will\n * clear any outstanding timers and reset some of the state\n * properties.\n * Called by ContainerRuntime when it is disposed, as well as at the end the run().\n */\n public dispose() {\n // Given that the call can come from own ContainerRuntime, ensure that we stop all the processes.\n this.stop(\"summarizerClientDisconnected\");\n\n this._disposed = true;\n if (this.runningSummarizer) {\n this.runningSummarizer.dispose();\n this.runningSummarizer = undefined;\n }\n }\n\n public readonly summarizeOnDemand: ISummarizer[\"summarizeOnDemand\"] = (...args) => {\n try {\n if (this._disposed || this.runningSummarizer?.disposed) {\n throw new UsageError(\"Summarizer is already disposed.\");\n }\n if (this.runtime.summarizerClientId !== undefined &&\n this.runtime.summarizerClientId !== this.runtime.clientId) {\n // If there is an elected summarizer, and it's not this one, don't allow on-demand summary.\n // This is to prevent the on-demand summary and heuristic-based summary from stepping on\n // each other.\n throw new UsageError(\"On-demand summary attempted while an elected summarizer is present\");\n }\n const builder = new SummarizeResultBuilder();\n if (this.runningSummarizer) {\n // Summarizer is already running. Go ahead and start.\n return this.runningSummarizer.summarizeOnDemand(builder, ...args);\n }\n\n // Summarizer isn't running, so we need to start it, which is an async operation.\n // Manage the promise related to creating the cancellation token here.\n // The promises related to starting, summarizing,\n // and submitting are communicated to the caller through the results builder.\n const coordinatorCreateP = this.runCoordinatorCreateFn(this.runtime);\n\n coordinatorCreateP.then((runCoordinator) => {\n // Successfully created the cancellation token. Start the summarizer.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const startP = this.start(this.runtime.clientId!, runCoordinator);\n startP.then(async (runningSummarizer) => {\n // Successfully started the summarizer. Run it.\n runningSummarizer.summarizeOnDemand(builder, ...args);\n // Wait for a command to stop or loss of connectivity before tearing down the summarizer and client.\n const stopReason = await Promise.race([this.stopDeferred.promise, runCoordinator.waitCancelled]);\n await runningSummarizer.waitStop(false);\n runCoordinator.stop(stopReason);\n this.close();\n }).catch((reason) => {\n builder.fail(\"Failed to start summarizer\", reason);\n });\n }).catch((reason) => {\n builder.fail(\"Failed to create cancellation token\", reason);\n });\n\n return builder.build();\n } catch (error) {\n throw SummarizingWarning.wrap(error, false /* logged */, this.logger);\n }\n };\n\n public readonly enqueueSummarize: ISummarizer[\"enqueueSummarize\"] = (...args) => {\n if (this._disposed || this.runningSummarizer === undefined || this.runningSummarizer.disposed) {\n throw new UsageError(\"Summarizer is not running or already disposed.\");\n }\n return this.runningSummarizer.enqueueSummarize(...args);\n };\n\n private async handleSummaryAcks() {\n let refSequenceNumber = this.runtime.deltaManager.initialSequenceNumber;\n let ack: IAckedSummary | undefined;\n while (this.runningSummarizer) {\n const summaryLogger = this.runningSummarizer.tryGetCorrelatedLogger(refSequenceNumber) ?? this.logger;\n try {\n // Initialize ack with undefined if exception happens inside of waitSummaryAck on second iteration,\n // we record undefined, not previous handles.\n ack = undefined;\n ack = await this.summaryCollection.waitSummaryAck(refSequenceNumber);\n refSequenceNumber = ack.summaryOp.referenceSequenceNumber;\n const summaryOpHandle = ack.summaryOp.contents.handle;\n const summaryAckHandle = ack.summaryAck.contents.handle;\n // Make sure we block any summarizer from being executed/enqueued while\n // executing the refreshLatestSummaryAck.\n // https://dev.azure.com/fluidframework/internal/_workitems/edit/779\n await this.runningSummarizer.lockedRefreshSummaryAckAction(async () =>\n this.internalsProvider.refreshLatestSummaryAck({\n proposalHandle: summaryOpHandle,\n ackHandle: summaryAckHandle,\n summaryRefSeq: refSequenceNumber,\n summaryLogger },\n ).catch(async (error) => {\n // If the error is 404, so maybe the fetched version no longer exists on server. We just\n // ignore this error in that case, as that means we will have another summaryAck for the\n // latest version with which we will refresh the state. However in case of single commit\n // summary, we might me missing a summary ack, so in that case we are still fine as the\n // code in `submitSummary` function in container runtime, will refresh the latest state\n // by calling `refreshLatestSummaryAckFromServer` and we will be fine.\n if (isFluidError(error)\n && error.errorType === DriverErrorType.fileNotFoundOrAccessDeniedError) {\n summaryLogger.sendTelemetryEvent({\n eventName: \"HandleSummaryAckErrorIgnored\",\n referenceSequenceNumber: refSequenceNumber,\n proposalHandle: summaryOpHandle,\n ackHandle: summaryAckHandle,\n }, error);\n } else {\n throw error;\n }\n }),\n );\n } catch (error) {\n summaryLogger.sendErrorEvent({\n eventName: \"HandleSummaryAckError\",\n referenceSequenceNumber: refSequenceNumber,\n handle: ack?.summaryOp?.contents?.handle,\n ackHandle: ack?.summaryAck?.contents?.handle,\n }, error);\n }\n refSequenceNumber++;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"summarizer.js","sourceRoot":"","sources":["../src/summarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAW,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC9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0CAAE,QAAQ,0CAAE,MAAM;iBAC/C,EAAE,KAAK,CAAC,CAAC;aACb;YACD,iBAAiB,EAAE,CAAC;SACvB;IACL,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { Deferred } from \"@fluidframework/common-utils\";\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ILoader, LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { UsageError } from \"@fluidframework/container-utils\";\nimport { DriverErrorType, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { requestFluidObject } from \"@fluidframework/runtime-utils\";\nimport {\n ChildLogger,\n IFluidErrorBase,\n isFluidError,\n LoggingError,\n wrapErrorAndLog,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n FluidObject,\n IFluidHandleContext,\n IFluidHandle,\n IRequest,\n} from \"@fluidframework/core-interfaces\";\nimport { ISummaryConfiguration } from \"./containerRuntime\";\nimport { ICancellableSummarizerController } from \"./runWhileConnectedCoordinator\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\nimport { IAckedSummary, SummaryCollection } from \"./summaryCollection\";\nimport { SummarizerHandle } from \"./summarizerHandle\";\nimport { RunningSummarizer } from \"./runningSummarizer\";\nimport {\n ISummarizer,\n ISummarizerInternalsProvider,\n ISummarizerRuntime,\n ISummarizingWarning,\n SummarizerStopReason,\n} from \"./summarizerTypes\";\nimport { SummarizeHeuristicData } from \"./summarizerHeuristics\";\nimport { SummarizeResultBuilder } from \"./summaryGenerator\";\nimport { IConnectableRuntime } from \".\";\n\nconst summarizingError = \"summarizingError\";\n\nexport class SummarizingWarning extends LoggingError implements ISummarizingWarning, IFluidErrorBase {\n readonly errorType = summarizingError;\n readonly canRetry = true;\n\n constructor(\n errorMessage: string,\n readonly logged: boolean = false,\n ) {\n super(errorMessage);\n }\n\n static wrap(error: any, logged: boolean = false, logger: ITelemetryLogger) {\n const newErrorFn = (errMsg: string) => new SummarizingWarning(errMsg, logged);\n return wrapErrorAndLog<SummarizingWarning>(error, newErrorFn, logger);\n }\n}\n\nexport const createSummarizingWarning =\n (errorMessage: string, logged: boolean) => new SummarizingWarning(errorMessage, logged);\n\n/**\n * Summarizer is responsible for coordinating when to generate and send summaries.\n * It is the main entry point for summary work.\n * It is created only by summarizing container (i.e. one with clientType === \"summarizer\")\n */\nexport class Summarizer extends EventEmitter implements ISummarizer {\n public get IFluidLoadable() { return this; }\n public get ISummarizer() { return this; }\n\n private readonly logger: ITelemetryLogger;\n private runningSummarizer?: RunningSummarizer;\n private _disposed: boolean = false;\n private starting: boolean = false;\n\n private readonly innerHandle: IFluidHandle<this>;\n\n public get handle(): IFluidHandle<this> { return this.innerHandle; }\n private readonly stopDeferred = new Deferred<SummarizerStopReason>();\n\n constructor(\n url: string,\n /** Reference to runtime that created this object.\n * i.e. runtime with clientType === \"summarizer\"\n */\n private readonly runtime: ISummarizerRuntime,\n private readonly configurationGetter: () => ISummaryConfiguration,\n /** Represents an object that can generate summary.\n * In practical terms, it's same runtime (this.runtime) with clientType === \"summarizer\".\n */\n private readonly internalsProvider: ISummarizerInternalsProvider,\n handleContext: IFluidHandleContext,\n public readonly summaryCollection: SummaryCollection,\n private readonly runCoordinatorCreateFn:\n (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>,\n ) {\n super();\n this.logger = ChildLogger.create(this.runtime.logger, \"Summarizer\");\n this.innerHandle = new SummarizerHandle(this, url, handleContext);\n }\n\n /**\n * Creates a Summarizer and its underlying client.\n * Note that different implementations of ILoader will handle the URL differently.\n * ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's\n * starting with \"/\" as relative to the Container. The general ILoader\n * interface will expect an absolute URL and will not handle \"/\".\n * @param loader - the loader that resolves the request\n * @param url - the URL used to resolve the container\n */\n public static async create(\n loader: ILoader,\n url: string): Promise<ISummarizer> {\n const request: IRequest = {\n headers: {\n [LoaderHeader.cache]: false,\n [LoaderHeader.clientDetails]: {\n capabilities: { interactive: false },\n type: summarizerClientType,\n },\n [DriverHeader.summarizingClient]: true,\n [LoaderHeader.reconnect]: false,\n },\n url,\n };\n\n const resolvedContainer = await loader.resolve(request);\n const fluidObject =\n await requestFluidObject<FluidObject<ISummarizer>>(resolvedContainer, { url: \"_summarizer\" });\n if (fluidObject.ISummarizer === undefined) {\n throw new UsageError(\"Fluid object does not implement ISummarizer\");\n }\n return fluidObject.ISummarizer;\n }\n\n public async run(onBehalfOf: string): Promise<SummarizerStopReason> {\n try {\n return await this.runCore(onBehalfOf);\n } catch (error) {\n this.stop(\"summarizerException\");\n throw SummarizingWarning.wrap(error, false /* logged */, this.logger);\n } finally {\n this.close();\n }\n }\n\n /**\n * Stops the summarizer from running. This will complete\n * the run promise, and also close the container.\n * @param reason - reason code for stopping\n */\n public stop(reason: SummarizerStopReason) {\n this.stopDeferred.resolve(reason);\n }\n\n public close() {\n // This will result in \"summarizerClientDisconnected\" stop reason recorded in telemetry,\n // unless stop() was called earlier\n this.dispose();\n (this.runtime.disposeFn ?? this.runtime.closeFn)()\n }\n\n private async runCore(onBehalfOf: string): Promise<SummarizerStopReason> {\n const runCoordinator: ICancellableSummarizerController = await this.runCoordinatorCreateFn(this.runtime);\n\n // Wait for either external signal to cancel, or loss of connectivity.\n const stopP = Promise.race([runCoordinator.waitCancelled, this.stopDeferred.promise]);\n void stopP.then((reason) => {\n this.logger.sendTelemetryEvent({\n eventName: \"StoppingSummarizer\",\n onBehalfOf,\n reason,\n });\n });\n\n if (runCoordinator.cancelled) {\n return runCoordinator.waitCancelled;\n }\n\n const runningSummarizer = await this.start(onBehalfOf, runCoordinator);\n\n // Wait for either external signal to cancel, or loss of connectivity.\n const stopReason = await stopP;\n\n // There are two possible approaches here:\n // 1. Propagate cancellation from this.stopDeferred to runCoordinator. This will ensure that we move to the exit\n // faster, including breaking out of the RunningSummarizer.trySummarize() faster.\n // We could create new coordinator and pass it to waitStop() -> trySummarizeOnce(\"lastSummary\") flow.\n // The con of this approach is that we might cancel active summary, and lastSummary will fail because it\n // did not wait for ack/nack from previous summary. Plus we disregard any 429 kind of info from service\n // that way (i.e. trySummarize() loop might have been waiting for 5 min because storage told us so).\n // In general, it's more wasted resources.\n // 2. We can not do it and make waitStop() do last summary only if there was no active summary. This ensures\n // that client behaves properly (from server POV) and we do not waste resources. But, it may mean we wait\n // substantially longer for trySummarize() retries to play out and thus this summary loop may run into\n // conflict with new summarizer client starting on different client.\n // As of now, #2 is implemented. It's more forward looking, as issue #7279 suggests changing design for new\n // summarizer client to not be created until current summarizer fully moves to exit, and that would reduce\n // cons of #2 substantially.\n\n // Cleanup after running\n await runningSummarizer.waitStop(\n !runCoordinator.cancelled && Summarizer.stopReasonCanRunLastSummary(stopReason));\n\n // Propagate reason and ensure that if someone is waiting for cancellation token, they are moving to exit\n runCoordinator.stop(stopReason);\n\n return stopReason;\n }\n\n /**\n * Should we try to run a last summary for the given stop reason?\n * Currently only allows \"parentNotConnected\"\n * @param stopReason - SummarizerStopReason\n * @returns - true if the stop reason can run a last summary\n */\n public static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean {\n return stopReason === \"parentNotConnected\";\n }\n\n /**\n * Put the summarizer in a started state, including creating and initializing the RunningSummarizer.\n * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user\n * (in the on-demand case).\n * @param onBehalfOf - ID of the client that requested that the summarizer start\n * @param runCoordinator - cancellation token\n * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.\n * @returns - Promise that is fulfilled when the RunningSummarizer is ready\n */\n private async start(\n onBehalfOf: string,\n runCoordinator: ICancellableSummarizerController): Promise<RunningSummarizer> {\n if (this.runningSummarizer) {\n if (this.runningSummarizer.disposed) {\n throw new UsageError(\"Starting a disposed summarizer\");\n }\n return this.runningSummarizer;\n }\n if (this.starting) {\n throw new UsageError(\"Attempting to start a summarizer that is already starting\");\n }\n this.starting = true;\n // Initialize values and first ack (time is not exact)\n this.logger.sendTelemetryEvent({\n eventName: \"RunningSummarizer\",\n onBehalfOf,\n initSummarySeqNumber: this.runtime.deltaManager.initialSequenceNumber,\n config: JSON.stringify(this.configurationGetter()),\n });\n\n // Summarizing container ID (with clientType === \"summarizer\")\n const clientId = this.runtime.clientId;\n if (clientId === undefined) {\n throw new UsageError(\"clientId should be defined if connected.\");\n }\n\n const runningSummarizer = await RunningSummarizer.start(\n this.logger,\n this.summaryCollection.createWatcher(clientId),\n this.configurationGetter(),\n async (...args) => this.internalsProvider.submitSummary(...args), // submitSummaryCallback\n new SummarizeHeuristicData(\n this.runtime.deltaManager.lastSequenceNumber,\n { /** summary attempt baseline for heuristics */\n refSequenceNumber: this.runtime.deltaManager.initialSequenceNumber,\n summaryTime: Date.now(),\n } as const,\n ),\n (errorMessage: string) => {\n if (!this._disposed) {\n this.logger.sendErrorEvent({ eventName: \"summarizingError\" },\n createSummarizingWarning(errorMessage, true));\n }\n },\n this.summaryCollection,\n runCoordinator /* cancellationToken */,\n (reason) => runCoordinator.stop(reason), /* stopSummarizerCallback */\n this.runtime,\n );\n this.runningSummarizer = runningSummarizer;\n this.starting = false;\n\n // Handle summary acks\n // Note: no exceptions are thrown from handleSummaryAcks handler as it handles all exceptions\n this.handleSummaryAcks().catch((error) => {\n this.logger.sendErrorEvent({ eventName: \"HandleSummaryAckFatalError\" }, error);\n });\n\n return runningSummarizer;\n }\n\n /**\n * Disposes of resources after running. This cleanup will\n * clear any outstanding timers and reset some of the state\n * properties.\n * Called by ContainerRuntime when it is disposed, as well as at the end the run().\n */\n public dispose() {\n // Given that the call can come from own ContainerRuntime, ensure that we stop all the processes.\n this.stop(\"summarizerClientDisconnected\");\n\n this._disposed = true;\n if (this.runningSummarizer) {\n this.runningSummarizer.dispose();\n this.runningSummarizer = undefined;\n }\n }\n\n public readonly summarizeOnDemand: ISummarizer[\"summarizeOnDemand\"] = (...args) => {\n try {\n if (this._disposed || this.runningSummarizer?.disposed) {\n throw new UsageError(\"Summarizer is already disposed.\");\n }\n if (this.runtime.summarizerClientId !== undefined &&\n this.runtime.summarizerClientId !== this.runtime.clientId) {\n // If there is an elected summarizer, and it's not this one, don't allow on-demand summary.\n // This is to prevent the on-demand summary and heuristic-based summary from stepping on\n // each other.\n throw new UsageError(\"On-demand summary attempted while an elected summarizer is present\");\n }\n const builder = new SummarizeResultBuilder();\n if (this.runningSummarizer) {\n // Summarizer is already running. Go ahead and start.\n return this.runningSummarizer.summarizeOnDemand(builder, ...args);\n }\n\n // Summarizer isn't running, so we need to start it, which is an async operation.\n // Manage the promise related to creating the cancellation token here.\n // The promises related to starting, summarizing,\n // and submitting are communicated to the caller through the results builder.\n const coordinatorCreateP = this.runCoordinatorCreateFn(this.runtime);\n\n coordinatorCreateP.then((runCoordinator) => {\n // Successfully created the cancellation token. Start the summarizer.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const startP = this.start(this.runtime.clientId!, runCoordinator);\n startP.then(async (runningSummarizer) => {\n // Successfully started the summarizer. Run it.\n runningSummarizer.summarizeOnDemand(builder, ...args);\n // Wait for a command to stop or loss of connectivity before tearing down the summarizer and client.\n const stopReason = await Promise.race([this.stopDeferred.promise, runCoordinator.waitCancelled]);\n await runningSummarizer.waitStop(false);\n runCoordinator.stop(stopReason);\n this.close();\n }).catch((reason) => {\n builder.fail(\"Failed to start summarizer\", reason);\n });\n }).catch((reason) => {\n builder.fail(\"Failed to create cancellation token\", reason);\n });\n\n return builder.build();\n } catch (error) {\n throw SummarizingWarning.wrap(error, false /* logged */, this.logger);\n }\n };\n\n public readonly enqueueSummarize: ISummarizer[\"enqueueSummarize\"] = (...args) => {\n if (this._disposed || this.runningSummarizer === undefined || this.runningSummarizer.disposed) {\n throw new UsageError(\"Summarizer is not running or already disposed.\");\n }\n return this.runningSummarizer.enqueueSummarize(...args);\n };\n\n private async handleSummaryAcks() {\n let refSequenceNumber = this.runtime.deltaManager.initialSequenceNumber;\n let ack: IAckedSummary | undefined;\n while (this.runningSummarizer) {\n const summaryLogger = this.runningSummarizer.tryGetCorrelatedLogger(refSequenceNumber) ?? this.logger;\n try {\n // Initialize ack with undefined if exception happens inside of waitSummaryAck on second iteration,\n // we record undefined, not previous handles.\n ack = undefined;\n ack = await this.summaryCollection.waitSummaryAck(refSequenceNumber);\n refSequenceNumber = ack.summaryOp.referenceSequenceNumber;\n const summaryOpHandle = ack.summaryOp.contents.handle;\n const summaryAckHandle = ack.summaryAck.contents.handle;\n // Make sure we block any summarizer from being executed/enqueued while\n // executing the refreshLatestSummaryAck.\n // https://dev.azure.com/fluidframework/internal/_workitems/edit/779\n await this.runningSummarizer.lockedRefreshSummaryAckAction(async () =>\n this.internalsProvider.refreshLatestSummaryAck({\n proposalHandle: summaryOpHandle,\n ackHandle: summaryAckHandle,\n summaryRefSeq: refSequenceNumber,\n summaryLogger },\n ).catch(async (error) => {\n // If the error is 404, so maybe the fetched version no longer exists on server. We just\n // ignore this error in that case, as that means we will have another summaryAck for the\n // latest version with which we will refresh the state. However in case of single commit\n // summary, we might me missing a summary ack, so in that case we are still fine as the\n // code in `submitSummary` function in container runtime, will refresh the latest state\n // by calling `refreshLatestSummaryAckFromServer` and we will be fine.\n if (isFluidError(error)\n && error.errorType === DriverErrorType.fileNotFoundOrAccessDeniedError) {\n summaryLogger.sendTelemetryEvent({\n eventName: \"HandleSummaryAckErrorIgnored\",\n referenceSequenceNumber: refSequenceNumber,\n proposalHandle: summaryOpHandle,\n ackHandle: summaryAckHandle,\n }, error);\n } else {\n throw error;\n }\n }),\n );\n } catch (error) {\n summaryLogger.sendErrorEvent({\n eventName: \"HandleSummaryAckError\",\n referenceSequenceNumber: refSequenceNumber,\n handle: ack?.summaryOp?.contents?.handle,\n ackHandle: ack?.summaryAck?.contents?.handle,\n }, error);\n }\n refSequenceNumber++;\n }\n }\n}\n"]}
|
package/lib/summarizerTypes.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export interface ISummarizerRuntime extends IConnectableRuntime {
|
|
|
71
71
|
readonly logger: ITelemetryLogger;
|
|
72
72
|
/** clientId of parent (non-summarizing) container that owns summarizer container */
|
|
73
73
|
readonly summarizerClientId: string | undefined;
|
|
74
|
+
disposeFn?(): void;
|
|
74
75
|
closeFn(): void;
|
|
75
76
|
/** @deprecated 1.0, please remove all implementations and usage */
|
|
76
77
|
on(event: "batchEnd", listener: (error: any, op: ISequencedDocumentMessage) => void): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerTypes.d.ts","sourceRoot":"","sources":["../src/summarizerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EACH,cAAc,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EACH,yBAAyB,EACzB,YAAY,EACZ,gBAAgB,EACnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,+BAA+B,EAAE,MAAM,GAAG,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,kBAAkC,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACjC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,aAAa,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,CAAC,GACvE,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,2CAA2C,CAAC,CAAC,CAAC;AAErF,MAAM,WAAW,yBAA0B,SAAQ,2BAA2B;IAC1E,0CAA0C;IAC1C,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,kDAAkD;IAClD,4BAA4B,EAAE,MAAM,MAAM,CAAC;CAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarizerTypes.js","sourceRoot":"","sources":["../src/summarizerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAA6B,aAAa,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IEvent,\n IEventProvider,\n ITelemetryLogger,\n ITelemetryProperties,\n} from \"@fluidframework/common-definitions\";\nimport { ITelemetryLoggerPropertyBag } from \"@fluidframework/telemetry-utils\";\nimport {\n IFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport { ContainerWarning, IDeltaManager } from \"@fluidframework/container-definitions\";\nimport {\n ISequencedDocumentMessage,\n ISummaryTree,\n IDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { ISummaryStats } from \"@fluidframework/runtime-definitions\";\nimport { ISummaryAckMessage, ISummaryNackMessage, ISummaryOpMessage } from \"./summaryCollection\";\nimport { SummarizeReason } from \"./summaryGenerator\";\nimport { ISummaryConfigurationHeuristics } from \".\";\n\n/**\n * @deprecated This will be removed in a later release.\n */\nexport const ISummarizer: keyof IProvideSummarizer = \"ISummarizer\";\n\n/**\n * @deprecated This will be removed in a later release.\n */\nexport interface IProvideSummarizer {\n /**\n * @deprecated This will be removed in a later release.\n */\n readonly ISummarizer: ISummarizer;\n}\n\n/**\n * Similar to AbortSignal, but using promise instead of events\n * @param T - cancellation reason type\n */\nexport interface ICancellationToken<T> {\n /** Tells if this cancellable token is cancelled */\n readonly cancelled: boolean;\n /**\n * Promise that gets fulfilled when this cancellable token is cancelled\n * @returns reason of cancellation\n */\n readonly waitCancelled: Promise<T>;\n}\n\n/* Similar to AbortSignal, but using promise instead of events */\nexport type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;\n\nexport interface ISummarizerInternalsProvider {\n /** Encapsulates the work to walk the internals of the running container to generate a summary */\n submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;\n\n /** Callback whenever a new SummaryAck is received, to update internal tracking state */\n refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;\n}\n\n/**\n * @deprecated Options that control the behavior of a running summarizer.\n * */\nexport interface ISummarizerOptions {\n /**\n * Set to true to disable the default heuristics from running; false by default.\n * This affects only the heuristics around when a summarizer should\n * submit summaries. So when it is disabled, summarizer clients should\n * not be expected to summarize unless an on-demand summary is requested.\n */\n disableHeuristics: boolean;\n}\n\nexport interface ISummarizingWarning extends ContainerWarning {\n readonly errorType: \"summarizingError\";\n readonly logged: boolean;\n}\n\nexport interface IConnectableRuntime {\n readonly disposed: boolean;\n readonly connected: boolean;\n readonly clientId: string | undefined;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n once(event: \"connected\" | \"disconnected\" | \"dispose\", listener: () => void): this;\n}\n\nexport interface ISummarizerRuntime extends IConnectableRuntime {\n readonly logger: ITelemetryLogger;\n /** clientId of parent (non-summarizing) container that owns summarizer container */\n readonly summarizerClientId: string | undefined;\n closeFn(): void;\n /** @deprecated 1.0, please remove all implementations and usage */\n on(event: \"batchEnd\", listener: (error: any, op: ISequencedDocumentMessage) => void): this;\n /** @deprecated 1.0, please remove all implementations and usage */\n removeListener(event: \"batchEnd\", listener: (error: any, op: ISequencedDocumentMessage) => void): this;\n}\n\n/** Options affecting summarize behavior. */\nexport interface ISummarizeOptions {\n /** True to generate the full tree with no handle reuse optimizations; defaults to false */\n readonly fullTree?: boolean;\n /** True to ask the server what the latest summary is first; defaults to false */\n readonly refreshLatestAck?: boolean;\n}\n\n/**\n * Data required to update internal tracking state after receiving a Summary Ack.\n */\n export interface IRefreshSummaryAckOptions {\n /** Handle from the ack's summary op. */\n readonly proposalHandle: string | undefined;\n /** Handle from the summary ack just received */\n readonly ackHandle: string;\n /** Reference sequence number from the ack's summary op */\n readonly summaryRefSeq: number;\n /** Telemetry logger to which telemetry events will be forwarded. */\n readonly summaryLogger: ITelemetryLogger;\n}\n\nexport interface ISubmitSummaryOptions extends ISummarizeOptions {\n /** Logger to use for correlated summary events */\n readonly summaryLogger: ITelemetryLogger;\n /** Tells when summary process should be cancelled */\n readonly cancellationToken: ISummaryCancellationToken;\n}\n\nexport interface IOnDemandSummarizeOptions extends ISummarizeOptions {\n /** Reason for generating summary. */\n readonly reason: string;\n}\n\n/** Options to use when enqueueing a summarize attempt. */\nexport interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {\n /** If specified, The summarize attempt will not occur until after this sequence number. */\n readonly afterSequenceNumber?: number;\n\n /**\n * True to override the existing enqueued summarize attempt if there is one.\n * This will guarantee that this attempt gets enqueued. If override is false,\n * than an existing enqueued summarize attempt will block a new one from being\n * enqueued. There can only be one enqueued at a time. Defaults to false.\n */\n readonly override?: boolean;\n}\n\n/**\n * In addition to the normal summary tree + stats, this contains additional stats\n * only relevant at the root of the tree.\n */\nexport interface IGeneratedSummaryStats extends ISummaryStats {\n /** The total number of data stores in the container. */\n readonly dataStoreCount: number;\n /** The number of data stores that were summarized in this summary. */\n readonly summarizedDataStoreCount: number;\n /** The number of data stores whose GC reference state was updated in this summary. */\n readonly gcStateUpdatedDataStoreCount?: number;\n /** The size of the gc blobs in this summary. */\n readonly gcTotalBlobsSize?: number;\n /** The number of gc blobs in this summary. */\n readonly gcBlobNodeCount?: number;\n /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */\n readonly summaryNumber: number;\n}\n\n/** Base results for all submitSummary attempts. */\nexport interface IBaseSummarizeResult {\n readonly stage: \"base\";\n /** Error object related to failed summarize attempt. */\n readonly error: any;\n /** Reference sequence number as of the generate summary attempt. */\n readonly referenceSequenceNumber: number;\n readonly minimumSequenceNumber: number;\n}\n\n/** Results of submitSummary after generating the summary tree. */\nexport interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, \"stage\"> {\n readonly stage: \"generate\";\n /** Generated summary tree. */\n readonly summaryTree: ISummaryTree;\n /** Stats for generated summary tree. */\n readonly summaryStats: IGeneratedSummaryStats;\n /** Time it took to generate the summary tree and stats. */\n readonly generateDuration: number;\n /** True if the full tree regeneration with no handle reuse optimizations was forced. */\n readonly forcedFullTree: boolean;\n}\n\n/** Results of submitSummary after uploading the tree to storage. */\nexport interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, \"stage\"> {\n readonly stage: \"upload\";\n /** The handle returned by storage pointing to the uploaded summary tree. */\n readonly handle: string;\n /** Time it took to upload the summary tree to storage. */\n readonly uploadDuration: number;\n}\n\n/** Results of submitSummary after submitting the summarize op. */\nexport interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, \"stage\" | \"error\"> {\n readonly stage: \"submit\";\n /** The client sequence number of the summarize op submitted for the summary. */\n readonly clientSequenceNumber: number;\n /** Time it took to submit the summarize op to the broadcasting service. */\n readonly submitOpDuration: number;\n}\n\n/**\n * Strict type representing result of a submitSummary attempt.\n * The result consists of 4 possible stages, each with its own data.\n * The data is cumulative, so each stage will contain the data from the previous stages.\n * If the final \"submitted\" stage is not reached, the result may contain the error object.\n *\n * Stages:\n *\n * 1. \"base\" - stopped before the summary tree was even generated, and the result only contains the base data\n *\n * 2. \"generate\" - the summary tree was generated, and the result will contain that tree + stats\n *\n * 3. \"upload\" - the summary was uploaded to storage, and the result contains the server-provided handle\n *\n * 4. \"submit\" - the summarize op was submitted, and the result contains the op client sequence number.\n */\nexport type SubmitSummaryResult =\n | IBaseSummarizeResult\n | IGenerateSummaryTreeResult\n | IUploadSummaryResult\n | ISubmitSummaryOpResult;\n\nexport interface IBroadcastSummaryResult {\n readonly summarizeOp: ISummaryOpMessage;\n readonly broadcastDuration: number;\n}\n\nexport interface IAckSummaryResult {\n readonly summaryAckOp: ISummaryAckMessage;\n readonly ackNackDuration: number;\n}\n\nexport interface INackSummaryResult {\n readonly summaryNackOp: ISummaryNackMessage;\n readonly ackNackDuration: number;\n}\n\nexport type SummarizeResultPart<TSuccess, TFailure = undefined> = {\n success: true;\n data: TSuccess;\n} | {\n success: false;\n data: TFailure | undefined;\n message: string;\n error: any;\n retryAfterSeconds?: number;\n};\n\nexport interface ISummarizeResults {\n /** Resolves when we generate, upload, and submit the summary. */\n readonly summarySubmitted: Promise<SummarizeResultPart<SubmitSummaryResult>>;\n /** Resolves when we observe our summarize op broadcast. */\n readonly summaryOpBroadcasted: Promise<SummarizeResultPart<IBroadcastSummaryResult>>;\n /** Resolves when we receive a summaryAck or summaryNack. */\n readonly receivedSummaryAckOrNack: Promise<SummarizeResultPart<IAckSummaryResult, INackSummaryResult>>;\n}\n\nexport type EnqueueSummarizeResult = (ISummarizeResults & {\n /**\n * Indicates that another summarize attempt is not already enqueued,\n * and this attempt has been enqueued.\n */\n readonly alreadyEnqueued?: undefined;\n}) | (ISummarizeResults & {\n /** Indicates that another summarize attempt was already enqueued. */\n readonly alreadyEnqueued: true;\n /**\n * Indicates that the other enqueued summarize attempt was abandoned,\n * and this attempt has been enqueued enqueued.\n */\n readonly overridden: true;\n}) | {\n /** Indicates that another summarize attempt was already enqueued. */\n readonly alreadyEnqueued: true;\n /**\n * Indicates that the other enqueued summarize attempt remains enqueued,\n * and this attempt has not been enqueued.\n */\n readonly overridden?: undefined;\n};\n\nexport type SummarizerStopReason =\n /** Summarizer client failed to summarize in all 3 consecutive attempts. */\n | \"failToSummarize\"\n /** Parent client reported that it is no longer connected. */\n | \"parentNotConnected\"\n /**\n * Parent client reported that it is no longer elected the summarizer.\n * This is the normal flow; a disconnect will always trigger the parent\n * client to no longer be elected as responsible for summaries. Then it\n * tries to stop its spawned summarizer client.\n */\n | \"notElectedParent\"\n /**\n * We are not already running the summarizer and we are not the current elected client id.\n */\n | \"notElectedClient\"\n /** Summarizer client was disconnected */\n | \"summarizerClientDisconnected\"\n /* running summarizer threw an exception */\n | \"summarizerException\";\n\nexport interface ISummarizerEvents extends IEvent {\n /**\n * An event indicating that the Summarizer is having problems summarizing\n */\n (event: \"summarizingError\", listener: (error: ISummarizingWarning) => void);\n}\n\nexport interface ISummarizer extends\n IEventProvider<ISummarizerEvents>, IFluidLoadable, Partial<IProvideSummarizer> {\n /*\n * Asks summarizer to move to exit.\n * Summarizer will finish current processes, which may take a while.\n * For example, summarizer may complete last summary before exiting.\n */\n stop(reason: SummarizerStopReason): void;\n\n /* Closes summarizer. Any pending processes (summary in flight) are abandoned. */\n close(): void;\n\n run(onBehalfOf: string, disableHeuristics?: boolean): Promise<SummarizerStopReason>;\n\n /**\n * Attempts to generate a summary on demand. If already running, takes no action.\n * @param options - options controlling the summarize attempt\n * @returns an alreadyRunning promise if a summarize attempt is already in progress,\n * which will resolve when the current attempt completes. At that point caller can\n * decide to try again or not. Otherwise, it will return an object containing promises\n * that resolve as the summarize attempt progresses. They will resolve with success\n * false if a failure is encountered.\n */\n summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;\n /**\n * Enqueue an attempt to summarize after the specified sequence number.\n * If afterSequenceNumber is provided, the summarize attempt is \"enqueued\"\n * to run once an eligible op comes in with sequenceNumber \\>= afterSequenceNumber.\n * @param options - options controlling the summarize attempt\n * @returns an object containing an alreadyEnqueued flag to indicate if another\n * summarize attempt has already been enqueued. It also may contain an overridden flag\n * when alreadyEnqueued is true, that indicates whether this attempt forced the\n * previous attempt to abort. If this attempt becomes enqueued, it returns an object\n * containing promises that resolve as the summarize attempt progresses. They will\n * resolve with success false if a failure is encountered.\n */\n enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;\n}\n\n/** Data about an attempt to summarize used for heuristics. */\nexport interface ISummarizeAttempt {\n /** Reference sequence number when summary was generated or attempted */\n readonly refSequenceNumber: number;\n\n /** Time of summary attempt after it was sent or attempted */\n readonly summaryTime: number;\n\n /** Sequence number of summary op */\n summarySequenceNumber?: number;\n}\n\n/** Data relevant for summary heuristics. */\nexport interface ISummarizeHeuristicData {\n /** Latest received op sequence number */\n lastOpSequenceNumber: number;\n\n /** Most recent summary attempt from this client */\n readonly lastAttempt: ISummarizeAttempt;\n\n /** Most recent summary that received an ack */\n readonly lastSuccessfulSummary: Readonly<ISummarizeAttempt>;\n\n /** Number of runtime ops since last summary */\n numRuntimeOps: number;\n\n /** Number of non-runtime ops since last summary */\n numNonRuntimeOps: number;\n\n /** Cumulative size in bytes of all the ops since the last summary */\n totalOpsSize: number;\n\n /** Wether or not this instance contains adjusted metrics due to missing op data */\n hasMissingOpData: boolean;\n\n /**\n * Updates lastAttempt and lastSuccessfulAttempt based on the last summary.\n * @param lastSummary - last ack summary\n */\n updateWithLastSummaryAckInfo(lastSummary: ISummarizeAttempt): void;\n\n /**\n * Records a summary attempt. If the attempt was successfully sent,\n * provide the reference sequence number, otherwise it will be set\n * to the last seen op sequence number.\n * @param referenceSequenceNumber - reference sequence number of sent summary\n */\n recordAttempt(referenceSequenceNumber?: number): void;\n\n /** Mark that the last sent summary attempt has received an ack */\n markLastAttemptAsSuccessful(): void;\n}\n\n/** Responsible for running heuristics determining when to summarize. */\nexport interface ISummarizeHeuristicRunner {\n /** Start specific heuristic trackers (ex: idle timer) */\n start(): void;\n\n /** Runs the heuristics to determine if it should try to summarize */\n run(): void;\n\n /** Runs a different heuristic to check if it should summarize before closing */\n shouldRunLastSummary(): boolean;\n\n /** Disposes of resources */\n dispose(): void;\n}\n\ntype ISummarizeTelemetryRequiredProperties =\n /** Reason code for attempting to summarize */\n \"reason\";\n\ntype ISummarizeTelemetryOptionalProperties =\n /** Number of attempts within the last time window, used for calculating the throttle delay. */\n \"summaryAttempts\" |\n /** Number of attempts within the current phase (currently capped at 2 ) */\n \"summaryAttemptsPerPhase\" |\n /** One-based count of phases we've attempted (used to index into an array of ISummarizeOptions */\n \"summaryAttemptPhase\" |\n keyof ISummarizeOptions;\n\nexport type ISummarizeTelemetryProperties =\n Pick<ITelemetryProperties, ISummarizeTelemetryRequiredProperties> &\n Partial<Pick<ITelemetryProperties, ISummarizeTelemetryOptionalProperties>>;\n\n/** Strategy used to heuristically determine when we should run a summary */\nexport interface ISummaryHeuristicStrategy {\n /** Summarize reason for this summarize heuristic strategy (ex: \"maxTime\") */\n summarizeReason: Readonly<SummarizeReason>;\n\n /**\n * Determines if this strategy's summarize criteria been met\n * @param configuration - summary configuration we are to check against\n * @param heuristicData - heuristic data used to confirm conditions are met\n */\n shouldRunSummary(configuration: ISummaryConfigurationHeuristics, heuristicData: ISummarizeHeuristicData): boolean;\n}\n\ntype SummaryGeneratorRequiredTelemetryProperties =\n /** True to generate the full tree with no handle reuse optimizations */\n \"fullTree\" |\n /** Time since we last attempted to generate a summary */\n \"timeSinceLastAttempt\" |\n /** Time since we last successfully generated a summary */\n \"timeSinceLastSummary\";\n\ntype SummaryGeneratorOptionalTelemetryProperties =\n /** Reference sequence number as of the generate summary attempt. */\n \"referenceSequenceNumber\" |\n /** minimum sequence number (at the reference sequence number) */\n \"minimumSequenceNumber\" |\n /** Delta between the current reference sequence number and the reference sequence number of the last attempt */\n \"opsSinceLastAttempt\" |\n /** Delta between the current reference sequence number and the reference sequence number of the last summary */\n \"opsSinceLastSummary\" |\n /**\n * Delta in sum of op sizes between the current reference sequence number and the reference\n * sequence number of the last summary\n */\n \"opsSizesSinceLastSummary\" |\n /** Delta between the number of non-runtime ops since the last summary */\n \"nonRuntimeOpsSinceLastSummary\" |\n /** Wether or not this instance contains adjusted metrics due to missing op data */\n \"hasMissingOpData\" |\n /** Time it took to generate the summary tree and stats. */\n \"generateDuration\" |\n /** The handle returned by storage pointing to the uploaded summary tree. */\n \"handle\" |\n /** Time it took to upload the summary tree to storage. */\n \"uploadDuration\" |\n /** The client sequence number of the summarize op submitted for the summary. */\n \"clientSequenceNumber\" |\n /** Time it took for this summary to be acked after it was generated */\n \"ackWaitDuration\" |\n /** Reference sequence number of the ack/nack message */\n \"ackNackSequenceNumber\" |\n /** Actual sequence number of the summary op proposal. */\n \"summarySequenceNumber\" |\n /** Optional Retry-After time in seconds. If specified, the client should wait this many seconds before retrying. */\n \"nackRetryAfter\";\n\nexport type SummaryGeneratorTelemetry =\n Pick<ITelemetryProperties, SummaryGeneratorRequiredTelemetryProperties> &\n Partial<Pick<ITelemetryProperties, SummaryGeneratorOptionalTelemetryProperties>>;\n\nexport interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {\n /** Number of times the summarizer run. */\n summarizeCount: () => number;\n /** Number of successful attempts to summarize. */\n summarizerSuccessfulAttempts: () => number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"summarizerTypes.js","sourceRoot":"","sources":["../src/summarizerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAA6B,aAAa,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IEvent,\n IEventProvider,\n ITelemetryLogger,\n ITelemetryProperties,\n} from \"@fluidframework/common-definitions\";\nimport { ITelemetryLoggerPropertyBag } from \"@fluidframework/telemetry-utils\";\nimport {\n IFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport { ContainerWarning, IDeltaManager } from \"@fluidframework/container-definitions\";\nimport {\n ISequencedDocumentMessage,\n ISummaryTree,\n IDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { ISummaryStats } from \"@fluidframework/runtime-definitions\";\nimport { ISummaryAckMessage, ISummaryNackMessage, ISummaryOpMessage } from \"./summaryCollection\";\nimport { SummarizeReason } from \"./summaryGenerator\";\nimport { ISummaryConfigurationHeuristics } from \".\";\n\n/**\n * @deprecated This will be removed in a later release.\n */\nexport const ISummarizer: keyof IProvideSummarizer = \"ISummarizer\";\n\n/**\n * @deprecated This will be removed in a later release.\n */\nexport interface IProvideSummarizer {\n /**\n * @deprecated This will be removed in a later release.\n */\n readonly ISummarizer: ISummarizer;\n}\n\n/**\n * Similar to AbortSignal, but using promise instead of events\n * @param T - cancellation reason type\n */\nexport interface ICancellationToken<T> {\n /** Tells if this cancellable token is cancelled */\n readonly cancelled: boolean;\n /**\n * Promise that gets fulfilled when this cancellable token is cancelled\n * @returns reason of cancellation\n */\n readonly waitCancelled: Promise<T>;\n}\n\n/* Similar to AbortSignal, but using promise instead of events */\nexport type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;\n\nexport interface ISummarizerInternalsProvider {\n /** Encapsulates the work to walk the internals of the running container to generate a summary */\n submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;\n\n /** Callback whenever a new SummaryAck is received, to update internal tracking state */\n refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;\n}\n\n/**\n * @deprecated Options that control the behavior of a running summarizer.\n * */\nexport interface ISummarizerOptions {\n /**\n * Set to true to disable the default heuristics from running; false by default.\n * This affects only the heuristics around when a summarizer should\n * submit summaries. So when it is disabled, summarizer clients should\n * not be expected to summarize unless an on-demand summary is requested.\n */\n disableHeuristics: boolean;\n}\n\nexport interface ISummarizingWarning extends ContainerWarning {\n readonly errorType: \"summarizingError\";\n readonly logged: boolean;\n}\n\nexport interface IConnectableRuntime {\n readonly disposed: boolean;\n readonly connected: boolean;\n readonly clientId: string | undefined;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n once(event: \"connected\" | \"disconnected\" | \"dispose\", listener: () => void): this;\n}\n\nexport interface ISummarizerRuntime extends IConnectableRuntime {\n readonly logger: ITelemetryLogger;\n /** clientId of parent (non-summarizing) container that owns summarizer container */\n readonly summarizerClientId: string | undefined;\n disposeFn?(): void;\n closeFn(): void;\n /** @deprecated 1.0, please remove all implementations and usage */\n on(event: \"batchEnd\", listener: (error: any, op: ISequencedDocumentMessage) => void): this;\n /** @deprecated 1.0, please remove all implementations and usage */\n removeListener(event: \"batchEnd\", listener: (error: any, op: ISequencedDocumentMessage) => void): this;\n}\n\n/** Options affecting summarize behavior. */\nexport interface ISummarizeOptions {\n /** True to generate the full tree with no handle reuse optimizations; defaults to false */\n readonly fullTree?: boolean;\n /** True to ask the server what the latest summary is first; defaults to false */\n readonly refreshLatestAck?: boolean;\n}\n\n/**\n * Data required to update internal tracking state after receiving a Summary Ack.\n */\n export interface IRefreshSummaryAckOptions {\n /** Handle from the ack's summary op. */\n readonly proposalHandle: string | undefined;\n /** Handle from the summary ack just received */\n readonly ackHandle: string;\n /** Reference sequence number from the ack's summary op */\n readonly summaryRefSeq: number;\n /** Telemetry logger to which telemetry events will be forwarded. */\n readonly summaryLogger: ITelemetryLogger;\n}\n\nexport interface ISubmitSummaryOptions extends ISummarizeOptions {\n /** Logger to use for correlated summary events */\n readonly summaryLogger: ITelemetryLogger;\n /** Tells when summary process should be cancelled */\n readonly cancellationToken: ISummaryCancellationToken;\n}\n\nexport interface IOnDemandSummarizeOptions extends ISummarizeOptions {\n /** Reason for generating summary. */\n readonly reason: string;\n}\n\n/** Options to use when enqueueing a summarize attempt. */\nexport interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {\n /** If specified, The summarize attempt will not occur until after this sequence number. */\n readonly afterSequenceNumber?: number;\n\n /**\n * True to override the existing enqueued summarize attempt if there is one.\n * This will guarantee that this attempt gets enqueued. If override is false,\n * than an existing enqueued summarize attempt will block a new one from being\n * enqueued. There can only be one enqueued at a time. Defaults to false.\n */\n readonly override?: boolean;\n}\n\n/**\n * In addition to the normal summary tree + stats, this contains additional stats\n * only relevant at the root of the tree.\n */\nexport interface IGeneratedSummaryStats extends ISummaryStats {\n /** The total number of data stores in the container. */\n readonly dataStoreCount: number;\n /** The number of data stores that were summarized in this summary. */\n readonly summarizedDataStoreCount: number;\n /** The number of data stores whose GC reference state was updated in this summary. */\n readonly gcStateUpdatedDataStoreCount?: number;\n /** The size of the gc blobs in this summary. */\n readonly gcTotalBlobsSize?: number;\n /** The number of gc blobs in this summary. */\n readonly gcBlobNodeCount?: number;\n /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */\n readonly summaryNumber: number;\n}\n\n/** Base results for all submitSummary attempts. */\nexport interface IBaseSummarizeResult {\n readonly stage: \"base\";\n /** Error object related to failed summarize attempt. */\n readonly error: any;\n /** Reference sequence number as of the generate summary attempt. */\n readonly referenceSequenceNumber: number;\n readonly minimumSequenceNumber: number;\n}\n\n/** Results of submitSummary after generating the summary tree. */\nexport interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, \"stage\"> {\n readonly stage: \"generate\";\n /** Generated summary tree. */\n readonly summaryTree: ISummaryTree;\n /** Stats for generated summary tree. */\n readonly summaryStats: IGeneratedSummaryStats;\n /** Time it took to generate the summary tree and stats. */\n readonly generateDuration: number;\n /** True if the full tree regeneration with no handle reuse optimizations was forced. */\n readonly forcedFullTree: boolean;\n}\n\n/** Results of submitSummary after uploading the tree to storage. */\nexport interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, \"stage\"> {\n readonly stage: \"upload\";\n /** The handle returned by storage pointing to the uploaded summary tree. */\n readonly handle: string;\n /** Time it took to upload the summary tree to storage. */\n readonly uploadDuration: number;\n}\n\n/** Results of submitSummary after submitting the summarize op. */\nexport interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, \"stage\" | \"error\"> {\n readonly stage: \"submit\";\n /** The client sequence number of the summarize op submitted for the summary. */\n readonly clientSequenceNumber: number;\n /** Time it took to submit the summarize op to the broadcasting service. */\n readonly submitOpDuration: number;\n}\n\n/**\n * Strict type representing result of a submitSummary attempt.\n * The result consists of 4 possible stages, each with its own data.\n * The data is cumulative, so each stage will contain the data from the previous stages.\n * If the final \"submitted\" stage is not reached, the result may contain the error object.\n *\n * Stages:\n *\n * 1. \"base\" - stopped before the summary tree was even generated, and the result only contains the base data\n *\n * 2. \"generate\" - the summary tree was generated, and the result will contain that tree + stats\n *\n * 3. \"upload\" - the summary was uploaded to storage, and the result contains the server-provided handle\n *\n * 4. \"submit\" - the summarize op was submitted, and the result contains the op client sequence number.\n */\nexport type SubmitSummaryResult =\n | IBaseSummarizeResult\n | IGenerateSummaryTreeResult\n | IUploadSummaryResult\n | ISubmitSummaryOpResult;\n\nexport interface IBroadcastSummaryResult {\n readonly summarizeOp: ISummaryOpMessage;\n readonly broadcastDuration: number;\n}\n\nexport interface IAckSummaryResult {\n readonly summaryAckOp: ISummaryAckMessage;\n readonly ackNackDuration: number;\n}\n\nexport interface INackSummaryResult {\n readonly summaryNackOp: ISummaryNackMessage;\n readonly ackNackDuration: number;\n}\n\nexport type SummarizeResultPart<TSuccess, TFailure = undefined> = {\n success: true;\n data: TSuccess;\n} | {\n success: false;\n data: TFailure | undefined;\n message: string;\n error: any;\n retryAfterSeconds?: number;\n};\n\nexport interface ISummarizeResults {\n /** Resolves when we generate, upload, and submit the summary. */\n readonly summarySubmitted: Promise<SummarizeResultPart<SubmitSummaryResult>>;\n /** Resolves when we observe our summarize op broadcast. */\n readonly summaryOpBroadcasted: Promise<SummarizeResultPart<IBroadcastSummaryResult>>;\n /** Resolves when we receive a summaryAck or summaryNack. */\n readonly receivedSummaryAckOrNack: Promise<SummarizeResultPart<IAckSummaryResult, INackSummaryResult>>;\n}\n\nexport type EnqueueSummarizeResult = (ISummarizeResults & {\n /**\n * Indicates that another summarize attempt is not already enqueued,\n * and this attempt has been enqueued.\n */\n readonly alreadyEnqueued?: undefined;\n}) | (ISummarizeResults & {\n /** Indicates that another summarize attempt was already enqueued. */\n readonly alreadyEnqueued: true;\n /**\n * Indicates that the other enqueued summarize attempt was abandoned,\n * and this attempt has been enqueued enqueued.\n */\n readonly overridden: true;\n}) | {\n /** Indicates that another summarize attempt was already enqueued. */\n readonly alreadyEnqueued: true;\n /**\n * Indicates that the other enqueued summarize attempt remains enqueued,\n * and this attempt has not been enqueued.\n */\n readonly overridden?: undefined;\n};\n\nexport type SummarizerStopReason =\n /** Summarizer client failed to summarize in all 3 consecutive attempts. */\n | \"failToSummarize\"\n /** Parent client reported that it is no longer connected. */\n | \"parentNotConnected\"\n /**\n * Parent client reported that it is no longer elected the summarizer.\n * This is the normal flow; a disconnect will always trigger the parent\n * client to no longer be elected as responsible for summaries. Then it\n * tries to stop its spawned summarizer client.\n */\n | \"notElectedParent\"\n /**\n * We are not already running the summarizer and we are not the current elected client id.\n */\n | \"notElectedClient\"\n /** Summarizer client was disconnected */\n | \"summarizerClientDisconnected\"\n /* running summarizer threw an exception */\n | \"summarizerException\";\n\nexport interface ISummarizerEvents extends IEvent {\n /**\n * An event indicating that the Summarizer is having problems summarizing\n */\n (event: \"summarizingError\", listener: (error: ISummarizingWarning) => void);\n}\n\nexport interface ISummarizer extends\n IEventProvider<ISummarizerEvents>, IFluidLoadable, Partial<IProvideSummarizer> {\n /*\n * Asks summarizer to move to exit.\n * Summarizer will finish current processes, which may take a while.\n * For example, summarizer may complete last summary before exiting.\n */\n stop(reason: SummarizerStopReason): void;\n\n /* Closes summarizer. Any pending processes (summary in flight) are abandoned. */\n close(): void;\n\n run(onBehalfOf: string, disableHeuristics?: boolean): Promise<SummarizerStopReason>;\n\n /**\n * Attempts to generate a summary on demand. If already running, takes no action.\n * @param options - options controlling the summarize attempt\n * @returns an alreadyRunning promise if a summarize attempt is already in progress,\n * which will resolve when the current attempt completes. At that point caller can\n * decide to try again or not. Otherwise, it will return an object containing promises\n * that resolve as the summarize attempt progresses. They will resolve with success\n * false if a failure is encountered.\n */\n summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;\n /**\n * Enqueue an attempt to summarize after the specified sequence number.\n * If afterSequenceNumber is provided, the summarize attempt is \"enqueued\"\n * to run once an eligible op comes in with sequenceNumber \\>= afterSequenceNumber.\n * @param options - options controlling the summarize attempt\n * @returns an object containing an alreadyEnqueued flag to indicate if another\n * summarize attempt has already been enqueued. It also may contain an overridden flag\n * when alreadyEnqueued is true, that indicates whether this attempt forced the\n * previous attempt to abort. If this attempt becomes enqueued, it returns an object\n * containing promises that resolve as the summarize attempt progresses. They will\n * resolve with success false if a failure is encountered.\n */\n enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;\n}\n\n/** Data about an attempt to summarize used for heuristics. */\nexport interface ISummarizeAttempt {\n /** Reference sequence number when summary was generated or attempted */\n readonly refSequenceNumber: number;\n\n /** Time of summary attempt after it was sent or attempted */\n readonly summaryTime: number;\n\n /** Sequence number of summary op */\n summarySequenceNumber?: number;\n}\n\n/** Data relevant for summary heuristics. */\nexport interface ISummarizeHeuristicData {\n /** Latest received op sequence number */\n lastOpSequenceNumber: number;\n\n /** Most recent summary attempt from this client */\n readonly lastAttempt: ISummarizeAttempt;\n\n /** Most recent summary that received an ack */\n readonly lastSuccessfulSummary: Readonly<ISummarizeAttempt>;\n\n /** Number of runtime ops since last summary */\n numRuntimeOps: number;\n\n /** Number of non-runtime ops since last summary */\n numNonRuntimeOps: number;\n\n /** Cumulative size in bytes of all the ops since the last summary */\n totalOpsSize: number;\n\n /** Wether or not this instance contains adjusted metrics due to missing op data */\n hasMissingOpData: boolean;\n\n /**\n * Updates lastAttempt and lastSuccessfulAttempt based on the last summary.\n * @param lastSummary - last ack summary\n */\n updateWithLastSummaryAckInfo(lastSummary: ISummarizeAttempt): void;\n\n /**\n * Records a summary attempt. If the attempt was successfully sent,\n * provide the reference sequence number, otherwise it will be set\n * to the last seen op sequence number.\n * @param referenceSequenceNumber - reference sequence number of sent summary\n */\n recordAttempt(referenceSequenceNumber?: number): void;\n\n /** Mark that the last sent summary attempt has received an ack */\n markLastAttemptAsSuccessful(): void;\n}\n\n/** Responsible for running heuristics determining when to summarize. */\nexport interface ISummarizeHeuristicRunner {\n /** Start specific heuristic trackers (ex: idle timer) */\n start(): void;\n\n /** Runs the heuristics to determine if it should try to summarize */\n run(): void;\n\n /** Runs a different heuristic to check if it should summarize before closing */\n shouldRunLastSummary(): boolean;\n\n /** Disposes of resources */\n dispose(): void;\n}\n\ntype ISummarizeTelemetryRequiredProperties =\n /** Reason code for attempting to summarize */\n \"reason\";\n\ntype ISummarizeTelemetryOptionalProperties =\n /** Number of attempts within the last time window, used for calculating the throttle delay. */\n \"summaryAttempts\" |\n /** Number of attempts within the current phase (currently capped at 2 ) */\n \"summaryAttemptsPerPhase\" |\n /** One-based count of phases we've attempted (used to index into an array of ISummarizeOptions */\n \"summaryAttemptPhase\" |\n keyof ISummarizeOptions;\n\nexport type ISummarizeTelemetryProperties =\n Pick<ITelemetryProperties, ISummarizeTelemetryRequiredProperties> &\n Partial<Pick<ITelemetryProperties, ISummarizeTelemetryOptionalProperties>>;\n\n/** Strategy used to heuristically determine when we should run a summary */\nexport interface ISummaryHeuristicStrategy {\n /** Summarize reason for this summarize heuristic strategy (ex: \"maxTime\") */\n summarizeReason: Readonly<SummarizeReason>;\n\n /**\n * Determines if this strategy's summarize criteria been met\n * @param configuration - summary configuration we are to check against\n * @param heuristicData - heuristic data used to confirm conditions are met\n */\n shouldRunSummary(configuration: ISummaryConfigurationHeuristics, heuristicData: ISummarizeHeuristicData): boolean;\n}\n\ntype SummaryGeneratorRequiredTelemetryProperties =\n /** True to generate the full tree with no handle reuse optimizations */\n \"fullTree\" |\n /** Time since we last attempted to generate a summary */\n \"timeSinceLastAttempt\" |\n /** Time since we last successfully generated a summary */\n \"timeSinceLastSummary\";\n\ntype SummaryGeneratorOptionalTelemetryProperties =\n /** Reference sequence number as of the generate summary attempt. */\n \"referenceSequenceNumber\" |\n /** minimum sequence number (at the reference sequence number) */\n \"minimumSequenceNumber\" |\n /** Delta between the current reference sequence number and the reference sequence number of the last attempt */\n \"opsSinceLastAttempt\" |\n /** Delta between the current reference sequence number and the reference sequence number of the last summary */\n \"opsSinceLastSummary\" |\n /**\n * Delta in sum of op sizes between the current reference sequence number and the reference\n * sequence number of the last summary\n */\n \"opsSizesSinceLastSummary\" |\n /** Delta between the number of non-runtime ops since the last summary */\n \"nonRuntimeOpsSinceLastSummary\" |\n /** Wether or not this instance contains adjusted metrics due to missing op data */\n \"hasMissingOpData\" |\n /** Time it took to generate the summary tree and stats. */\n \"generateDuration\" |\n /** The handle returned by storage pointing to the uploaded summary tree. */\n \"handle\" |\n /** Time it took to upload the summary tree to storage. */\n \"uploadDuration\" |\n /** The client sequence number of the summarize op submitted for the summary. */\n \"clientSequenceNumber\" |\n /** Time it took for this summary to be acked after it was generated */\n \"ackWaitDuration\" |\n /** Reference sequence number of the ack/nack message */\n \"ackNackSequenceNumber\" |\n /** Actual sequence number of the summary op proposal. */\n \"summarySequenceNumber\" |\n /** Optional Retry-After time in seconds. If specified, the client should wait this many seconds before retrying. */\n \"nackRetryAfter\";\n\nexport type SummaryGeneratorTelemetry =\n Pick<ITelemetryProperties, SummaryGeneratorRequiredTelemetryProperties> &\n Partial<Pick<ITelemetryProperties, SummaryGeneratorOptionalTelemetryProperties>>;\n\nexport interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {\n /** Number of times the summarizer run. */\n summarizeCount: () => number;\n /** Number of successful attempts to summarize. */\n summarizerSuccessfulAttempts: () => number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryFormat.d.ts","sourceRoot":"","sources":["../src/summaryFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAe,MAAM,sCAAsC,CAAC;AAC7G,OAAO,
|
|
1
|
+
{"version":3,"file":"summaryFormat.d.ts","sourceRoot":"","sources":["../src/summaryFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAe,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAA+B,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE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,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,UAA+E,CAAC;AAE9G,eAAO,MAAM,2BAA2B,eAAe,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,yBAAyB,CAAC,eAAe,EAAE,qBAAqB,GAAG,IAAI,CAMtF;AAED,wBAAsB,2BAA2B,CAC7C,OAAO,EAAE,uBAAuB,EAChC,QAAQ,EAAE,aAAa,GACxB,OAAO,CAAC,4BAA4B,CAAC,CAWvC"}
|
package/lib/summaryFormat.js
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import { assert } from "@fluidframework/common-utils";
|
|
6
6
|
import { readAndParse } from "@fluidframework/driver-utils";
|
|
7
7
|
import { SummaryType } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { channelsTreeName } from "@fluidframework/runtime-definitions";
|
|
9
|
-
import { gcTreeKey } from "./garbageCollectionConstants";
|
|
8
|
+
import { channelsTreeName, gcTreeKey } from "@fluidframework/runtime-definitions";
|
|
10
9
|
export function getAttributesFormatVersion(attributes) {
|
|
11
10
|
if (attributes.summaryFormatVersion) {
|
|
12
11
|
/**
|
package/lib/summaryFormat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryFormat.js","sourceRoot":"","sources":["../src/summaryFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAA4C,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAAE,gBAAgB,EAAyB,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAyCzD,MAAM,UAAU,0BAA0B,CAAC,UAAwC;IAC/E,IAAI,UAAU,CAAC,oBAAoB,EAAE;QACjC;;;WAG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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 \"./garbageCollectionConstants\";\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
|
+
{"version":3,"file":"summaryFormat.js","sourceRoot":"","sources":["../src/summaryFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAA4C,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAC7G,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAyB,MAAM,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,CAAC;IACjD,OAAO,UAAU,CAAC;AACtB,CAAC","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, gcTreeKey, ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-runtime",
|
|
3
|
-
"version": "2.0.0-internal.2.
|
|
3
|
+
"version": "2.0.0-internal.2.3.1",
|
|
4
4
|
"description": "Fluid container runtime",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -65,20 +65,21 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
67
67
|
"@fluidframework/common-utils": "^1.0.0",
|
|
68
|
-
"@fluidframework/container-definitions": ">=2.0.0-internal.2.
|
|
69
|
-
"@fluidframework/container-runtime-definitions": ">=2.0.0-internal.2.
|
|
70
|
-
"@fluidframework/container-utils": ">=2.0.0-internal.2.
|
|
71
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.
|
|
72
|
-
"@fluidframework/datastore": ">=2.0.0-internal.2.
|
|
73
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.
|
|
74
|
-
"@fluidframework/driver-utils": ">=2.0.0-internal.2.
|
|
75
|
-
"@fluidframework/garbage-collector": ">=2.0.0-internal.2.
|
|
68
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
69
|
+
"@fluidframework/container-runtime-definitions": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
70
|
+
"@fluidframework/container-utils": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
71
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
72
|
+
"@fluidframework/datastore": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
73
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
74
|
+
"@fluidframework/driver-utils": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
75
|
+
"@fluidframework/garbage-collector": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
76
76
|
"@fluidframework/protocol-base": "^0.1038.2000",
|
|
77
77
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
78
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-internal.2.
|
|
79
|
-
"@fluidframework/runtime-utils": ">=2.0.0-internal.2.
|
|
80
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-internal.2.
|
|
78
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
79
|
+
"@fluidframework/runtime-utils": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
80
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
81
81
|
"double-ended-queue": "^2.1.0-0",
|
|
82
|
+
"events": "^3.1.0",
|
|
82
83
|
"lz4js": "^0.2.0",
|
|
83
84
|
"uuid": "^8.3.1"
|
|
84
85
|
},
|
|
@@ -86,15 +87,15 @@
|
|
|
86
87
|
"@fluid-tools/build-cli": "^0.7.0",
|
|
87
88
|
"@fluidframework/build-common": "^1.1.0",
|
|
88
89
|
"@fluidframework/build-tools": "^0.7.0",
|
|
89
|
-
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.0.0-internal.2.
|
|
90
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
91
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.
|
|
92
|
-
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.2.
|
|
90
|
+
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.0.0-internal.2.3.0",
|
|
91
|
+
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
92
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
93
|
+
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.2.3.1 <2.0.0-internal.3.0.0",
|
|
93
94
|
"@microsoft/api-extractor": "^7.22.2",
|
|
94
95
|
"@rushstack/eslint-config": "^2.5.1",
|
|
95
96
|
"@types/double-ended-queue": "^2.1.0",
|
|
97
|
+
"@types/events": "^3.0.0",
|
|
96
98
|
"@types/mocha": "^9.1.1",
|
|
97
|
-
"@types/node": "^14.18.0",
|
|
98
99
|
"@types/sinon": "^7.0.13",
|
|
99
100
|
"@types/uuid": "^8.3.0",
|
|
100
101
|
"concurrently": "^6.2.0",
|
|
@@ -108,8 +109,8 @@
|
|
|
108
109
|
"typescript": "~4.5.5"
|
|
109
110
|
},
|
|
110
111
|
"typeValidation": {
|
|
111
|
-
"version": "2.0.0-internal.2.
|
|
112
|
-
"baselineRange": "2.0.0-internal.2.
|
|
112
|
+
"version": "2.0.0-internal.2.3.1",
|
|
113
|
+
"baselineRange": "2.0.0-internal.2.3.0",
|
|
113
114
|
"broken": {}
|
|
114
115
|
}
|
|
115
116
|
}
|
package/src/batchTracker.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import EventEmitter from "events";
|
|
6
|
+
import { EventEmitter } from "events";
|
|
7
7
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
8
8
|
import { assert, performance } from "@fluidframework/common-utils";
|
|
9
9
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|