@fluidframework/container-runtime 2.0.2 → 2.1.0-276326
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/README.md +9 -0
- package/api-extractor/api-extractor.legacy.json +4 -0
- package/api-report/container-runtime.beta.api.md +0 -64
- package/api-report/{container-runtime.alpha.api.md → container-runtime.legacy.alpha.api.md} +0 -64
- package/api-report/container-runtime.public.api.md +0 -64
- package/container-runtime.test-files.tar +0 -0
- package/dist/blobManager.d.ts +1 -0
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +1 -0
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +1 -0
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +19 -2
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +14 -2
- package/dist/containerRuntime.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +4 -2
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +5 -2
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +11 -2
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +2 -3
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +0 -6
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +1 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/messageTypes.d.ts +1 -0
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +1 -0
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +4 -0
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +8 -4
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +18 -16
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +8 -6
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +18 -14
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +8 -0
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +2 -0
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -0
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +1 -0
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +29 -0
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +10 -0
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +1 -0
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +8 -0
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/lib/blobManager.d.ts +1 -0
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +1 -0
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +1 -0
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +19 -2
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +14 -2
- package/lib/containerRuntime.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +4 -2
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +6 -3
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +11 -2
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +1 -2
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +1 -7
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/messageTypes.d.ts +1 -0
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +1 -0
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +4 -0
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +8 -4
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +18 -16
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +8 -6
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +18 -14
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +8 -0
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +2 -0
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -0
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +1 -0
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +29 -0
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +10 -0
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +1 -0
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +8 -0
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/package.json +28 -92
- package/src/blobManager.ts +1 -0
- package/src/channelCollection.ts +1 -0
- package/src/containerRuntime.ts +23 -2
- package/src/gc/garbageCollection.ts +8 -2
- package/src/gc/gcConfigs.ts +6 -3
- package/src/gc/gcDefinitions.ts +11 -2
- package/src/gc/gcTelemetry.ts +0 -7
- package/src/gc/index.ts +0 -1
- package/src/messageTypes.ts +1 -0
- package/src/opLifecycle/batchManager.ts +4 -0
- package/src/opLifecycle/outbox.ts +19 -21
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +25 -20
- package/src/summary/documentSchema.ts +8 -0
- package/src/summary/orderedClientElection.ts +1 -0
- package/src/summary/runWhileConnectedCoordinator.ts +1 -0
- package/src/summary/summarizer.ts +1 -0
- package/src/summary/summarizerTypes.ts +29 -0
- package/src/summary/summaryCollection.ts +10 -0
- package/src/summary/summaryFormat.ts +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryCollection.js","sourceRoot":"","sources":["../../src/summary/summaryCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAKN,WAAW,GAEX,MAAM,6CAA6C,CAAC;AAmDrD,IAAK,YAKJ;AALD,WAAK,YAAY;IAChB,iDAAS,CAAA;IACT,yDAAa,CAAA;IACb,iDAAS,CAAA;IACT,oDAAW,CAAA;AACZ,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,MAAM,OAAO;IACL,MAAM,CAAC,WAAW,CAAC,QAAgB,EAAE,oBAA4B;QACvE,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IACpD,CAAC;IACM,MAAM,CAAC,YAAY,CAAC,EAAqB;QAC/C,+FAA+F;QAC/F,4EAA4E;QAC5E,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC;QAC5E,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACtB,OAAO,OAAO,CAAC;IAChB,CAAC;IAUD,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAED,YACiB,QAAgB,EAChB,oBAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAAQ;Q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AAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACpB,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport { IDisposable, IEvent } from \"@fluidframework/core-interfaces\";\nimport { assert, Deferred } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentMessage,\n\tISummaryAck,\n\tISummaryContent,\n\tISummaryNack,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Interface for summary op messages with typed contents.\n * @alpha\n */\nexport interface ISummaryOpMessage extends ISequencedDocumentMessage {\n\ttype: MessageType.Summarize;\n\tcontents: ISummaryContent;\n}\n\n/**\n * Interface for summary ack messages with typed contents.\n * @alpha\n */\nexport interface ISummaryAckMessage extends ISequencedDocumentMessage {\n\ttype: MessageType.SummaryAck;\n\tcontents: ISummaryAck;\n}\n\n/**\n * Interface for summary nack messages with typed contents.\n * @alpha\n */\nexport interface ISummaryNackMessage extends ISequencedDocumentMessage {\n\ttype: MessageType.SummaryNack;\n\tcontents: ISummaryNack;\n}\n\n/**\n * A single summary which can be tracked as it goes through its life cycle.\n * The life cycle is: Local to Broadcast to Acked/Nacked.\n * @alpha\n */\nexport interface ISummary {\n\treadonly clientId: string;\n\treadonly clientSequenceNumber: number;\n\twaitBroadcast(): Promise<ISummaryOpMessage>;\n\twaitAckNack(): Promise<ISummaryAckMessage | ISummaryNackMessage>;\n}\n\n/**\n * A single summary which has already been acked by the server.\n * @alpha\n */\nexport interface IAckedSummary {\n\treadonly summaryOp: ISummaryOpMessage;\n\treadonly summaryAck: ISummaryAckMessage;\n}\n\nenum SummaryState {\n\tLocal = 0,\n\tBroadcast = 1,\n\tAcked = 2,\n\tNacked = -1,\n}\n\nclass Summary implements ISummary {\n\tpublic static createLocal(clientId: string, clientSequenceNumber: number) {\n\t\treturn new Summary(clientId, clientSequenceNumber);\n\t}\n\tpublic static createFromOp(op: ISummaryOpMessage) {\n\t\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\t\tconst summary = new Summary(op.clientId as string, op.clientSequenceNumber);\n\t\tsummary.broadcast(op);\n\t\treturn summary;\n\t}\n\n\tprivate state = SummaryState.Local;\n\n\tprivate _summaryOp?: ISummaryOpMessage;\n\tprivate _summaryAckNack?: ISummaryAckMessage | ISummaryNackMessage;\n\n\tprivate readonly defSummaryOp = new Deferred<void>();\n\tprivate readonly defSummaryAck = new Deferred<void>();\n\n\tpublic get summaryOp() {\n\t\treturn this._summaryOp;\n\t}\n\tpublic get summaryAckNack() {\n\t\treturn this._summaryAckNack;\n\t}\n\n\tprivate constructor(\n\t\tpublic readonly clientId: string,\n\t\tpublic readonly clientSequenceNumber: number,\n\t) {}\n\n\tpublic hasBeenAcked(): this is IAckedSummary {\n\t\treturn this.state === SummaryState.Acked;\n\t}\n\n\tpublic broadcast(op: ISummaryOpMessage) {\n\t\tassert(\n\t\t\tthis.state === SummaryState.Local,\n\t\t\t0x175 /* \"Can only broadcast if summarizer starts in local state\" */,\n\t\t);\n\t\tthis._summaryOp = op;\n\t\tthis.defSummaryOp.resolve();\n\t\tthis.state = SummaryState.Broadcast;\n\t\treturn true;\n\t}\n\n\tpublic ackNack(op: ISummaryAckMessage | ISummaryNackMessage) {\n\t\tassert(\n\t\t\tthis.state === SummaryState.Broadcast,\n\t\t\t0x176 /* \"Can only ack/nack if summarizer is in broadcasting state\" */,\n\t\t);\n\t\tthis._summaryAckNack = op;\n\t\tthis.defSummaryAck.resolve();\n\t\tthis.state = op.type === MessageType.SummaryAck ? SummaryState.Acked : SummaryState.Nacked;\n\t\treturn true;\n\t}\n\n\tpublic async waitBroadcast(): Promise<ISummaryOpMessage> {\n\t\tawait this.defSummaryOp.promise;\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn this._summaryOp!;\n\t}\n\n\tpublic async waitAckNack(): Promise<ISummaryAckMessage | ISummaryNackMessage> {\n\t\tawait this.defSummaryAck.promise;\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn this._summaryAckNack!;\n\t}\n}\n\n/**\n * Watches summaries created by a specific client.\n * @alpha\n */\nexport interface IClientSummaryWatcher extends IDisposable {\n\twatchSummary(clientSequenceNumber: number): ISummary;\n\twaitFlushed(): Promise<IAckedSummary | undefined>;\n}\n\n/**\n * This class watches summaries created by a specific client.\n * It should be created and managed from a SummaryCollection.\n */\nclass ClientSummaryWatcher implements IClientSummaryWatcher {\n\t// key: clientSeqNum\n\tprivate readonly localSummaries = new Map<number, Summary>();\n\tprivate _disposed = false;\n\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly clientId: string,\n\t\tprivate readonly summaryCollection: SummaryCollection,\n\t) {}\n\n\t/**\n\t * Watches for a specific sent summary op.\n\t * @param clientSequenceNumber - client sequence number of sent summary op\n\t */\n\tpublic watchSummary(clientSequenceNumber: number): ISummary {\n\t\tlet summary = this.localSummaries.get(clientSequenceNumber);\n\t\tif (!summary) {\n\t\t\tsummary = Summary.createLocal(this.clientId, clientSequenceNumber);\n\t\t\tthis.localSummaries.set(summary.clientSequenceNumber, summary);\n\t\t}\n\t\treturn summary;\n\t}\n\n\t/**\n\t * Waits until all of the pending summaries in the underlying SummaryCollection\n\t * are acked/nacked.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/promise-function-async\n\tpublic waitFlushed() {\n\t\treturn this.summaryCollection.waitFlushed();\n\t}\n\n\t/**\n\t * Gets a watched summary or returns undefined if not watched.\n\t * @param clientSequenceNumber - client sequence number of sent summary op\n\t */\n\tpublic tryGetSummary(clientSequenceNumber: number) {\n\t\treturn this.localSummaries.get(clientSequenceNumber);\n\t}\n\n\t/**\n\t * Starts watching a summary made by this client.\n\t * @param summary - summary to start watching\n\t */\n\tpublic setSummary(summary: Summary) {\n\t\tthis.localSummaries.set(summary.clientSequenceNumber, summary);\n\t}\n\n\tpublic dispose() {\n\t\tthis.summaryCollection.removeWatcher(this.clientId);\n\t\tthis._disposed = true;\n\t}\n}\n/**\n * @alpha\n */\nexport type OpActionEventName =\n\t| MessageType.Summarize\n\t| MessageType.SummaryAck\n\t| MessageType.SummaryNack\n\t| \"default\";\n\n/**\n * @alpha\n */\nexport type OpActionEventListener = (op: ISequencedDocumentMessage) => void;\n\n/**\n * @alpha\n */\nexport interface ISummaryCollectionOpEvents extends IEvent {\n\t(event: OpActionEventName, listener: OpActionEventListener);\n}\n\n/**\n * Data structure that looks at the op stream to track summaries as they\n * are broadcast, acked and nacked.\n * It provides functionality for watching specific summaries.\n * @alpha\n */\nexport class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEvents> {\n\t// key: clientId\n\tprivate readonly summaryWatchers = new Map<string, ClientSummaryWatcher>();\n\t// key: summarySeqNum\n\tprivate readonly pendingSummaries = new Map<number, Summary>();\n\tprivate refreshWaitNextAck = new Deferred<void>();\n\n\tprivate lastSummaryTimestamp: number | undefined;\n\tprivate maxAckWaitTime: number | undefined;\n\tprivate pendingAckTimerTimeoutCallback: (() => void) | undefined;\n\tprivate lastAck: IAckedSummary | undefined;\n\n\tpublic get latestAck(): IAckedSummary | undefined {\n\t\treturn this.lastAck;\n\t}\n\n\tpublic emit(event: OpActionEventName, ...args: Parameters<OpActionEventListener>): boolean {\n\t\treturn super.emit(event, ...args);\n\t}\n\n\tpublic get opsSinceLastAck() {\n\t\treturn (\n\t\t\tthis.deltaManager.lastSequenceNumber -\n\t\t\t(this.lastAck?.summaryAck.sequenceNumber ?? this.deltaManager.initialSequenceNumber)\n\t\t);\n\t}\n\n\tpublic addOpListener(listener: () => void) {\n\t\tthis.deltaManager.on(\"op\", listener);\n\t}\n\n\tpublic removeOpListener(listener: () => void) {\n\t\tthis.deltaManager.off(\"op\", listener);\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tsuper();\n\t\tthis.deltaManager.on(\"op\", (op) => this.handleOp(op));\n\t}\n\n\t/**\n\t * Creates and returns a summary watcher for a specific client.\n\t * This will allow for local sent summaries to be better tracked.\n\t * @param clientId - client id for watcher\n\t */\n\tpublic createWatcher(clientId: string): IClientSummaryWatcher {\n\t\tconst watcher = new ClientSummaryWatcher(clientId, this);\n\t\tthis.summaryWatchers.set(clientId, watcher);\n\t\treturn watcher;\n\t}\n\n\tpublic removeWatcher(clientId: string) {\n\t\tthis.summaryWatchers.delete(clientId);\n\t}\n\n\tpublic setPendingAckTimerTimeoutCallback(\n\t\tmaxAckWaitTime: number,\n\t\ttimeoutCallback: () => void,\n\t) {\n\t\tthis.maxAckWaitTime = maxAckWaitTime;\n\t\tthis.pendingAckTimerTimeoutCallback = timeoutCallback;\n\t}\n\n\tpublic unsetPendingAckTimerTimeoutCallback() {\n\t\tthis.maxAckWaitTime = undefined;\n\t\tthis.pendingAckTimerTimeoutCallback = undefined;\n\t}\n\n\t/**\n\t * Returns a promise that resolves once all pending summary ops\n\t * have been acked or nacked.\n\t */\n\tpublic async waitFlushed(): Promise<IAckedSummary | undefined> {\n\t\twhile (this.pendingSummaries.size > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/promise-function-async\n\t\t\tconst promises = Array.from(this.pendingSummaries, ([, summary]) =>\n\t\t\t\tsummary.waitAckNack(),\n\t\t\t);\n\t\t\tawait Promise.all(promises);\n\t\t}\n\t\treturn this.lastAck;\n\t}\n\n\t/**\n\t * Returns a promise that resolves once a summary is acked that has a reference\n\t * sequence number greater than or equal to the passed in sequence number.\n\t * @param referenceSequenceNumber - reference sequence number to wait for\n\t * @returns The latest acked summary\n\t */\n\tpublic async waitSummaryAck(referenceSequenceNumber: number): Promise<IAckedSummary> {\n\t\twhile (\n\t\t\t!this.lastAck ||\n\t\t\tthis.lastAck.summaryOp.referenceSequenceNumber < referenceSequenceNumber\n\t\t) {\n\t\t\tawait this.refreshWaitNextAck.promise;\n\t\t}\n\t\treturn this.lastAck;\n\t}\n\n\tprivate parseContent(op: ISequencedDocumentMessage) {\n\t\t// back-compat: ADO #1385: Make this unconditional in the future,\n\t\t// when Container.processRemoteMessage stops parsing contents. That said, we should move to\n\t\t// listen for \"op\" events from ContainerRuntime, and parsing may not be required at all if\n\t\t// ContainerRuntime.process() would parse it for all types of ops.\n\t\t// Can make either of those changes only when LTS moves to a version that has no content\n\t\t// parsing in loader layer!\n\t\tif (typeof op.contents === \"string\") {\n\t\t\top.contents = JSON.parse(op.contents);\n\t\t}\n\t}\n\n\t/**\n\t * Handler for ops; only handles ops relating to summaries.\n\t * @param op - op message to handle\n\t */\n\tprivate handleOp(opArg: ISequencedDocumentMessage) {\n\t\tconst op = { ...opArg };\n\n\t\tswitch (op.type) {\n\t\t\tcase MessageType.Summarize:\n\t\t\t\tthis.parseContent(op);\n\t\t\t\treturn this.handleSummaryOp(op as ISummaryOpMessage);\n\t\t\tcase MessageType.SummaryAck:\n\t\t\tcase MessageType.SummaryNack:\n\t\t\t\t// Old files (prior to PR #10077) may not contain this info\n\t\t\t\t// back-compat: ADO #1385: remove cast when ISequencedDocumentMessage changes are propagated\n\t\t\t\tif ((op as any).data !== undefined) {\n\t\t\t\t\top.contents = JSON.parse((op as any).data);\n\t\t\t\t} else {\n\t\t\t\t\tthis.parseContent(op);\n\t\t\t\t}\n\t\t\t\treturn op.type === MessageType.SummaryAck\n\t\t\t\t\t? this.handleSummaryAck(op as ISummaryAckMessage)\n\t\t\t\t\t: this.handleSummaryNack(op as ISummaryNackMessage);\n\t\t\tdefault: {\n\t\t\t\t// If the difference between timestamp of current op and last summary op is greater than\n\t\t\t\t// the maxAckWaitTime, then we need to inform summarizer to not wait and summarize\n\t\t\t\t// immediately as we have already waited for maxAckWaitTime.\n\t\t\t\tconst lastOpTimestamp = op.timestamp;\n\t\t\t\tif (\n\t\t\t\t\tthis.lastSummaryTimestamp !== undefined &&\n\t\t\t\t\tthis.maxAckWaitTime !== undefined &&\n\t\t\t\t\tlastOpTimestamp - this.lastSummaryTimestamp >= this.maxAckWaitTime\n\t\t\t\t) {\n\t\t\t\t\tthis.pendingAckTimerTimeoutCallback?.();\n\t\t\t\t}\n\t\t\t\tthis.emit(\"default\", op);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate handleSummaryOp(op: ISummaryOpMessage) {\n\t\tlet summary: Summary | undefined;\n\n\t\t// Check if summary already being watched, broadcast if so\n\t\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\t\tconst watcher = this.summaryWatchers.get(op.clientId as string);\n\t\tif (watcher) {\n\t\t\tsummary = watcher.tryGetSummary(op.clientSequenceNumber);\n\t\t\tif (summary) {\n\t\t\t\tsummary.broadcast(op);\n\t\t\t}\n\t\t}\n\n\t\t// If not watched, create from op\n\t\tif (!summary) {\n\t\t\tsummary = Summary.createFromOp(op);\n\t\t\tif (watcher) {\n\t\t\t\twatcher.setSummary(summary);\n\t\t\t}\n\t\t}\n\t\tthis.pendingSummaries.set(op.sequenceNumber, summary);\n\t\tthis.lastSummaryTimestamp = op.timestamp;\n\t\tthis.emit(MessageType.Summarize, op);\n\t}\n\n\tprivate handleSummaryAck(op: ISummaryAckMessage) {\n\t\tconst seq = op.contents.summaryProposal.summarySequenceNumber;\n\t\tconst summary = this.pendingSummaries.get(seq);\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain is not logically equivalent\n\t\tif (!summary || summary.summaryOp === undefined) {\n\t\t\t// Summary ack without an op should be rare. We could fetch the\n\t\t\t// reference sequence number from the snapshot, but instead we\n\t\t\t// will not emit this ack. It should be the case that the summary\n\t\t\t// op that this ack is for is earlier than this file was loaded\n\t\t\t// from. i.e. initialSequenceNumber > summarySequenceNumber.\n\t\t\t// We really don't care about it for now, since it is older than\n\t\t\t// the one we loaded from.\n\t\t\tif (seq > this.deltaManager.initialSequenceNumber) {\n\t\t\t\t// Potential causes for it to be later than our initialSequenceNumber\n\t\t\t\t// are that the summaryOp was nacked then acked, double-acked, or\n\t\t\t\t// the summarySequenceNumber is incorrect.\n\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"SummaryAckWithoutOp\",\n\t\t\t\t\tsequenceNumber: op.sequenceNumber, // summary ack seq #\n\t\t\t\t\tsummarySequenceNumber: seq, // missing summary seq #\n\t\t\t\t\tinitialSequenceNumber: this.deltaManager.initialSequenceNumber,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsummary.ackNack(op);\n\t\tthis.pendingSummaries.delete(seq);\n\n\t\t// Track latest ack\n\t\tif (\n\t\t\t!this.lastAck ||\n\t\t\tseq > this.lastAck.summaryAck.contents.summaryProposal.summarySequenceNumber\n\t\t) {\n\t\t\tthis.lastAck = {\n\t\t\t\tsummaryOp: summary.summaryOp,\n\t\t\t\tsummaryAck: op,\n\t\t\t};\n\t\t\tthis.refreshWaitNextAck.resolve();\n\t\t\tthis.refreshWaitNextAck = new Deferred<void>();\n\t\t\tthis.emit(MessageType.SummaryAck, op);\n\t\t}\n\t}\n\n\tprivate handleSummaryNack(op: ISummaryNackMessage) {\n\t\tconst seq = op.contents.summaryProposal.summarySequenceNumber;\n\t\tconst summary = this.pendingSummaries.get(seq);\n\t\tif (summary) {\n\t\t\tsummary.ackNack(op);\n\t\t\tthis.pendingSummaries.delete(seq);\n\t\t\tthis.emit(MessageType.SummaryNack, op);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"summaryCollection.js","sourceRoot":"","sources":["../../src/summary/summaryCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAKN,WAAW,GAEX,MAAM,6CAA6C,CAAC;AAwDrD,IAAK,YAKJ;AALD,WAAK,YAAY;IAChB,iDAAS,CAAA;IACT,yDAAa,CAAA;IACb,iDAAS,CAAA;IACT,oDAAW,CAAA;AACZ,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,MAAM,OAAO;IACL,MAAM,CAAC,WAAW,CAAC,QAAgB,EAAE,oBAA4B;QACvE,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IACpD,CAAC;IACM,MAAM,CAAC,YAAY,CAAC,EAAqB;QAC/C,+FAA+F;QAC/F,4EAA4E;QAC5E,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC;QAC5E,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACtB,OAAO,OAAO,CAAC;IAChB,CAAC;IAUD,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAED,YACiB,QAAgB,EAChB,oBAA4B;QAD5B,aAAQ,GAAR,QAAQ,CAAQ;QAChB,yBAAoB,GAApB,oBAAoB,CAAQ;QAjBrC,UAAK,GAAG,YAAY,CAAC,KAAK,CA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CAAC;YACb,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACpB,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport { IDisposable, IEvent } from \"@fluidframework/core-interfaces\";\nimport { assert, Deferred } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentMessage,\n\tISummaryAck,\n\tISummaryContent,\n\tISummaryNack,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Interface for summary op messages with typed contents.\n * @legacy\n * @alpha\n */\nexport interface ISummaryOpMessage extends ISequencedDocumentMessage {\n\ttype: MessageType.Summarize;\n\tcontents: ISummaryContent;\n}\n\n/**\n * Interface for summary ack messages with typed contents.\n * @legacy\n * @alpha\n */\nexport interface ISummaryAckMessage extends ISequencedDocumentMessage {\n\ttype: MessageType.SummaryAck;\n\tcontents: ISummaryAck;\n}\n\n/**\n * Interface for summary nack messages with typed contents.\n * @legacy\n * @alpha\n */\nexport interface ISummaryNackMessage extends ISequencedDocumentMessage {\n\ttype: MessageType.SummaryNack;\n\tcontents: ISummaryNack;\n}\n\n/**\n * A single summary which can be tracked as it goes through its life cycle.\n * The life cycle is: Local to Broadcast to Acked/Nacked.\n * @legacy\n * @alpha\n */\nexport interface ISummary {\n\treadonly clientId: string;\n\treadonly clientSequenceNumber: number;\n\twaitBroadcast(): Promise<ISummaryOpMessage>;\n\twaitAckNack(): Promise<ISummaryAckMessage | ISummaryNackMessage>;\n}\n\n/**\n * A single summary which has already been acked by the server.\n * @legacy\n * @alpha\n */\nexport interface IAckedSummary {\n\treadonly summaryOp: ISummaryOpMessage;\n\treadonly summaryAck: ISummaryAckMessage;\n}\n\nenum SummaryState {\n\tLocal = 0,\n\tBroadcast = 1,\n\tAcked = 2,\n\tNacked = -1,\n}\n\nclass Summary implements ISummary {\n\tpublic static createLocal(clientId: string, clientSequenceNumber: number) {\n\t\treturn new Summary(clientId, clientSequenceNumber);\n\t}\n\tpublic static createFromOp(op: ISummaryOpMessage) {\n\t\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\t\tconst summary = new Summary(op.clientId as string, op.clientSequenceNumber);\n\t\tsummary.broadcast(op);\n\t\treturn summary;\n\t}\n\n\tprivate state = SummaryState.Local;\n\n\tprivate _summaryOp?: ISummaryOpMessage;\n\tprivate _summaryAckNack?: ISummaryAckMessage | ISummaryNackMessage;\n\n\tprivate readonly defSummaryOp = new Deferred<void>();\n\tprivate readonly defSummaryAck = new Deferred<void>();\n\n\tpublic get summaryOp() {\n\t\treturn this._summaryOp;\n\t}\n\tpublic get summaryAckNack() {\n\t\treturn this._summaryAckNack;\n\t}\n\n\tprivate constructor(\n\t\tpublic readonly clientId: string,\n\t\tpublic readonly clientSequenceNumber: number,\n\t) {}\n\n\tpublic hasBeenAcked(): this is IAckedSummary {\n\t\treturn this.state === SummaryState.Acked;\n\t}\n\n\tpublic broadcast(op: ISummaryOpMessage) {\n\t\tassert(\n\t\t\tthis.state === SummaryState.Local,\n\t\t\t0x175 /* \"Can only broadcast if summarizer starts in local state\" */,\n\t\t);\n\t\tthis._summaryOp = op;\n\t\tthis.defSummaryOp.resolve();\n\t\tthis.state = SummaryState.Broadcast;\n\t\treturn true;\n\t}\n\n\tpublic ackNack(op: ISummaryAckMessage | ISummaryNackMessage) {\n\t\tassert(\n\t\t\tthis.state === SummaryState.Broadcast,\n\t\t\t0x176 /* \"Can only ack/nack if summarizer is in broadcasting state\" */,\n\t\t);\n\t\tthis._summaryAckNack = op;\n\t\tthis.defSummaryAck.resolve();\n\t\tthis.state = op.type === MessageType.SummaryAck ? SummaryState.Acked : SummaryState.Nacked;\n\t\treturn true;\n\t}\n\n\tpublic async waitBroadcast(): Promise<ISummaryOpMessage> {\n\t\tawait this.defSummaryOp.promise;\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn this._summaryOp!;\n\t}\n\n\tpublic async waitAckNack(): Promise<ISummaryAckMessage | ISummaryNackMessage> {\n\t\tawait this.defSummaryAck.promise;\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn this._summaryAckNack!;\n\t}\n}\n\n/**\n * Watches summaries created by a specific client.\n * @legacy\n * @alpha\n */\nexport interface IClientSummaryWatcher extends IDisposable {\n\twatchSummary(clientSequenceNumber: number): ISummary;\n\twaitFlushed(): Promise<IAckedSummary | undefined>;\n}\n\n/**\n * This class watches summaries created by a specific client.\n * It should be created and managed from a SummaryCollection.\n */\nclass ClientSummaryWatcher implements IClientSummaryWatcher {\n\t// key: clientSeqNum\n\tprivate readonly localSummaries = new Map<number, Summary>();\n\tprivate _disposed = false;\n\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly clientId: string,\n\t\tprivate readonly summaryCollection: SummaryCollection,\n\t) {}\n\n\t/**\n\t * Watches for a specific sent summary op.\n\t * @param clientSequenceNumber - client sequence number of sent summary op\n\t */\n\tpublic watchSummary(clientSequenceNumber: number): ISummary {\n\t\tlet summary = this.localSummaries.get(clientSequenceNumber);\n\t\tif (!summary) {\n\t\t\tsummary = Summary.createLocal(this.clientId, clientSequenceNumber);\n\t\t\tthis.localSummaries.set(summary.clientSequenceNumber, summary);\n\t\t}\n\t\treturn summary;\n\t}\n\n\t/**\n\t * Waits until all of the pending summaries in the underlying SummaryCollection\n\t * are acked/nacked.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/promise-function-async\n\tpublic waitFlushed() {\n\t\treturn this.summaryCollection.waitFlushed();\n\t}\n\n\t/**\n\t * Gets a watched summary or returns undefined if not watched.\n\t * @param clientSequenceNumber - client sequence number of sent summary op\n\t */\n\tpublic tryGetSummary(clientSequenceNumber: number) {\n\t\treturn this.localSummaries.get(clientSequenceNumber);\n\t}\n\n\t/**\n\t * Starts watching a summary made by this client.\n\t * @param summary - summary to start watching\n\t */\n\tpublic setSummary(summary: Summary) {\n\t\tthis.localSummaries.set(summary.clientSequenceNumber, summary);\n\t}\n\n\tpublic dispose() {\n\t\tthis.summaryCollection.removeWatcher(this.clientId);\n\t\tthis._disposed = true;\n\t}\n}\n/**\n * @legacy\n * @alpha\n */\nexport type OpActionEventName =\n\t| MessageType.Summarize\n\t| MessageType.SummaryAck\n\t| MessageType.SummaryNack\n\t| \"default\";\n\n/**\n * @legacy\n * @alpha\n */\nexport type OpActionEventListener = (op: ISequencedDocumentMessage) => void;\n\n/**\n * @legacy\n * @alpha\n */\nexport interface ISummaryCollectionOpEvents extends IEvent {\n\t(event: OpActionEventName, listener: OpActionEventListener);\n}\n\n/**\n * Data structure that looks at the op stream to track summaries as they\n * are broadcast, acked and nacked.\n * It provides functionality for watching specific summaries.\n * @legacy\n * @alpha\n */\nexport class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEvents> {\n\t// key: clientId\n\tprivate readonly summaryWatchers = new Map<string, ClientSummaryWatcher>();\n\t// key: summarySeqNum\n\tprivate readonly pendingSummaries = new Map<number, Summary>();\n\tprivate refreshWaitNextAck = new Deferred<void>();\n\n\tprivate lastSummaryTimestamp: number | undefined;\n\tprivate maxAckWaitTime: number | undefined;\n\tprivate pendingAckTimerTimeoutCallback: (() => void) | undefined;\n\tprivate lastAck: IAckedSummary | undefined;\n\n\tpublic get latestAck(): IAckedSummary | undefined {\n\t\treturn this.lastAck;\n\t}\n\n\tpublic emit(event: OpActionEventName, ...args: Parameters<OpActionEventListener>): boolean {\n\t\treturn super.emit(event, ...args);\n\t}\n\n\tpublic get opsSinceLastAck() {\n\t\treturn (\n\t\t\tthis.deltaManager.lastSequenceNumber -\n\t\t\t(this.lastAck?.summaryAck.sequenceNumber ?? this.deltaManager.initialSequenceNumber)\n\t\t);\n\t}\n\n\tpublic addOpListener(listener: () => void) {\n\t\tthis.deltaManager.on(\"op\", listener);\n\t}\n\n\tpublic removeOpListener(listener: () => void) {\n\t\tthis.deltaManager.off(\"op\", listener);\n\t}\n\n\tpublic constructor(\n\t\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tsuper();\n\t\tthis.deltaManager.on(\"op\", (op) => this.handleOp(op));\n\t}\n\n\t/**\n\t * Creates and returns a summary watcher for a specific client.\n\t * This will allow for local sent summaries to be better tracked.\n\t * @param clientId - client id for watcher\n\t */\n\tpublic createWatcher(clientId: string): IClientSummaryWatcher {\n\t\tconst watcher = new ClientSummaryWatcher(clientId, this);\n\t\tthis.summaryWatchers.set(clientId, watcher);\n\t\treturn watcher;\n\t}\n\n\tpublic removeWatcher(clientId: string) {\n\t\tthis.summaryWatchers.delete(clientId);\n\t}\n\n\tpublic setPendingAckTimerTimeoutCallback(\n\t\tmaxAckWaitTime: number,\n\t\ttimeoutCallback: () => void,\n\t) {\n\t\tthis.maxAckWaitTime = maxAckWaitTime;\n\t\tthis.pendingAckTimerTimeoutCallback = timeoutCallback;\n\t}\n\n\tpublic unsetPendingAckTimerTimeoutCallback() {\n\t\tthis.maxAckWaitTime = undefined;\n\t\tthis.pendingAckTimerTimeoutCallback = undefined;\n\t}\n\n\t/**\n\t * Returns a promise that resolves once all pending summary ops\n\t * have been acked or nacked.\n\t */\n\tpublic async waitFlushed(): Promise<IAckedSummary | undefined> {\n\t\twhile (this.pendingSummaries.size > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/promise-function-async\n\t\t\tconst promises = Array.from(this.pendingSummaries, ([, summary]) =>\n\t\t\t\tsummary.waitAckNack(),\n\t\t\t);\n\t\t\tawait Promise.all(promises);\n\t\t}\n\t\treturn this.lastAck;\n\t}\n\n\t/**\n\t * Returns a promise that resolves once a summary is acked that has a reference\n\t * sequence number greater than or equal to the passed in sequence number.\n\t * @param referenceSequenceNumber - reference sequence number to wait for\n\t * @returns The latest acked summary\n\t */\n\tpublic async waitSummaryAck(referenceSequenceNumber: number): Promise<IAckedSummary> {\n\t\twhile (\n\t\t\t!this.lastAck ||\n\t\t\tthis.lastAck.summaryOp.referenceSequenceNumber < referenceSequenceNumber\n\t\t) {\n\t\t\tawait this.refreshWaitNextAck.promise;\n\t\t}\n\t\treturn this.lastAck;\n\t}\n\n\tprivate parseContent(op: ISequencedDocumentMessage) {\n\t\t// back-compat: ADO #1385: Make this unconditional in the future,\n\t\t// when Container.processRemoteMessage stops parsing contents. That said, we should move to\n\t\t// listen for \"op\" events from ContainerRuntime, and parsing may not be required at all if\n\t\t// ContainerRuntime.process() would parse it for all types of ops.\n\t\t// Can make either of those changes only when LTS moves to a version that has no content\n\t\t// parsing in loader layer!\n\t\tif (typeof op.contents === \"string\") {\n\t\t\top.contents = JSON.parse(op.contents);\n\t\t}\n\t}\n\n\t/**\n\t * Handler for ops; only handles ops relating to summaries.\n\t * @param op - op message to handle\n\t */\n\tprivate handleOp(opArg: ISequencedDocumentMessage) {\n\t\tconst op = { ...opArg };\n\n\t\tswitch (op.type) {\n\t\t\tcase MessageType.Summarize:\n\t\t\t\tthis.parseContent(op);\n\t\t\t\treturn this.handleSummaryOp(op as ISummaryOpMessage);\n\t\t\tcase MessageType.SummaryAck:\n\t\t\tcase MessageType.SummaryNack:\n\t\t\t\t// Old files (prior to PR #10077) may not contain this info\n\t\t\t\t// back-compat: ADO #1385: remove cast when ISequencedDocumentMessage changes are propagated\n\t\t\t\tif ((op as any).data !== undefined) {\n\t\t\t\t\top.contents = JSON.parse((op as any).data);\n\t\t\t\t} else {\n\t\t\t\t\tthis.parseContent(op);\n\t\t\t\t}\n\t\t\t\treturn op.type === MessageType.SummaryAck\n\t\t\t\t\t? this.handleSummaryAck(op as ISummaryAckMessage)\n\t\t\t\t\t: this.handleSummaryNack(op as ISummaryNackMessage);\n\t\t\tdefault: {\n\t\t\t\t// If the difference between timestamp of current op and last summary op is greater than\n\t\t\t\t// the maxAckWaitTime, then we need to inform summarizer to not wait and summarize\n\t\t\t\t// immediately as we have already waited for maxAckWaitTime.\n\t\t\t\tconst lastOpTimestamp = op.timestamp;\n\t\t\t\tif (\n\t\t\t\t\tthis.lastSummaryTimestamp !== undefined &&\n\t\t\t\t\tthis.maxAckWaitTime !== undefined &&\n\t\t\t\t\tlastOpTimestamp - this.lastSummaryTimestamp >= this.maxAckWaitTime\n\t\t\t\t) {\n\t\t\t\t\tthis.pendingAckTimerTimeoutCallback?.();\n\t\t\t\t}\n\t\t\t\tthis.emit(\"default\", op);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate handleSummaryOp(op: ISummaryOpMessage) {\n\t\tlet summary: Summary | undefined;\n\n\t\t// Check if summary already being watched, broadcast if so\n\t\t// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n\t\tconst watcher = this.summaryWatchers.get(op.clientId as string);\n\t\tif (watcher) {\n\t\t\tsummary = watcher.tryGetSummary(op.clientSequenceNumber);\n\t\t\tif (summary) {\n\t\t\t\tsummary.broadcast(op);\n\t\t\t}\n\t\t}\n\n\t\t// If not watched, create from op\n\t\tif (!summary) {\n\t\t\tsummary = Summary.createFromOp(op);\n\t\t\tif (watcher) {\n\t\t\t\twatcher.setSummary(summary);\n\t\t\t}\n\t\t}\n\t\tthis.pendingSummaries.set(op.sequenceNumber, summary);\n\t\tthis.lastSummaryTimestamp = op.timestamp;\n\t\tthis.emit(MessageType.Summarize, op);\n\t}\n\n\tprivate handleSummaryAck(op: ISummaryAckMessage) {\n\t\tconst seq = op.contents.summaryProposal.summarySequenceNumber;\n\t\tconst summary = this.pendingSummaries.get(seq);\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain is not logically equivalent\n\t\tif (!summary || summary.summaryOp === undefined) {\n\t\t\t// Summary ack without an op should be rare. We could fetch the\n\t\t\t// reference sequence number from the snapshot, but instead we\n\t\t\t// will not emit this ack. It should be the case that the summary\n\t\t\t// op that this ack is for is earlier than this file was loaded\n\t\t\t// from. i.e. initialSequenceNumber > summarySequenceNumber.\n\t\t\t// We really don't care about it for now, since it is older than\n\t\t\t// the one we loaded from.\n\t\t\tif (seq > this.deltaManager.initialSequenceNumber) {\n\t\t\t\t// Potential causes for it to be later than our initialSequenceNumber\n\t\t\t\t// are that the summaryOp was nacked then acked, double-acked, or\n\t\t\t\t// the summarySequenceNumber is incorrect.\n\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"SummaryAckWithoutOp\",\n\t\t\t\t\tsequenceNumber: op.sequenceNumber, // summary ack seq #\n\t\t\t\t\tsummarySequenceNumber: seq, // missing summary seq #\n\t\t\t\t\tinitialSequenceNumber: this.deltaManager.initialSequenceNumber,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsummary.ackNack(op);\n\t\tthis.pendingSummaries.delete(seq);\n\n\t\t// Track latest ack\n\t\tif (\n\t\t\t!this.lastAck ||\n\t\t\tseq > this.lastAck.summaryAck.contents.summaryProposal.summarySequenceNumber\n\t\t) {\n\t\t\tthis.lastAck = {\n\t\t\t\tsummaryOp: summary.summaryOp,\n\t\t\t\tsummaryAck: op,\n\t\t\t};\n\t\t\tthis.refreshWaitNextAck.resolve();\n\t\t\tthis.refreshWaitNextAck = new Deferred<void>();\n\t\t\tthis.emit(MessageType.SummaryAck, op);\n\t\t}\n\t}\n\n\tprivate handleSummaryNack(op: ISummaryNackMessage) {\n\t\tconst seq = op.contents.summaryProposal.summarySequenceNumber;\n\t\tconst summary = this.pendingSummaries.get(seq);\n\t\tif (summary) {\n\t\t\tsummary.ackNack(op);\n\t\t\tthis.pendingSummaries.delete(seq);\n\t\t\tthis.emit(MessageType.SummaryNack, op);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -8,11 +8,13 @@ import { IGCMetadata } from "../gc/index.js";
|
|
|
8
8
|
import { IDocumentSchema } from "./documentSchema.js";
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
11
|
+
* @legacy
|
|
11
12
|
* @alpha
|
|
12
13
|
*/
|
|
13
14
|
export type OmitAttributesVersions<T> = Omit<T, "snapshotFormatVersion" | "summaryFormatVersion">;
|
|
14
15
|
/**
|
|
15
16
|
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
17
|
+
* @legacy
|
|
16
18
|
* @alpha
|
|
17
19
|
*/
|
|
18
20
|
export interface IFluidDataStoreAttributes0 {
|
|
@@ -28,6 +30,7 @@ export interface IFluidDataStoreAttributes0 {
|
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
33
|
+
* @legacy
|
|
31
34
|
* @alpha
|
|
32
35
|
*/
|
|
33
36
|
export interface IFluidDataStoreAttributes1 extends OmitAttributesVersions<IFluidDataStoreAttributes0> {
|
|
@@ -36,6 +39,7 @@ export interface IFluidDataStoreAttributes1 extends OmitAttributesVersions<IFlui
|
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
41
|
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
42
|
+
* @legacy
|
|
39
43
|
* @alpha
|
|
40
44
|
*/
|
|
41
45
|
export interface IFluidDataStoreAttributes2 extends OmitAttributesVersions<IFluidDataStoreAttributes1> {
|
|
@@ -57,6 +61,7 @@ export interface IFluidDataStoreAttributes2 extends OmitAttributesVersions<IFlui
|
|
|
57
61
|
*
|
|
58
62
|
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
59
63
|
*
|
|
64
|
+
* @legacy
|
|
60
65
|
* @alpha
|
|
61
66
|
*
|
|
62
67
|
*/
|
|
@@ -65,6 +70,7 @@ export type WriteFluidDataStoreAttributes = IFluidDataStoreAttributes1 | IFluidD
|
|
|
65
70
|
export declare function getAttributesFormatVersion(attributes: ReadFluidDataStoreAttributes): number;
|
|
66
71
|
export declare function hasIsolatedChannels(attributes: ReadFluidDataStoreAttributes): boolean;
|
|
67
72
|
/**
|
|
73
|
+
* @legacy
|
|
68
74
|
* @alpha
|
|
69
75
|
*/
|
|
70
76
|
export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {
|
|
@@ -82,6 +88,7 @@ export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGC
|
|
|
82
88
|
readonly documentSchema?: IDocumentSchema;
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
91
|
+
* @legacy
|
|
85
92
|
* @alpha
|
|
86
93
|
*/
|
|
87
94
|
export interface ICreateContainerMetadata {
|
|
@@ -92,6 +99,7 @@ export interface ICreateContainerMetadata {
|
|
|
92
99
|
}
|
|
93
100
|
/**
|
|
94
101
|
* The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary.
|
|
102
|
+
* @legacy
|
|
95
103
|
* @alpha
|
|
96
104
|
*/
|
|
97
105
|
export type ISummaryMetadataMessage = Pick<ISequencedDocumentMessage, "clientId" | "clientSequenceNumber" | "minimumSequenceNumber" | "referenceSequenceNumber" | "sequenceNumber" | "timestamp" | "type">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryFormat.d.ts","sourceRoot":"","sources":["../../src/summary/summaryFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,uBAAuB,EACvB,aAAa,EACb,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AAKrD,OAAO,EACN,qBAAqB,EAGrB,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CA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AAM,UAAU,uBAAuB,CAAC,QAAoC;IAC3E,OAAO,CAAC,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC;AACxD,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,gBAAgB;IAChB,UAAU;IACV,kBAAkB;IAClB,aAAa;IACb,SAAS;IACT,oBAAoB;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,YAAY,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,yBAAyB,CAAC,eAAsC;IAC/E,eAAe,CAAC,OAAO,GAAG;QACzB,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,eAAe,CAAC,OAAO,EAAE;KACrD,CAAC;IACF,eAAe,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAChD,OAAgC,EAChC,QAAuB;IAEvB,MAAM,UAAU,GAAG,MAAM,YAAY,CACpC,OAAO,EACP,QAAQ,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAC3C,CAAC;IACF,qFAAqF;IACrF,mGAAmG;IACnG,uFAAuF;IACvF,0FAA0F;IAC1F,MAAM,aAAa,GAAG,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC7D,MAAM,CAAC,aAAa,GAAG,CAAC,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACvE,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { SummaryType } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentStorageService,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tblobHeadersBlobName as blobNameForBlobHeaders,\n\treadAndParse,\n} from \"@fluidframework/driver-utils/internal\";\nimport {\n\tISummaryTreeWithStats,\n\tchannelsTreeName,\n\tgcTreeKey,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport { IGCMetadata } from \"../gc/index.js\";\n\nimport { IDocumentSchema } from \"./documentSchema.js\";\n\n/**\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n * @alpha\n */\nexport type OmitAttributesVersions<T> = Omit<\n\tT,\n\t\"snapshotFormatVersion\" | \"summaryFormatVersion\"\n>;\n\n/**\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n * @alpha\n */\nexport interface IFluidDataStoreAttributes0 {\n\treadonly snapshotFormatVersion?: undefined;\n\treadonly summaryFormatVersion?: undefined;\n\tpkg: string;\n\t/**\n\t * This tells whether a data store is root. Root data stores are never collected.\n\t * Non-root data stores may be collected if they are not used. If this is not present, default it to\n\t * true. This will ensure that older data stores are incorrectly collected.\n\t */\n\treadonly isRootDataStore?: boolean;\n}\n\n/**\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n * @alpha\n */\nexport interface IFluidDataStoreAttributes1\n\textends OmitAttributesVersions<IFluidDataStoreAttributes0> {\n\treadonly snapshotFormatVersion: \"0.1\";\n\treadonly summaryFormatVersion?: undefined;\n}\n\n/**\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n * @alpha\n */\nexport interface IFluidDataStoreAttributes2\n\textends OmitAttributesVersions<IFluidDataStoreAttributes1> {\n\t/** Switch from snapshotFormatVersion to summaryFormatVersion */\n\treadonly snapshotFormatVersion?: undefined;\n\treadonly summaryFormatVersion: 2;\n\t/**\n\t * True if channels are not isolated in .channels subtrees, otherwise isolated.\n\t * This is required in both datastore attributes as well as the root container,\n\t * because reused summary handles may cause different format versions in each\n\t * datastore subtree within the summary.\n\t */\n\treadonly 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 *\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n *\n * @alpha\n *\n */\nexport type ReadFluidDataStoreAttributes =\n\t| IFluidDataStoreAttributes0\n\t| IFluidDataStoreAttributes1\n\t| IFluidDataStoreAttributes2;\nexport type WriteFluidDataStoreAttributes =\n\t| IFluidDataStoreAttributes1\n\t| IFluidDataStoreAttributes2;\n\nexport function getAttributesFormatVersion(attributes: ReadFluidDataStoreAttributes): number {\n\tif (attributes.summaryFormatVersion) {\n\t\t/**\n\t\t * Version 2+: Introduces .channels trees for isolation of\n\t\t * channel trees from data store objects.\n\t\t */\n\t\treturn attributes.summaryFormatVersion;\n\t} else if (attributes.snapshotFormatVersion === \"0.1\") {\n\t\t/**\n\t\t * Version 1: from this version the pkg within the data store\n\t\t * attributes blob is a JSON array rather than a string.\n\t\t */\n\t\treturn 1;\n\t}\n\t/**\n\t * Version 0: format version is missing from summary.\n\t * This indicates it is an older version.\n\t */\n\treturn 0;\n}\n\nexport function hasIsolatedChannels(attributes: ReadFluidDataStoreAttributes): boolean {\n\treturn !!attributes.summaryFormatVersion && !attributes.disableIsolatedChannels;\n}\n\n/**\n * @alpha\n */\nexport interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {\n\treadonly summaryFormatVersion: 1;\n\t/** @deprecated - used by old (prior to 2.0 RC3) runtimes */\n\treadonly message?: ISummaryMetadataMessage;\n\t/** The last message processed at the time of summary. Only primitive property types are added to the summary. */\n\treadonly lastMessage?: ISummaryMetadataMessage;\n\t/** True if channels are not isolated in .channels subtrees, otherwise isolated. */\n\treadonly disableIsolatedChannels?: true;\n\t/** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */\n\treadonly summaryNumber?: number;\n\t/** GUID to identify a document in telemetry */\n\treadonly telemetryDocumentId?: string;\n\n\treadonly documentSchema?: IDocumentSchema;\n}\n\n/**\n * @alpha\n */\nexport interface ICreateContainerMetadata {\n\t/** Runtime version of the container when it was first created */\n\tcreateContainerRuntimeVersion?: string;\n\t/** Timestamp of the container when it was first created */\n\tcreateContainerTimestamp?: number;\n}\n\n/**\n * The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary.\n * @alpha\n */\nexport type ISummaryMetadataMessage = Pick<\n\tISequencedDocumentMessage,\n\t| \"clientId\"\n\t| \"clientSequenceNumber\"\n\t| \"minimumSequenceNumber\"\n\t| \"referenceSequenceNumber\"\n\t| \"sequenceNumber\"\n\t| \"timestamp\"\n\t| \"type\"\n>;\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\tmessage?: ISequencedDocumentMessage,\n): ISummaryMetadataMessage | undefined =>\n\tmessage === undefined\n\t\t? undefined\n\t\t: {\n\t\t\t\tclientId: message.clientId,\n\t\t\t\tclientSequenceNumber: message.clientSequenceNumber,\n\t\t\t\tminimumSequenceNumber: message.minimumSequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tsequenceNumber: message.sequenceNumber,\n\t\t\t\ttimestamp: message.timestamp,\n\t\t\t\ttype: message.type,\n\t\t\t};\n\nexport function getMetadataFormatVersion(metadata?: IContainerRuntimeMetadata): number {\n\t/**\n\t * Version 2+: Introduces runtime sequence number for data verification.\n\t *\n\t * Version 1+: Introduces .metadata blob and .channels trees for isolation of\n\t * data store trees from container-level objects.\n\t * Also introduces enableGC option stored in the summary.\n\t *\n\t * Version 0: metadata blob missing; format version is missing from summary.\n\t * This indicates it is an older version.\n\t */\n\treturn 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\";\nexport const idCompressorBlobName = \".idCompressor\";\nexport const blobHeadersBlobName = blobNameForBlobHeaders;\n\nexport function rootHasIsolatedChannels(metadata?: IContainerRuntimeMetadata): boolean {\n\treturn !!metadata && !metadata.disableIsolatedChannels;\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 = [\n\tprotocolTreeName,\n\t\".logTail\",\n\t\".serviceProtocol\",\n\tblobsTreeName,\n\tgcTreeKey,\n\tidCompressorBlobName,\n];\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 *\n * Converts from:\n *\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 *\n * And adds +1 to treeNodeCount in stats.\n */\nexport function wrapSummaryInChannelsTree(summarizeResult: ISummaryTreeWithStats): void {\n\tsummarizeResult.summary = {\n\t\ttype: SummaryType.Tree,\n\t\ttree: { [channelsTreeName]: summarizeResult.summary },\n\t};\n\tsummarizeResult.stats.treeNodeCount++;\n}\n\nexport async function getFluidDataStoreAttributes(\n\tstorage: IDocumentStorageService,\n\tsnapshot: ISnapshotTree,\n): Promise<ReadFluidDataStoreAttributes> {\n\tconst attributes = await readAndParse<ReadFluidDataStoreAttributes>(\n\t\tstorage,\n\t\tsnapshot.blobs[dataStoreAttributesBlobName],\n\t);\n\t// Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.\n\t// For snapshotFormatVersion = \"0.1\" (1) or above, pkg is jsonified, otherwise it is just a string.\n\t// However the feature of loading a detached container from snapshot, is added when the\n\t// snapshotFormatVersion is at least \"0.1\" (1), so we don't expect it to be anything else.\n\tconst formatVersion = getAttributesFormatVersion(attributes);\n\tassert(formatVersion > 0, 0x1d5 /* Invalid snapshot format version */);\n\treturn attributes;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"summaryFormat.js","sourceRoot":"","sources":["../../src/summary/summaryFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAMjE,OAAO,EACN,mBAAmB,IAAI,sBAAsB,EAC7C,YAAY,GACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAEN,gBAAgB,EAChB,SAAS,GACT,MAAM,8CAA8C,CAAC;AAiFtD,MAAM,UAAU,0BAA0B,CAAC,UAAwC;IAClF,IAAI,UAAU,CAAC,oBAAoB,EAAE,CAAC;QACrC;;;WAGG;QACH,OAAO,UAAU,CAAC,oBAAoB,CAAC;IACxC,CAAC;SAAM,IAAI,UAAU,CAAC,qBAAqB,KAAK,KAAK,EAAE,CAAC;QACvD;;;WAGG;QACH,OAAO,CAAC,CAAC;IACV,CAAC;IACD;;;OAGG;IACH,OAAO,CAAC,CAAC;AACV,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAAwC;IAC3E,OAAO,CAAC,CAAC,UAAU,CAAC,oBAAoB,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC;AACjF,CAAC;AAiDD;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC5C,OAAmC,EACG,EAAE,CACxC,OAAO,KAAK,SAAS;IACpB,CAAC,CAAC,SAAS;IACX,CAAC,CAAC;QACA,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;QAClD,qBAAqB,EAAE,OAAO,CAAC,qB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,OAAO,EAAE;KACrD,CAAC;IACF,eAAe,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAChD,OAAgC,EAChC,QAAuB;IAEvB,MAAM,UAAU,GAAG,MAAM,YAAY,CACpC,OAAO,EACP,QAAQ,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAC3C,CAAC;IACF,qFAAqF;IACrF,mGAAmG;IACnG,uFAAuF;IACvF,0FAA0F;IAC1F,MAAM,aAAa,GAAG,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC7D,MAAM,CAAC,aAAa,GAAG,CAAC,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACvE,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { SummaryType } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentStorageService,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tblobHeadersBlobName as blobNameForBlobHeaders,\n\treadAndParse,\n} from \"@fluidframework/driver-utils/internal\";\nimport {\n\tISummaryTreeWithStats,\n\tchannelsTreeName,\n\tgcTreeKey,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport { IGCMetadata } from \"../gc/index.js\";\n\nimport { IDocumentSchema } from \"./documentSchema.js\";\n\n/**\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n * @legacy\n * @alpha\n */\nexport type OmitAttributesVersions<T> = Omit<\n\tT,\n\t\"snapshotFormatVersion\" | \"summaryFormatVersion\"\n>;\n\n/**\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreAttributes0 {\n\treadonly snapshotFormatVersion?: undefined;\n\treadonly summaryFormatVersion?: undefined;\n\tpkg: string;\n\t/**\n\t * This tells whether a data store is root. Root data stores are never collected.\n\t * Non-root data stores may be collected if they are not used. If this is not present, default it to\n\t * true. This will ensure that older data stores are incorrectly collected.\n\t */\n\treadonly isRootDataStore?: boolean;\n}\n\n/**\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreAttributes1\n\textends OmitAttributesVersions<IFluidDataStoreAttributes0> {\n\treadonly snapshotFormatVersion: \"0.1\";\n\treadonly summaryFormatVersion?: undefined;\n}\n\n/**\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreAttributes2\n\textends OmitAttributesVersions<IFluidDataStoreAttributes1> {\n\t/** Switch from snapshotFormatVersion to summaryFormatVersion */\n\treadonly snapshotFormatVersion?: undefined;\n\treadonly summaryFormatVersion: 2;\n\t/**\n\t * True if channels are not isolated in .channels subtrees, otherwise isolated.\n\t * This is required in both datastore attributes as well as the root container,\n\t * because reused summary handles may cause different format versions in each\n\t * datastore subtree within the summary.\n\t */\n\treadonly 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 *\n * @deprecated - This interface will no longer be exported in the future(AB#8004).\n *\n * @legacy\n * @alpha\n *\n */\nexport type ReadFluidDataStoreAttributes =\n\t| IFluidDataStoreAttributes0\n\t| IFluidDataStoreAttributes1\n\t| IFluidDataStoreAttributes2;\nexport type WriteFluidDataStoreAttributes =\n\t| IFluidDataStoreAttributes1\n\t| IFluidDataStoreAttributes2;\n\nexport function getAttributesFormatVersion(attributes: ReadFluidDataStoreAttributes): number {\n\tif (attributes.summaryFormatVersion) {\n\t\t/**\n\t\t * Version 2+: Introduces .channels trees for isolation of\n\t\t * channel trees from data store objects.\n\t\t */\n\t\treturn attributes.summaryFormatVersion;\n\t} else if (attributes.snapshotFormatVersion === \"0.1\") {\n\t\t/**\n\t\t * Version 1: from this version the pkg within the data store\n\t\t * attributes blob is a JSON array rather than a string.\n\t\t */\n\t\treturn 1;\n\t}\n\t/**\n\t * Version 0: format version is missing from summary.\n\t * This indicates it is an older version.\n\t */\n\treturn 0;\n}\n\nexport function hasIsolatedChannels(attributes: ReadFluidDataStoreAttributes): boolean {\n\treturn !!attributes.summaryFormatVersion && !attributes.disableIsolatedChannels;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {\n\treadonly summaryFormatVersion: 1;\n\t/** @deprecated - used by old (prior to 2.0 RC3) runtimes */\n\treadonly message?: ISummaryMetadataMessage;\n\t/** The last message processed at the time of summary. Only primitive property types are added to the summary. */\n\treadonly lastMessage?: ISummaryMetadataMessage;\n\t/** True if channels are not isolated in .channels subtrees, otherwise isolated. */\n\treadonly disableIsolatedChannels?: true;\n\t/** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */\n\treadonly summaryNumber?: number;\n\t/** GUID to identify a document in telemetry */\n\treadonly telemetryDocumentId?: string;\n\n\treadonly documentSchema?: IDocumentSchema;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface ICreateContainerMetadata {\n\t/** Runtime version of the container when it was first created */\n\tcreateContainerRuntimeVersion?: string;\n\t/** Timestamp of the container when it was first created */\n\tcreateContainerTimestamp?: number;\n}\n\n/**\n * The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary.\n * @legacy\n * @alpha\n */\nexport type ISummaryMetadataMessage = Pick<\n\tISequencedDocumentMessage,\n\t| \"clientId\"\n\t| \"clientSequenceNumber\"\n\t| \"minimumSequenceNumber\"\n\t| \"referenceSequenceNumber\"\n\t| \"sequenceNumber\"\n\t| \"timestamp\"\n\t| \"type\"\n>;\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\tmessage?: ISequencedDocumentMessage,\n): ISummaryMetadataMessage | undefined =>\n\tmessage === undefined\n\t\t? undefined\n\t\t: {\n\t\t\t\tclientId: message.clientId,\n\t\t\t\tclientSequenceNumber: message.clientSequenceNumber,\n\t\t\t\tminimumSequenceNumber: message.minimumSequenceNumber,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t\tsequenceNumber: message.sequenceNumber,\n\t\t\t\ttimestamp: message.timestamp,\n\t\t\t\ttype: message.type,\n\t\t\t};\n\nexport function getMetadataFormatVersion(metadata?: IContainerRuntimeMetadata): number {\n\t/**\n\t * Version 2+: Introduces runtime sequence number for data verification.\n\t *\n\t * Version 1+: Introduces .metadata blob and .channels trees for isolation of\n\t * data store trees from container-level objects.\n\t * Also introduces enableGC option stored in the summary.\n\t *\n\t * Version 0: metadata blob missing; format version is missing from summary.\n\t * This indicates it is an older version.\n\t */\n\treturn 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\";\nexport const idCompressorBlobName = \".idCompressor\";\nexport const blobHeadersBlobName = blobNameForBlobHeaders;\n\nexport function rootHasIsolatedChannels(metadata?: IContainerRuntimeMetadata): boolean {\n\treturn !!metadata && !metadata.disableIsolatedChannels;\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 = [\n\tprotocolTreeName,\n\t\".logTail\",\n\t\".serviceProtocol\",\n\tblobsTreeName,\n\tgcTreeKey,\n\tidCompressorBlobName,\n];\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 *\n * Converts from:\n *\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 *\n * And adds +1 to treeNodeCount in stats.\n */\nexport function wrapSummaryInChannelsTree(summarizeResult: ISummaryTreeWithStats): void {\n\tsummarizeResult.summary = {\n\t\ttype: SummaryType.Tree,\n\t\ttree: { [channelsTreeName]: summarizeResult.summary },\n\t};\n\tsummarizeResult.stats.treeNodeCount++;\n}\n\nexport async function getFluidDataStoreAttributes(\n\tstorage: IDocumentStorageService,\n\tsnapshot: ISnapshotTree,\n): Promise<ReadFluidDataStoreAttributes> {\n\tconst attributes = await readAndParse<ReadFluidDataStoreAttributes>(\n\t\tstorage,\n\t\tsnapshot.blobs[dataStoreAttributesBlobName],\n\t);\n\t// Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.\n\t// For snapshotFormatVersion = \"0.1\" (1) or above, pkg is jsonified, otherwise it is just a string.\n\t// However the feature of loading a detached container from snapshot, is added when the\n\t// snapshotFormatVersion is at least \"0.1\" (1), so we don't expect it to be anything else.\n\tconst formatVersion = getAttributesFormatVersion(attributes);\n\tassert(formatVersion > 0, 0x1d5 /* Invalid snapshot format version */);\n\treturn attributes;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-runtime",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0-276326",
|
|
4
4
|
"description": "Fluid container runtime",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -127,18 +127,18 @@
|
|
|
127
127
|
"temp-directory": "nyc/.nyc_output"
|
|
128
128
|
},
|
|
129
129
|
"dependencies": {
|
|
130
|
-
"@fluid-internal/client-utils": "
|
|
131
|
-
"@fluidframework/container-definitions": "
|
|
132
|
-
"@fluidframework/container-runtime-definitions": "
|
|
133
|
-
"@fluidframework/core-interfaces": "
|
|
134
|
-
"@fluidframework/core-utils": "
|
|
135
|
-
"@fluidframework/datastore": "
|
|
136
|
-
"@fluidframework/driver-definitions": "
|
|
137
|
-
"@fluidframework/driver-utils": "
|
|
138
|
-
"@fluidframework/id-compressor": "
|
|
139
|
-
"@fluidframework/runtime-definitions": "
|
|
140
|
-
"@fluidframework/runtime-utils": "
|
|
141
|
-
"@fluidframework/telemetry-utils": "
|
|
130
|
+
"@fluid-internal/client-utils": "2.1.0-276326",
|
|
131
|
+
"@fluidframework/container-definitions": "2.1.0-276326",
|
|
132
|
+
"@fluidframework/container-runtime-definitions": "2.1.0-276326",
|
|
133
|
+
"@fluidframework/core-interfaces": "2.1.0-276326",
|
|
134
|
+
"@fluidframework/core-utils": "2.1.0-276326",
|
|
135
|
+
"@fluidframework/datastore": "2.1.0-276326",
|
|
136
|
+
"@fluidframework/driver-definitions": "2.1.0-276326",
|
|
137
|
+
"@fluidframework/driver-utils": "2.1.0-276326",
|
|
138
|
+
"@fluidframework/id-compressor": "2.1.0-276326",
|
|
139
|
+
"@fluidframework/runtime-definitions": "2.1.0-276326",
|
|
140
|
+
"@fluidframework/runtime-utils": "2.1.0-276326",
|
|
141
|
+
"@fluidframework/telemetry-utils": "2.1.0-276326",
|
|
142
142
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
143
143
|
"double-ended-queue": "^2.1.0-0",
|
|
144
144
|
"lz4js": "^0.2.0",
|
|
@@ -147,16 +147,16 @@
|
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
149
149
|
"@biomejs/biome": "^1.7.3",
|
|
150
|
-
"@fluid-internal/mocha-test-setup": "
|
|
151
|
-
"@fluid-private/stochastic-test-utils": "
|
|
152
|
-
"@fluid-private/test-pairwise-generator": "
|
|
150
|
+
"@fluid-internal/mocha-test-setup": "2.1.0-276326",
|
|
151
|
+
"@fluid-private/stochastic-test-utils": "2.1.0-276326",
|
|
152
|
+
"@fluid-private/test-pairwise-generator": "2.1.0-276326",
|
|
153
153
|
"@fluid-tools/benchmark": "^0.48.0",
|
|
154
154
|
"@fluid-tools/build-cli": "^0.39.0",
|
|
155
155
|
"@fluidframework/build-common": "^2.0.3",
|
|
156
156
|
"@fluidframework/build-tools": "^0.39.0",
|
|
157
|
-
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.0.0-rc.
|
|
157
|
+
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.0.0-rc.5.0.0",
|
|
158
158
|
"@fluidframework/eslint-config-fluid": "^5.3.0",
|
|
159
|
-
"@fluidframework/test-runtime-utils": "
|
|
159
|
+
"@fluidframework/test-runtime-utils": "2.1.0-276326",
|
|
160
160
|
"@microsoft/api-extractor": "^7.45.1",
|
|
161
161
|
"@types/double-ended-queue": "^2.1.0",
|
|
162
162
|
"@types/mocha": "^9.1.1",
|
|
@@ -178,84 +178,18 @@
|
|
|
178
178
|
"typescript": "~5.4.5"
|
|
179
179
|
},
|
|
180
180
|
"typeValidation": {
|
|
181
|
-
"broken": {
|
|
182
|
-
"ClassDeclaration_ChannelCollection": {
|
|
183
|
-
"backCompat": false,
|
|
184
|
-
"forwardCompat": false
|
|
185
|
-
},
|
|
186
|
-
"ClassDeclaration_ContainerRuntime": {
|
|
187
|
-
"backCompat": false,
|
|
188
|
-
"forwardCompat": false
|
|
189
|
-
},
|
|
190
|
-
"ClassDeclaration_FluidDataStoreContext": {
|
|
191
|
-
"forwardCompat": false,
|
|
192
|
-
"backCompat": false
|
|
193
|
-
},
|
|
194
|
-
"ClassDeclaration_LocalFluidDataStoreContextBase": {
|
|
195
|
-
"forwardCompat": false,
|
|
196
|
-
"backCompat": false
|
|
197
|
-
},
|
|
198
|
-
"ClassDeclaration_LocalFluidDataStoreContext": {
|
|
199
|
-
"backCompat": false,
|
|
200
|
-
"forwardCompat": false
|
|
201
|
-
},
|
|
202
|
-
"RemovedEnumDeclaration_RuntimeMessage": {
|
|
203
|
-
"backCompat": false,
|
|
204
|
-
"forwardCompat": false
|
|
205
|
-
},
|
|
206
|
-
"InterfaceDeclaration_IFluidDataStoreContextInternal": {
|
|
207
|
-
"backCompat": false,
|
|
208
|
-
"forwardCompat": false
|
|
209
|
-
},
|
|
210
|
-
"InterfaceDeclaration_IFluidDataStoreContextProps": {
|
|
211
|
-
"backCompat": false,
|
|
212
|
-
"forwardCompat": false
|
|
213
|
-
},
|
|
214
|
-
"InterfaceDeclaration_ILocalDetachedFluidDataStoreContextProps": {
|
|
215
|
-
"backCompat": false,
|
|
216
|
-
"forwardCompat": false
|
|
217
|
-
},
|
|
218
|
-
"InterfaceDeclaration_ILocalFluidDataStoreContextProps": {
|
|
219
|
-
"backCompat": false,
|
|
220
|
-
"forwardCompat": false
|
|
221
|
-
},
|
|
222
|
-
"InterfaceDeclaration_ISummarizerRuntime": {
|
|
223
|
-
"backCompat": false,
|
|
224
|
-
"forwardCompat": false
|
|
225
|
-
},
|
|
226
|
-
"RemovedInterfaceDeclaration_IRetriableFailureResult": {
|
|
227
|
-
"backCompat": false,
|
|
228
|
-
"forwardCompat": false
|
|
229
|
-
},
|
|
230
|
-
"InterfaceDeclaration_IGenerateSummaryTreeResult": {
|
|
231
|
-
"backCompat": false
|
|
232
|
-
},
|
|
233
|
-
"InterfaceDeclaration_ISubmitSummaryOpResult": {
|
|
234
|
-
"backCompat": false
|
|
235
|
-
},
|
|
236
|
-
"InterfaceDeclaration_IUploadSummaryResult": {
|
|
237
|
-
"backCompat": false
|
|
238
|
-
},
|
|
239
|
-
"TypeAliasDeclaration_SubmitSummaryResult": {
|
|
240
|
-
"backCompat": false
|
|
241
|
-
},
|
|
242
|
-
"InterfaceDeclaration_IGCNodeUpdatedProps": {
|
|
243
|
-
"forwardCompat": false
|
|
244
|
-
},
|
|
245
|
-
"RemovedInterfaceDeclaration_ContainerRuntimeMessage": {
|
|
246
|
-
"backCompat": false,
|
|
247
|
-
"forwardCompat": false
|
|
248
|
-
}
|
|
249
|
-
}
|
|
181
|
+
"broken": {}
|
|
250
182
|
},
|
|
251
183
|
"scripts": {
|
|
252
184
|
"api": "fluid-build . --task api",
|
|
253
|
-
"api-extractor:commonjs": "flub generate entrypoints --
|
|
254
|
-
"api-extractor:esnext": "flub generate entrypoints --
|
|
185
|
+
"api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
|
|
186
|
+
"api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
|
|
255
187
|
"build": "fluid-build . --task build",
|
|
256
188
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
257
189
|
"build:compile": "fluid-build . --task compile",
|
|
258
|
-
"build:docs": "
|
|
190
|
+
"build:docs": "concurrently \"npm:build:docs:*\"",
|
|
191
|
+
"build:docs:current": "api-extractor run --local",
|
|
192
|
+
"build:docs:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
|
|
259
193
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
260
194
|
"build:genver": "gen-version",
|
|
261
195
|
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
@@ -271,7 +205,9 @@
|
|
|
271
205
|
"check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
|
|
272
206
|
"check:format": "npm run check:biome",
|
|
273
207
|
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
274
|
-
"ci:build:docs": "
|
|
208
|
+
"ci:build:docs": "concurrently \"npm:ci:build:docs:*\"",
|
|
209
|
+
"ci:build:docs:current": "api-extractor run",
|
|
210
|
+
"ci:build:docs:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
|
|
275
211
|
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
276
212
|
"eslint": "eslint --format stylish src",
|
|
277
213
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
@@ -290,7 +226,7 @@
|
|
|
290
226
|
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
291
227
|
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && npm run place:cjs:package-stub",
|
|
292
228
|
"tsc:watch": "npm run place:cjs:package-stub && fluid-tsc commonjs --project ./tsconfig.cjs.json --watch",
|
|
293
|
-
"typetests:gen": "flub generate typetests --dir . -v
|
|
229
|
+
"typetests:gen": "flub generate typetests --dir . -v",
|
|
294
230
|
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
|
|
295
231
|
}
|
|
296
232
|
}
|
package/src/blobManager.ts
CHANGED
package/src/channelCollection.ts
CHANGED
|
@@ -114,6 +114,7 @@ export enum RuntimeHeaders {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/** True if a tombstoned object should be returned without erroring
|
|
117
|
+
* @legacy
|
|
117
118
|
* @alpha
|
|
118
119
|
*/
|
|
119
120
|
export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
|
package/src/containerRuntime.ts
CHANGED
|
@@ -241,6 +241,7 @@ function compatBehaviorAllowsMessageType(
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
/**
|
|
244
|
+
* @legacy
|
|
244
245
|
* @alpha
|
|
245
246
|
*/
|
|
246
247
|
export interface ISummaryBaseConfiguration {
|
|
@@ -263,6 +264,7 @@ export interface ISummaryBaseConfiguration {
|
|
|
263
264
|
}
|
|
264
265
|
|
|
265
266
|
/**
|
|
267
|
+
* @legacy
|
|
266
268
|
* @alpha
|
|
267
269
|
*/
|
|
268
270
|
export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
|
|
@@ -326,6 +328,7 @@ export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfigurati
|
|
|
326
328
|
}
|
|
327
329
|
|
|
328
330
|
/**
|
|
331
|
+
* @legacy
|
|
329
332
|
* @alpha
|
|
330
333
|
*/
|
|
331
334
|
export interface ISummaryConfigurationDisableSummarizer {
|
|
@@ -333,6 +336,7 @@ export interface ISummaryConfigurationDisableSummarizer {
|
|
|
333
336
|
}
|
|
334
337
|
|
|
335
338
|
/**
|
|
339
|
+
* @legacy
|
|
336
340
|
* @alpha
|
|
337
341
|
*/
|
|
338
342
|
export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
|
|
@@ -340,6 +344,7 @@ export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConf
|
|
|
340
344
|
}
|
|
341
345
|
|
|
342
346
|
/**
|
|
347
|
+
* @legacy
|
|
343
348
|
* @alpha
|
|
344
349
|
*/
|
|
345
350
|
export type ISummaryConfiguration =
|
|
@@ -348,6 +353,7 @@ export type ISummaryConfiguration =
|
|
|
348
353
|
| ISummaryConfigurationHeuristics;
|
|
349
354
|
|
|
350
355
|
/**
|
|
356
|
+
* @legacy
|
|
351
357
|
* @alpha
|
|
352
358
|
*/
|
|
353
359
|
export const DefaultSummaryConfiguration: ISummaryConfiguration = {
|
|
@@ -377,6 +383,7 @@ export const DefaultSummaryConfiguration: ISummaryConfiguration = {
|
|
|
377
383
|
};
|
|
378
384
|
|
|
379
385
|
/**
|
|
386
|
+
* @legacy
|
|
380
387
|
* @alpha
|
|
381
388
|
*/
|
|
382
389
|
export interface ISummaryRuntimeOptions {
|
|
@@ -394,6 +401,7 @@ export interface ISummaryRuntimeOptions {
|
|
|
394
401
|
|
|
395
402
|
/**
|
|
396
403
|
* Options for op compression.
|
|
404
|
+
* @legacy
|
|
397
405
|
* @alpha
|
|
398
406
|
*/
|
|
399
407
|
export interface ICompressionRuntimeOptions {
|
|
@@ -412,6 +420,7 @@ export interface ICompressionRuntimeOptions {
|
|
|
412
420
|
|
|
413
421
|
/**
|
|
414
422
|
* Options for container runtime.
|
|
423
|
+
* @legacy
|
|
415
424
|
* @alpha
|
|
416
425
|
*/
|
|
417
426
|
export interface IContainerRuntimeOptions {
|
|
@@ -490,16 +499,19 @@ export interface IContainerRuntimeOptions {
|
|
|
490
499
|
|
|
491
500
|
/**
|
|
492
501
|
* Error responses when requesting a deleted object will have this header set to true
|
|
502
|
+
* @legacy
|
|
493
503
|
* @alpha
|
|
494
504
|
*/
|
|
495
505
|
export const DeletedResponseHeaderKey = "wasDeleted";
|
|
496
506
|
/**
|
|
497
507
|
* Tombstone error responses will have this header set to true
|
|
508
|
+
* @legacy
|
|
498
509
|
* @alpha
|
|
499
510
|
*/
|
|
500
511
|
export const TombstoneResponseHeaderKey = "isTombstoned";
|
|
501
512
|
/**
|
|
502
513
|
* Inactive error responses will have this header set to true
|
|
514
|
+
* @legacy
|
|
503
515
|
* @alpha
|
|
504
516
|
*/
|
|
505
517
|
export const InactiveResponseHeaderKey = "isInactive";
|
|
@@ -525,13 +537,17 @@ export const defaultRuntimeHeaderData: Required<RuntimeHeaderData> = {
|
|
|
525
537
|
|
|
526
538
|
/**
|
|
527
539
|
* Available compression algorithms for op compression.
|
|
540
|
+
* @legacy
|
|
528
541
|
* @alpha
|
|
529
542
|
*/
|
|
530
543
|
export enum CompressionAlgorithms {
|
|
531
544
|
lz4 = "lz4",
|
|
532
545
|
}
|
|
533
546
|
|
|
534
|
-
/**
|
|
547
|
+
/**
|
|
548
|
+
* @legacy
|
|
549
|
+
* @alpha
|
|
550
|
+
*/
|
|
535
551
|
export const disabledCompressionConfig: ICompressionRuntimeOptions = {
|
|
536
552
|
minimumBatchSizeInBytes: Infinity,
|
|
537
553
|
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
@@ -643,8 +659,10 @@ export const makeLegacySendBatchFn =
|
|
|
643
659
|
deltaManager: Pick<IDeltaManager<unknown, unknown>, "flush">,
|
|
644
660
|
) =>
|
|
645
661
|
(batch: IBatch) => {
|
|
662
|
+
// Default to negative one to match Container.submitBatch behavior
|
|
663
|
+
let clientSequenceNumber: number = -1;
|
|
646
664
|
for (const message of batch.content) {
|
|
647
|
-
submitFn(
|
|
665
|
+
clientSequenceNumber = submitFn(
|
|
648
666
|
MessageType.Operation,
|
|
649
667
|
// For back-compat (submitFn only works on deserialized content)
|
|
650
668
|
message.contents === undefined ? undefined : JSON.parse(message.contents),
|
|
@@ -654,6 +672,8 @@ export const makeLegacySendBatchFn =
|
|
|
654
672
|
}
|
|
655
673
|
|
|
656
674
|
deltaManager.flush();
|
|
675
|
+
|
|
676
|
+
return clientSequenceNumber;
|
|
657
677
|
};
|
|
658
678
|
|
|
659
679
|
/** Helper type for type constraints passed through several functions.
|
|
@@ -732,6 +752,7 @@ function lastMessageFromMetadata(metadata: IContainerRuntimeMetadata | undefined
|
|
|
732
752
|
/**
|
|
733
753
|
* Represents the runtime of the container. Contains helper functions/state of the container.
|
|
734
754
|
* It will define the store level mappings.
|
|
755
|
+
* @legacy
|
|
735
756
|
* @alpha
|
|
736
757
|
*/
|
|
737
758
|
export class ContainerRuntime
|
|
@@ -910,7 +910,10 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
910
910
|
break;
|
|
911
911
|
}
|
|
912
912
|
case GarbageCollectionMessageType.TombstoneLoaded: {
|
|
913
|
-
if (
|
|
913
|
+
if (
|
|
914
|
+
!this.configs.tombstoneAutorecoveryEnabled ||
|
|
915
|
+
this.mc.config.getBoolean(disableAutoRecoveryKey) === true
|
|
916
|
+
) {
|
|
914
917
|
break;
|
|
915
918
|
}
|
|
916
919
|
|
|
@@ -1083,7 +1086,10 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
1083
1086
|
* before runnint GC next.
|
|
1084
1087
|
*/
|
|
1085
1088
|
private triggerAutoRecovery(nodePath: string) {
|
|
1086
|
-
if (
|
|
1089
|
+
if (
|
|
1090
|
+
!this.configs.tombstoneAutorecoveryEnabled ||
|
|
1091
|
+
this.mc.config.getBoolean(disableAutoRecoveryKey) === true
|
|
1092
|
+
) {
|
|
1087
1093
|
return;
|
|
1088
1094
|
}
|
|
1089
1095
|
|
package/src/gc/gcConfigs.ts
CHANGED
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
maxSnapshotCacheExpiryMs,
|
|
30
30
|
oneDayMs,
|
|
31
31
|
runSessionExpiryKey,
|
|
32
|
-
runSweepKey,
|
|
33
32
|
throwOnTombstoneLoadOverrideKey,
|
|
34
33
|
throwOnTombstoneUsageKey,
|
|
35
34
|
} from "./gcDefinitions.js";
|
|
@@ -121,8 +120,7 @@ export function generateGCConfigs(
|
|
|
121
120
|
const sweepEnabled: boolean =
|
|
122
121
|
!gcEnabled || tombstoneTimeoutMs === undefined
|
|
123
122
|
? false
|
|
124
|
-
:
|
|
125
|
-
(sweepAllowed && createParams.gcOptions.enableGCSweep === true);
|
|
123
|
+
: sweepAllowed && createParams.gcOptions.enableGCSweep === true;
|
|
126
124
|
const disableDatastoreSweep =
|
|
127
125
|
mc.config.getBoolean(disableDatastoreSweepKey) === true ||
|
|
128
126
|
createParams.gcOptions[gcDisableDataStoreSweepOptionName] === true;
|
|
@@ -132,6 +130,10 @@ export function generateGCConfigs(
|
|
|
132
130
|
: "YES"
|
|
133
131
|
: "NO";
|
|
134
132
|
|
|
133
|
+
// If we aren't running sweep, also disable AutoRecovery which also emits the GC op.
|
|
134
|
+
// This gives a simple control surface for compability concerns around introducing the new op.
|
|
135
|
+
const tombstoneAutorecoveryEnabled = shouldRunSweep !== "NO";
|
|
136
|
+
|
|
135
137
|
// Override inactive timeout if test config or gc options to override it is set.
|
|
136
138
|
const inactiveTimeoutMs =
|
|
137
139
|
mc.config.getNumber("Fluid.GarbageCollection.TestOverride.InactiveTimeoutMs") ??
|
|
@@ -172,6 +174,7 @@ export function generateGCConfigs(
|
|
|
172
174
|
return {
|
|
173
175
|
gcEnabled, // For this document
|
|
174
176
|
sweepEnabled: sweepAllowed, // For this document (based on current GC Generation option)
|
|
177
|
+
tombstoneAutorecoveryEnabled,
|
|
175
178
|
shouldRunSweep, // For this session
|
|
176
179
|
runFullGC,
|
|
177
180
|
testMode,
|