@fluidframework/container-runtime 2.0.0-internal.6.2.0 → 2.0.0-internal.6.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/CHANGELOG.md +4 -0
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +4 -3
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +1 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +81 -69
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +13 -12
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +18 -3
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +185 -145
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +3 -3
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +36 -36
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -8
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +19 -20
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.d.ts +1 -1
- package/dist/deltaManagerProxyBase.js +2 -2
- package/dist/deltaManagerProxyBase.js.map +1 -1
- package/dist/deltaScheduler.js +6 -6
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +3 -5
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +4 -21
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +2 -2
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.js +7 -7
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +15 -52
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +4 -4
- package/dist/gc/gcUnreferencedStateTracker.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/id-compressor/appendOnlySortedMap.js +2 -2
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/finalSpace.js +2 -2
- package/dist/id-compressor/finalSpace.js.map +1 -1
- package/dist/id-compressor/idCompressor.d.ts.map +1 -1
- package/dist/id-compressor/idCompressor.js +16 -15
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/sessions.js +5 -5
- package/dist/id-compressor/sessions.js.map +1 -1
- package/dist/id-compressor/utilities.js +2 -2
- package/dist/id-compressor/utilities.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +4 -3
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +11 -10
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +3 -3
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js +12 -12
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.js +6 -6
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +12 -13
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +19 -18
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +1 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +6 -5
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +3 -3
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +1 -1
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +13 -12
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -1
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +4 -3
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts +1 -1
- package/dist/summary/summarizerClientElection.js +2 -2
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +2 -2
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/index.d.ts +1 -1
- package/dist/summary/summarizerNode/index.d.ts.map +1 -1
- package/dist/summary/summarizerNode/index.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +5 -14
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +32 -109
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +5 -88
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +1 -1
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +9 -8
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.js +2 -2
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +1 -1
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +10 -10
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +9 -8
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +1 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +52 -40
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +2 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +18 -3
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +147 -107
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +1 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +2 -2
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +1 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +1 -2
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.d.ts +1 -1
- package/lib/deltaManagerProxyBase.js +1 -1
- package/lib/deltaManagerProxyBase.js.map +1 -1
- package/lib/deltaScheduler.js +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +3 -5
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +5 -22
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +2 -2
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.js +1 -1
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +16 -53
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +1 -1
- package/lib/gc/gcUnreferencedStateTracker.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/id-compressor/appendOnlySortedMap.js +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/finalSpace.js +1 -1
- package/lib/id-compressor/finalSpace.js.map +1 -1
- package/lib/id-compressor/idCompressor.d.ts.map +1 -1
- package/lib/id-compressor/idCompressor.js +2 -1
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/sessions.js +1 -1
- package/lib/id-compressor/sessions.js.map +1 -1
- package/lib/id-compressor/utilities.js +1 -1
- package/lib/id-compressor/utilities.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +2 -1
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +2 -1
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.js +1 -1
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +1 -2
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +2 -1
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/index.d.ts +1 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +2 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +1 -1
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +5 -4
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -1
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +2 -1
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts +1 -1
- package/lib/summary/summarizerClientElection.js +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/index.d.ts +1 -1
- package/lib/summary/summarizerNode/index.d.ts.map +1 -1
- package/lib/summary/summarizerNode/index.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +5 -14
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +16 -93
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +0 -11
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -86
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +1 -1
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +2 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.js +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +1 -1
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +3 -3
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +4 -3
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +22 -24
- package/src/batchTracker.ts +2 -1
- package/src/blobManager.ts +57 -48
- package/src/connectionTelemetry.ts +2 -1
- package/src/containerRuntime.ts +207 -166
- package/src/dataStore.ts +1 -1
- package/src/dataStoreContext.ts +2 -2
- package/src/dataStoreContexts.ts +1 -2
- package/src/dataStores.ts +1 -2
- package/src/deltaManagerProxyBase.ts +1 -1
- package/src/deltaScheduler.ts +1 -1
- package/src/gc/garbageCollection.ts +6 -41
- package/src/gc/gcDefinitions.ts +2 -6
- package/src/gc/gcHelpers.ts +1 -1
- package/src/gc/gcSummaryStateTracker.ts +19 -65
- package/src/gc/gcUnreferencedStateTracker.ts +1 -1
- package/src/gc/index.ts +0 -1
- package/src/id-compressor/appendOnlySortedMap.ts +1 -1
- package/src/id-compressor/finalSpace.ts +1 -1
- package/src/id-compressor/idCompressor.ts +2 -1
- package/src/id-compressor/sessions.ts +1 -1
- package/src/id-compressor/utilities.ts +1 -1
- package/src/opLifecycle/opCompressor.ts +2 -1
- package/src/opLifecycle/opDecompressor.ts +2 -1
- package/src/opLifecycle/opGroupingManager.ts +1 -1
- package/src/opLifecycle/opSplitter.ts +1 -1
- package/src/opLifecycle/outbox.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +1 -2
- package/src/scheduleManager.ts +2 -1
- package/src/summary/index.ts +1 -2
- package/src/summary/orderedClientElection.ts +2 -1
- package/src/summary/runWhileConnectedCoordinator.ts +1 -1
- package/src/summary/runningSummarizer.ts +5 -10
- package/src/summary/summarizer.ts +2 -1
- package/src/summary/summarizerClientElection.ts +1 -1
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/index.ts +1 -2
- package/src/summary/summarizerNode/summarizerNode.ts +23 -145
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +7 -38
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +3 -123
- package/src/summary/summaryCollection.ts +2 -1
- package/src/summary/summaryFormat.ts +1 -1
- package/src/summary/summaryGenerator.ts +3 -3
- package/src/summary/summaryManager.ts +4 -3
package/src/containerRuntime.ts
CHANGED
|
@@ -27,8 +27,8 @@ import {
|
|
|
27
27
|
IContainerRuntime,
|
|
28
28
|
IContainerRuntimeEvents,
|
|
29
29
|
} from "@fluidframework/container-runtime-definitions";
|
|
30
|
-
import { assert, delay,
|
|
31
|
-
import {
|
|
30
|
+
import { assert, delay, LazyPromise } from "@fluidframework/core-utils";
|
|
31
|
+
import { Trace, TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
32
32
|
import {
|
|
33
33
|
createChildLogger,
|
|
34
34
|
createChildMonitoringContext,
|
|
@@ -126,7 +126,6 @@ import {
|
|
|
126
126
|
IContainerRuntimeMetadata,
|
|
127
127
|
ICreateContainerMetadata,
|
|
128
128
|
idCompressorBlobName,
|
|
129
|
-
IFetchSnapshotResult,
|
|
130
129
|
IRootSummarizerNodeWithGC,
|
|
131
130
|
ISummaryMetadataMessage,
|
|
132
131
|
metadataBlobName,
|
|
@@ -155,6 +154,7 @@ import {
|
|
|
155
154
|
IEnqueueSummarizeOptions,
|
|
156
155
|
EnqueueSummarizeResult,
|
|
157
156
|
ISummarizerEvents,
|
|
157
|
+
IBaseSummarizeResult,
|
|
158
158
|
} from "./summary";
|
|
159
159
|
import { formExponentialFn, Throttler } from "./throttler";
|
|
160
160
|
import {
|
|
@@ -584,6 +584,11 @@ const defaultCompressionConfig = {
|
|
|
584
584
|
|
|
585
585
|
const defaultChunkSizeInBytes = 204800;
|
|
586
586
|
|
|
587
|
+
/** The default time to wait for pending ops to be processed during summarization */
|
|
588
|
+
export const defaultPendingOpsWaitTimeoutMs = 1000;
|
|
589
|
+
/** The default time to delay a summarization retry attempt when there are pending ops */
|
|
590
|
+
export const defaultPendingOpsRetryDelayMs = 1000;
|
|
591
|
+
|
|
587
592
|
/**
|
|
588
593
|
* Instead of refreshing from latest because we do not have 100% confidence in the state
|
|
589
594
|
* of the current system, we should close the summarizer and let it recover.
|
|
@@ -1066,7 +1071,6 @@ export class ContainerRuntime
|
|
|
1066
1071
|
private emitDirtyDocumentEvent = true;
|
|
1067
1072
|
private readonly enableOpReentryCheck: boolean;
|
|
1068
1073
|
private readonly disableAttachReorder: boolean | undefined;
|
|
1069
|
-
private readonly summaryStateUpdateMethod: string | undefined;
|
|
1070
1074
|
private readonly closeSummarizerDelayMs: number;
|
|
1071
1075
|
/**
|
|
1072
1076
|
* If true, summary generated is validate before uploading it to the server. With single commit summaries,
|
|
@@ -1546,16 +1550,12 @@ export class ContainerRuntime
|
|
|
1546
1550
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1547
1551
|
this._audience = audience!;
|
|
1548
1552
|
|
|
1549
|
-
this.summaryStateUpdateMethod = this.mc.config.getString(
|
|
1550
|
-
"Fluid.ContainerRuntime.Test.SummaryStateUpdateMethodV2",
|
|
1551
|
-
);
|
|
1552
1553
|
const closeSummarizerDelayOverride = this.mc.config.getNumber(
|
|
1553
1554
|
"Fluid.ContainerRuntime.Test.CloseSummarizerDelayOverrideMs",
|
|
1554
1555
|
);
|
|
1555
1556
|
this.closeSummarizerDelayMs = closeSummarizerDelayOverride ?? defaultCloseSummarizerDelayMs;
|
|
1556
1557
|
this.validateSummaryBeforeUpload =
|
|
1557
|
-
this.mc.config.getBoolean("Fluid.
|
|
1558
|
-
false;
|
|
1558
|
+
this.mc.config.getBoolean("Fluid.Summarizer.ValidateSummaryBeforeUpload") ?? false;
|
|
1559
1559
|
|
|
1560
1560
|
this.summaryCollection = new SummaryCollection(this.deltaManager, this.logger);
|
|
1561
1561
|
|
|
@@ -1703,7 +1703,6 @@ export class ContainerRuntime
|
|
|
1703
1703
|
disableAttachReorder: this.disableAttachReorder,
|
|
1704
1704
|
disablePartialFlush,
|
|
1705
1705
|
idCompressorEnabled: this.idCompressorEnabled,
|
|
1706
|
-
summaryStateUpdateMethod: this.summaryStateUpdateMethod,
|
|
1707
1706
|
closeSummarizerDelayOverride,
|
|
1708
1707
|
}),
|
|
1709
1708
|
telemetryDocumentId: this.telemetryDocumentId,
|
|
@@ -2967,6 +2966,50 @@ export class ContainerRuntime
|
|
|
2967
2966
|
await this.waitForDeltaManagerToCatchup(latestSnapshotRefSeq, summaryNumberLogger);
|
|
2968
2967
|
}
|
|
2969
2968
|
|
|
2969
|
+
// If there are pending (unacked ops), the summary will not be eventual consistent and it may even be
|
|
2970
|
+
// incorrect. So, wait for the container to be saved with a timeout. If the container is not saved
|
|
2971
|
+
// within the timeout, check if it should be failed or can continue.
|
|
2972
|
+
if (this.validateSummaryBeforeUpload && this.hasPendingMessages()) {
|
|
2973
|
+
const countBefore = this.pendingMessagesCount;
|
|
2974
|
+
// The timeout for waiting for pending ops can be overridden via configurations.
|
|
2975
|
+
const pendingOpsTimeout =
|
|
2976
|
+
this.mc.config.getNumber("Fluid.Summarizer.waitForPendingOpsTimeoutMs") ??
|
|
2977
|
+
defaultPendingOpsWaitTimeoutMs;
|
|
2978
|
+
await new Promise<void>((resolve, reject) => {
|
|
2979
|
+
const timeoutId = setTimeout(() => resolve(), pendingOpsTimeout);
|
|
2980
|
+
this.once("saved", () => {
|
|
2981
|
+
clearTimeout(timeoutId);
|
|
2982
|
+
resolve();
|
|
2983
|
+
});
|
|
2984
|
+
this.once("dispose", () => {
|
|
2985
|
+
clearTimeout(timeoutId);
|
|
2986
|
+
reject(new Error("Runtime is disposed while summarizing"));
|
|
2987
|
+
});
|
|
2988
|
+
});
|
|
2989
|
+
|
|
2990
|
+
// Log that there are pending ops while summarizing. This will help us gather data on how often this
|
|
2991
|
+
// happens, whether we attempted to wait for these ops to be acked and what was the result.
|
|
2992
|
+
summaryNumberLogger.sendTelemetryEvent({
|
|
2993
|
+
eventName: "PendingOpsWhileSummarizing",
|
|
2994
|
+
saved: this.hasPendingMessages() ? false : true,
|
|
2995
|
+
timeout: pendingOpsTimeout,
|
|
2996
|
+
countBefore,
|
|
2997
|
+
countAfter: this.pendingMessagesCount,
|
|
2998
|
+
});
|
|
2999
|
+
|
|
3000
|
+
// There could still be pending ops. Check if summary should fail or continue.
|
|
3001
|
+
const pendingMessagesFailResult = await this.shouldFailSummaryOnPendingOps(
|
|
3002
|
+
summaryNumberLogger,
|
|
3003
|
+
this.deltaManager.lastSequenceNumber,
|
|
3004
|
+
this.deltaManager.minimumSequenceNumber,
|
|
3005
|
+
finalAttempt,
|
|
3006
|
+
true /* beforeSummaryGeneration */,
|
|
3007
|
+
);
|
|
3008
|
+
if (pendingMessagesFailResult !== undefined) {
|
|
3009
|
+
return pendingMessagesFailResult;
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
|
|
2970
3013
|
const shouldPauseInboundSignal =
|
|
2971
3014
|
this.mc.config.getBoolean(
|
|
2972
3015
|
"Fluid.ContainerRuntime.SubmitSummary.disableInboundSignalPause",
|
|
@@ -3076,47 +3119,15 @@ export class ContainerRuntime
|
|
|
3076
3119
|
};
|
|
3077
3120
|
}
|
|
3078
3121
|
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
const error = DataProcessingError.create(
|
|
3089
|
-
"Pending ops during summarization",
|
|
3090
|
-
"submitSummary",
|
|
3091
|
-
undefined,
|
|
3092
|
-
{ pendingMessages: this.pendingMessagesCount },
|
|
3093
|
-
);
|
|
3094
|
-
summaryNumberLogger.sendErrorEvent(
|
|
3095
|
-
{
|
|
3096
|
-
eventName: "SkipFailingIncorrectSummary",
|
|
3097
|
-
referenceSequenceNumber: summaryRefSeqNum,
|
|
3098
|
-
minimumSequenceNumber,
|
|
3099
|
-
},
|
|
3100
|
-
error,
|
|
3101
|
-
);
|
|
3102
|
-
} else {
|
|
3103
|
-
// Default retry delay is 1 second. This can be overridden via config so that we can adjust it
|
|
3104
|
-
// based on telemetry while we decide on a stable number.
|
|
3105
|
-
const retryDelayMs =
|
|
3106
|
-
this.mc.config.getNumber("Fluid.Summarizer.PendingOpsRetryDelayMs") ??
|
|
3107
|
-
1000;
|
|
3108
|
-
const error = new RetriableSummaryError(
|
|
3109
|
-
"PendingMessagesInSummary",
|
|
3110
|
-
retryDelayMs / 1000,
|
|
3111
|
-
{ count: this.pendingMessagesCount },
|
|
3112
|
-
);
|
|
3113
|
-
return {
|
|
3114
|
-
stage: "base",
|
|
3115
|
-
referenceSequenceNumber: summaryRefSeqNum,
|
|
3116
|
-
minimumSequenceNumber,
|
|
3117
|
-
error,
|
|
3118
|
-
};
|
|
3119
|
-
}
|
|
3122
|
+
const pendingMessagesFailResult = await this.shouldFailSummaryOnPendingOps(
|
|
3123
|
+
summaryNumberLogger,
|
|
3124
|
+
summaryRefSeqNum,
|
|
3125
|
+
minimumSequenceNumber,
|
|
3126
|
+
finalAttempt,
|
|
3127
|
+
false /* beforeSummaryGeneration */,
|
|
3128
|
+
);
|
|
3129
|
+
if (pendingMessagesFailResult !== undefined) {
|
|
3130
|
+
return pendingMessagesFailResult;
|
|
3120
3131
|
}
|
|
3121
3132
|
}
|
|
3122
3133
|
|
|
@@ -3258,6 +3269,72 @@ export class ContainerRuntime
|
|
|
3258
3269
|
}
|
|
3259
3270
|
}
|
|
3260
3271
|
|
|
3272
|
+
/**
|
|
3273
|
+
* This helper is called during summarization. If there are pending ops, it will return a failed summarize result
|
|
3274
|
+
* (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
|
|
3275
|
+
* @param logger - The logger to be used for sending telemetry.
|
|
3276
|
+
* @param referenceSequenceNumber - The reference sequence number of the summary attempt.
|
|
3277
|
+
* @param minimumSequenceNumber - The minimum sequence number of the summary attempt.
|
|
3278
|
+
* @param finalAttempt - Whether this is the final summary attempt.
|
|
3279
|
+
* @param beforeSummaryGeneration - Whether this is called before summary generation or after.
|
|
3280
|
+
* @returns failed summarize result (IBaseSummarizeResult) if summary should be failed, undefined otherwise.
|
|
3281
|
+
*/
|
|
3282
|
+
private async shouldFailSummaryOnPendingOps(
|
|
3283
|
+
logger: ITelemetryLoggerExt,
|
|
3284
|
+
referenceSequenceNumber: number,
|
|
3285
|
+
minimumSequenceNumber: number,
|
|
3286
|
+
finalAttempt: boolean,
|
|
3287
|
+
beforeSummaryGeneration: boolean,
|
|
3288
|
+
): Promise<IBaseSummarizeResult | undefined> {
|
|
3289
|
+
if (!this.hasPendingMessages()) {
|
|
3290
|
+
return;
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
// If "SkipFailingIncorrectSummary" option is true, don't fail the summary in the last attempt.
|
|
3294
|
+
// This is a fallback to make progress in documents where there are consistently pending ops in
|
|
3295
|
+
// the summarizer.
|
|
3296
|
+
if (
|
|
3297
|
+
finalAttempt &&
|
|
3298
|
+
this.mc.config.getBoolean("Fluid.Summarizer.SkipFailingIncorrectSummary")
|
|
3299
|
+
) {
|
|
3300
|
+
const error = DataProcessingError.create(
|
|
3301
|
+
"Pending ops during summarization",
|
|
3302
|
+
"submitSummary",
|
|
3303
|
+
undefined,
|
|
3304
|
+
{ pendingMessages: this.pendingMessagesCount },
|
|
3305
|
+
);
|
|
3306
|
+
logger.sendErrorEvent(
|
|
3307
|
+
{
|
|
3308
|
+
eventName: "SkipFailingIncorrectSummary",
|
|
3309
|
+
referenceSequenceNumber,
|
|
3310
|
+
minimumSequenceNumber,
|
|
3311
|
+
beforeGenerate: beforeSummaryGeneration,
|
|
3312
|
+
},
|
|
3313
|
+
error,
|
|
3314
|
+
);
|
|
3315
|
+
} else {
|
|
3316
|
+
// The retry delay when there are pending ops can be overridden via config so that we can adjust it
|
|
3317
|
+
// based on telemetry while we decide on a stable number.
|
|
3318
|
+
const retryDelayMs =
|
|
3319
|
+
this.mc.config.getNumber("Fluid.Summarizer.PendingOpsRetryDelayMs") ??
|
|
3320
|
+
defaultPendingOpsRetryDelayMs;
|
|
3321
|
+
const error = new RetriableSummaryError(
|
|
3322
|
+
"PendingOpsWhileSummarizing",
|
|
3323
|
+
retryDelayMs / 1000,
|
|
3324
|
+
{
|
|
3325
|
+
count: this.pendingMessagesCount,
|
|
3326
|
+
beforeGenerate: beforeSummaryGeneration,
|
|
3327
|
+
},
|
|
3328
|
+
);
|
|
3329
|
+
return {
|
|
3330
|
+
stage: "base",
|
|
3331
|
+
referenceSequenceNumber,
|
|
3332
|
+
minimumSequenceNumber,
|
|
3333
|
+
error,
|
|
3334
|
+
};
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3261
3338
|
private get pendingMessagesCount(): number {
|
|
3262
3339
|
return this.pendingStateManager.pendingMessagesCount + this.outbox.messageCount;
|
|
3263
3340
|
}
|
|
@@ -3657,12 +3734,22 @@ export class ContainerRuntime
|
|
|
3657
3734
|
/** Implementation of ISummarizerInternalsProvider.refreshLatestSummaryAck */
|
|
3658
3735
|
public async refreshLatestSummaryAck(options: IRefreshSummaryAckOptions) {
|
|
3659
3736
|
const { proposalHandle, ackHandle, summaryRefSeq, summaryLogger } = options;
|
|
3737
|
+
// proposalHandle is always passed from RunningSummarizer.
|
|
3738
|
+
assert(proposalHandle !== undefined, 0x766 /* proposalHandle should be available */);
|
|
3660
3739
|
const readAndParseBlob = async <T>(id: string) => readAndParse<T>(this.storage, id);
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3740
|
+
const result = await this.summarizerNode.refreshLatestSummary(
|
|
3741
|
+
proposalHandle,
|
|
3742
|
+
summaryRefSeq,
|
|
3743
|
+
);
|
|
3744
|
+
|
|
3745
|
+
/**
|
|
3746
|
+
* When refreshing a summary ack, this check indicates a new ack of a summary that is newer than the
|
|
3747
|
+
* current summary that is tracked, but this summarizer runtime did not produce/track that summary. Thus
|
|
3748
|
+
* it needs to refresh its state. Today refresh is done by fetching the latest snapshot to update the cache
|
|
3749
|
+
* and then close as the current main client is likely to be re-elected as the parent summarizer again.
|
|
3750
|
+
*/
|
|
3751
|
+
if (!result.isSummaryTracked && result.isSummaryNewer) {
|
|
3752
|
+
const fetchResult = await this.fetchSnapshotFromStorage(
|
|
3666
3753
|
summaryLogger,
|
|
3667
3754
|
{
|
|
3668
3755
|
eventName: "RefreshLatestSummaryAckFetch",
|
|
@@ -3673,25 +3760,6 @@ export class ContainerRuntime
|
|
|
3673
3760
|
null,
|
|
3674
3761
|
);
|
|
3675
3762
|
|
|
3676
|
-
/**
|
|
3677
|
-
* back-compat - Older loaders and drivers (pre 2.0.0-internal.1.4) don't have fetchSource as a param in the
|
|
3678
|
-
* getVersions API. So, they will not fetch the latest snapshot from network in the previous fetch call. For
|
|
3679
|
-
* these scenarios, fetch the snapshot corresponding to the ack handle to have the same behavior before the
|
|
3680
|
-
* change that started fetching latest snapshot always.
|
|
3681
|
-
*/
|
|
3682
|
-
if (fetchResult.latestSnapshotRefSeq < summaryRefSeq) {
|
|
3683
|
-
fetchResult = await this.fetchSnapshotFromStorageAndMaybeClose(
|
|
3684
|
-
summaryLogger,
|
|
3685
|
-
{
|
|
3686
|
-
eventName: "RefreshLatestSummaryAckFetchBackCompat",
|
|
3687
|
-
ackHandle,
|
|
3688
|
-
targetSequenceNumber: summaryRefSeq,
|
|
3689
|
-
},
|
|
3690
|
-
readAndParseBlob,
|
|
3691
|
-
ackHandle,
|
|
3692
|
-
);
|
|
3693
|
-
}
|
|
3694
|
-
|
|
3695
3763
|
/**
|
|
3696
3764
|
* If the fetched snapshot is older than the one for which the ack was received, close the container.
|
|
3697
3765
|
* This should never happen because an ack should be sent after the latest summary is updated in the server.
|
|
@@ -3717,29 +3785,12 @@ export class ContainerRuntime
|
|
|
3717
3785
|
throw error;
|
|
3718
3786
|
}
|
|
3719
3787
|
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
fetchResult.latestSnapshotRefSeq,
|
|
3724
|
-
summaryLogger,
|
|
3725
|
-
);
|
|
3726
|
-
|
|
3727
|
-
return {
|
|
3728
|
-
snapshotTree: fetchResult.snapshotTree,
|
|
3729
|
-
snapshotRefSeq: fetchResult.latestSnapshotRefSeq,
|
|
3730
|
-
};
|
|
3731
|
-
};
|
|
3732
|
-
|
|
3733
|
-
const result = await this.summarizerNode.refreshLatestSummary(
|
|
3734
|
-
proposalHandle,
|
|
3735
|
-
summaryRefSeq,
|
|
3736
|
-
fetchLatestSnapshot,
|
|
3737
|
-
readAndParseBlob,
|
|
3738
|
-
summaryLogger,
|
|
3739
|
-
);
|
|
3788
|
+
await this.closeStaleSummarizer("RefreshLatestSummaryAckFetch");
|
|
3789
|
+
return;
|
|
3790
|
+
}
|
|
3740
3791
|
|
|
3741
3792
|
// Notify the garbage collector so it can update its latest summary state.
|
|
3742
|
-
await this.garbageCollector.refreshLatestSummary(
|
|
3793
|
+
await this.garbageCollector.refreshLatestSummary(result);
|
|
3743
3794
|
}
|
|
3744
3795
|
|
|
3745
3796
|
/**
|
|
@@ -3752,49 +3803,49 @@ export class ContainerRuntime
|
|
|
3752
3803
|
summaryLogger: ITelemetryLoggerExt,
|
|
3753
3804
|
): Promise<{ latestSnapshotRefSeq: number; latestSnapshotVersionId: string | undefined }> {
|
|
3754
3805
|
const readAndParseBlob = async <T>(id: string) => readAndParse<T>(this.storage, id);
|
|
3755
|
-
const {
|
|
3756
|
-
await this.fetchSnapshotFromStorageAndMaybeClose(
|
|
3757
|
-
summaryLogger,
|
|
3758
|
-
{
|
|
3759
|
-
eventName: "RefreshLatestSummaryFromServerFetch",
|
|
3760
|
-
},
|
|
3761
|
-
readAndParseBlob,
|
|
3762
|
-
null,
|
|
3763
|
-
);
|
|
3764
|
-
const fetchLatestSnapshot: IFetchSnapshotResult = {
|
|
3765
|
-
snapshotTree,
|
|
3766
|
-
snapshotRefSeq: latestSnapshotRefSeq,
|
|
3767
|
-
};
|
|
3768
|
-
const result = await this.summarizerNode.refreshLatestSummary(
|
|
3769
|
-
undefined /* proposalHandle */,
|
|
3770
|
-
latestSnapshotRefSeq,
|
|
3771
|
-
async () => fetchLatestSnapshot,
|
|
3772
|
-
readAndParseBlob,
|
|
3806
|
+
const { versionId, latestSnapshotRefSeq } = await this.fetchSnapshotFromStorage(
|
|
3773
3807
|
summaryLogger,
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
await this.garbageCollector.refreshLatestSummary(
|
|
3778
|
-
undefined /* proposalHandle */,
|
|
3779
|
-
result,
|
|
3808
|
+
{
|
|
3809
|
+
eventName: "RefreshLatestSummaryFromServerFetch",
|
|
3810
|
+
},
|
|
3780
3811
|
readAndParseBlob,
|
|
3812
|
+
null,
|
|
3781
3813
|
);
|
|
3782
3814
|
|
|
3815
|
+
await this.closeStaleSummarizer("RefreshLatestSummaryFromServerFetch");
|
|
3816
|
+
|
|
3783
3817
|
return { latestSnapshotRefSeq, latestSnapshotVersionId: versionId };
|
|
3784
3818
|
}
|
|
3785
3819
|
|
|
3820
|
+
private async closeStaleSummarizer(codePath: string): Promise<void> {
|
|
3821
|
+
this.mc.logger.sendTelemetryEvent(
|
|
3822
|
+
{
|
|
3823
|
+
eventName: "ClosingSummarizerOnSummaryStale",
|
|
3824
|
+
codePath,
|
|
3825
|
+
message: "Stopping fetch from storage",
|
|
3826
|
+
closeSummarizerDelayMs: this.closeSummarizerDelayMs,
|
|
3827
|
+
},
|
|
3828
|
+
new GenericError("Restarting summarizer instead of refreshing"),
|
|
3829
|
+
);
|
|
3830
|
+
|
|
3831
|
+
// Delay before restarting summarizer to prevent the summarizer from restarting too frequently.
|
|
3832
|
+
await delay(this.closeSummarizerDelayMs);
|
|
3833
|
+
this._summarizer?.stop("latestSummaryStateStale");
|
|
3834
|
+
this.disposeFn();
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3786
3837
|
/**
|
|
3787
3838
|
* Downloads snapshot from storage with the given versionId or latest if versionId is null.
|
|
3788
3839
|
* By default, it also closes the container after downloading the snapshot. However, this may be
|
|
3789
3840
|
* overridden via options.
|
|
3790
3841
|
*/
|
|
3791
|
-
private async
|
|
3842
|
+
private async fetchSnapshotFromStorage(
|
|
3792
3843
|
logger: ITelemetryLoggerExt,
|
|
3793
3844
|
event: ITelemetryGenericEvent,
|
|
3794
3845
|
readAndParseBlob: ReadAndParseBlob,
|
|
3795
3846
|
versionId: string | null,
|
|
3796
3847
|
): Promise<{ snapshotTree: ISnapshotTree; versionId: string; latestSnapshotRefSeq: number }> {
|
|
3797
|
-
|
|
3848
|
+
return PerformanceEvent.timedExecAsync(
|
|
3798
3849
|
logger,
|
|
3799
3850
|
event,
|
|
3800
3851
|
async (perfEvent: {
|
|
@@ -3840,30 +3891,6 @@ export class ContainerRuntime
|
|
|
3840
3891
|
};
|
|
3841
3892
|
},
|
|
3842
3893
|
);
|
|
3843
|
-
|
|
3844
|
-
// We choose to close the summarizer after the snapshot cache is updated to avoid
|
|
3845
|
-
// situations which the main client (which is likely to be re-elected as the leader again)
|
|
3846
|
-
// loads the summarizer from cache.
|
|
3847
|
-
if (this.summaryStateUpdateMethod !== "refreshFromSnapshot") {
|
|
3848
|
-
this.mc.logger.sendTelemetryEvent(
|
|
3849
|
-
{
|
|
3850
|
-
...event,
|
|
3851
|
-
eventName: "ClosingSummarizerOnSummaryStale",
|
|
3852
|
-
codePath: event.eventName,
|
|
3853
|
-
message: "Stopping fetch from storage",
|
|
3854
|
-
versionId: versionId != null ? versionId : undefined,
|
|
3855
|
-
closeSummarizerDelayMs: this.closeSummarizerDelayMs,
|
|
3856
|
-
},
|
|
3857
|
-
new GenericError("Restarting summarizer instead of refreshing"),
|
|
3858
|
-
);
|
|
3859
|
-
|
|
3860
|
-
// Delay before restarting summarizer to prevent the summarizer from restarting too frequently.
|
|
3861
|
-
await delay(this.closeSummarizerDelayMs);
|
|
3862
|
-
this._summarizer?.stop("latestSummaryStateStale");
|
|
3863
|
-
this.disposeFn();
|
|
3864
|
-
}
|
|
3865
|
-
|
|
3866
|
-
return snapshotResults;
|
|
3867
3894
|
}
|
|
3868
3895
|
|
|
3869
3896
|
public notifyAttaching() {} // do nothing (deprecated method)
|
|
@@ -3871,27 +3898,41 @@ export class ContainerRuntime
|
|
|
3871
3898
|
public async getPendingLocalState(props?: {
|
|
3872
3899
|
notifyImminentClosure: boolean;
|
|
3873
3900
|
}): Promise<unknown> {
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3901
|
+
return PerformanceEvent.timedExecAsync(
|
|
3902
|
+
this.mc.logger,
|
|
3903
|
+
{
|
|
3904
|
+
eventName: "getPendingLocalState",
|
|
3905
|
+
notifyImminentClosure: props?.notifyImminentClosure,
|
|
3906
|
+
},
|
|
3907
|
+
async (event) => {
|
|
3908
|
+
this.verifyNotClosed();
|
|
3909
|
+
const waitBlobsToAttach = props?.notifyImminentClosure;
|
|
3910
|
+
if (this._orderSequentiallyCalls !== 0) {
|
|
3911
|
+
throw new UsageError("can't get state during orderSequentially");
|
|
3912
|
+
}
|
|
3913
|
+
const pendingAttachmentBlobs = await this.blobManager.getPendingBlobs(
|
|
3914
|
+
waitBlobsToAttach,
|
|
3915
|
+
);
|
|
3916
|
+
const pending = this.pendingStateManager.getLocalState();
|
|
3917
|
+
if (!pendingAttachmentBlobs && !this.hasPendingMessages()) {
|
|
3918
|
+
return; // no pending state to save
|
|
3919
|
+
}
|
|
3920
|
+
// Flush pending batch.
|
|
3921
|
+
// getPendingLocalState() is only exposed through Container.closeAndGetPendingLocalState(), so it's safe
|
|
3922
|
+
// to close current batch.
|
|
3923
|
+
this.flush();
|
|
3889
3924
|
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3925
|
+
const pendingState: IPendingRuntimeState = {
|
|
3926
|
+
pending,
|
|
3927
|
+
pendingAttachmentBlobs,
|
|
3928
|
+
};
|
|
3929
|
+
event.end({
|
|
3930
|
+
attachmentBlobsSize: Object.keys(pendingAttachmentBlobs ?? {}).length,
|
|
3931
|
+
pendingOpsSize: pending?.pendingStates.length,
|
|
3932
|
+
});
|
|
3933
|
+
return pendingState;
|
|
3934
|
+
},
|
|
3935
|
+
);
|
|
3895
3936
|
}
|
|
3896
3937
|
|
|
3897
3938
|
public summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults {
|
package/src/dataStore.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryLoggerExt, TelemetryDataTag, UsageError } from "@fluidframework/telemetry-utils";
|
|
7
|
-
import { assert, unreachableCase } from "@fluidframework/
|
|
7
|
+
import { assert, unreachableCase } from "@fluidframework/core-utils";
|
|
8
8
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
9
9
|
import { FluidObject, IFluidHandle, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
10
10
|
import {
|
package/src/dataStoreContext.ts
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
AttachState,
|
|
18
18
|
ILoaderOptions,
|
|
19
19
|
} from "@fluidframework/container-definitions";
|
|
20
|
-
import {
|
|
21
|
-
import { LazyPromise } from "@fluidframework/core-utils";
|
|
20
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
21
|
+
import { assert, Deferred, LazyPromise } from "@fluidframework/core-utils";
|
|
22
22
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
23
23
|
import { BlobTreeEntry, readAndParse } from "@fluidframework/driver-utils";
|
|
24
24
|
import {
|
package/src/dataStoreContexts.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert, Deferred } from "@fluidframework/
|
|
7
|
-
import { Lazy } from "@fluidframework/core-utils";
|
|
6
|
+
import { assert, Deferred, Lazy } from "@fluidframework/core-utils";
|
|
8
7
|
import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
9
8
|
import { createChildLogger, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
10
9
|
import { FluidDataStoreContext, LocalFluidDataStoreContext } from "./dataStoreContext";
|
package/src/dataStores.ts
CHANGED
|
@@ -47,8 +47,7 @@ import {
|
|
|
47
47
|
} from "@fluidframework/telemetry-utils";
|
|
48
48
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
49
49
|
import { buildSnapshotTree } from "@fluidframework/driver-utils";
|
|
50
|
-
import { assert } from "@fluidframework/
|
|
51
|
-
import { Lazy } from "@fluidframework/core-utils";
|
|
50
|
+
import { assert, Lazy } from "@fluidframework/core-utils";
|
|
52
51
|
import { v4 as uuid } from "uuid";
|
|
53
52
|
import { DataStoreContexts } from "./dataStoreContexts";
|
|
54
53
|
import {
|
package/src/deltaScheduler.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryLoggerExt, formatTick } from "@fluidframework/telemetry-utils";
|
|
7
|
-
import { performance } from "@
|
|
7
|
+
import { performance } from "@fluid-internal/client-utils";
|
|
8
8
|
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
9
9
|
import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
10
10
|
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { Timer } from "@fluidframework/
|
|
7
|
-
import { LazyPromise } from "@fluidframework/core-utils";
|
|
6
|
+
import { LazyPromise, Timer } from "@fluidframework/core-utils";
|
|
8
7
|
import { IRequest, IRequestHeader } from "@fluidframework/core-interfaces";
|
|
9
8
|
import {
|
|
10
9
|
gcTreeKey,
|
|
@@ -13,11 +12,7 @@ import {
|
|
|
13
12
|
ISummarizeResult,
|
|
14
13
|
ITelemetryContext,
|
|
15
14
|
} from "@fluidframework/runtime-definitions";
|
|
16
|
-
import {
|
|
17
|
-
ReadAndParseBlob,
|
|
18
|
-
createResponseError,
|
|
19
|
-
responseToException,
|
|
20
|
-
} from "@fluidframework/runtime-utils";
|
|
15
|
+
import { createResponseError, responseToException } from "@fluidframework/runtime-utils";
|
|
21
16
|
import {
|
|
22
17
|
createChildLogger,
|
|
23
18
|
createChildMonitoringContext,
|
|
@@ -33,7 +28,7 @@ import {
|
|
|
33
28
|
RuntimeHeaders,
|
|
34
29
|
} from "../containerRuntime";
|
|
35
30
|
import { ClientSessionExpiredError } from "../error";
|
|
36
|
-
import {
|
|
31
|
+
import { IRefreshSummaryResult } from "../summary";
|
|
37
32
|
import { generateGCConfigs } from "./gcConfigs";
|
|
38
33
|
import {
|
|
39
34
|
GCNodeType,
|
|
@@ -847,40 +842,10 @@ export class GarbageCollector implements IGarbageCollector {
|
|
|
847
842
|
}
|
|
848
843
|
|
|
849
844
|
/**
|
|
850
|
-
* Called to refresh the latest summary state. This happens when either a pending summary is acked
|
|
851
|
-
* is downloaded and should be used to update the state.
|
|
845
|
+
* Called to refresh the latest summary state. This happens when either a pending summary is acked.
|
|
852
846
|
*/
|
|
853
|
-
public async refreshLatestSummary(
|
|
854
|
-
|
|
855
|
-
result: RefreshSummaryResult,
|
|
856
|
-
readAndParseBlob: ReadAndParseBlob,
|
|
857
|
-
): Promise<void> {
|
|
858
|
-
const latestSnapshotData = await this.summaryStateTracker.refreshLatestSummary(
|
|
859
|
-
proposalHandle,
|
|
860
|
-
result,
|
|
861
|
-
readAndParseBlob,
|
|
862
|
-
);
|
|
863
|
-
|
|
864
|
-
// If the latest summary was updated but it was not tracked by this client, our state needs to be updated from
|
|
865
|
-
// this snapshot data.
|
|
866
|
-
if (this.shouldRunGC && result.latestSummaryUpdated && !result.wasSummaryTracked) {
|
|
867
|
-
// The current reference timestamp should be available if we are refreshing state from a snapshot. There has
|
|
868
|
-
// to be at least one op (summary op / ack, if nothing else) if a snapshot was taken.
|
|
869
|
-
const currentReferenceTimestampMs = this.runtime.getCurrentReferenceTimestampMs();
|
|
870
|
-
if (currentReferenceTimestampMs === undefined) {
|
|
871
|
-
throw DataProcessingError.create(
|
|
872
|
-
"No reference timestamp when updating GC state from snapshot",
|
|
873
|
-
"refreshLatestSummary",
|
|
874
|
-
undefined,
|
|
875
|
-
{
|
|
876
|
-
proposalHandle,
|
|
877
|
-
summaryRefSeq: result.summaryRefSeq,
|
|
878
|
-
gcConfigs: JSON.stringify(this.configs),
|
|
879
|
-
},
|
|
880
|
-
);
|
|
881
|
-
}
|
|
882
|
-
this.updateStateFromSnapshotData(latestSnapshotData, currentReferenceTimestampMs);
|
|
883
|
-
}
|
|
847
|
+
public async refreshLatestSummary(result: IRefreshSummaryResult): Promise<void> {
|
|
848
|
+
return this.summaryStateTracker.refreshLatestSummary(result);
|
|
884
849
|
}
|
|
885
850
|
|
|
886
851
|
/**
|
package/src/gc/gcDefinitions.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
|
17
17
|
import {
|
|
18
18
|
IContainerRuntimeMetadata,
|
|
19
19
|
ICreateContainerMetadata,
|
|
20
|
-
|
|
20
|
+
IRefreshSummaryResult,
|
|
21
21
|
} from "../summary";
|
|
22
22
|
|
|
23
23
|
export type GCVersion = number;
|
|
@@ -228,11 +228,7 @@ export interface IGarbageCollector {
|
|
|
228
228
|
/** Returns the GC details generated from the base snapshot. */
|
|
229
229
|
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
230
230
|
/** Called when the latest summary of the system has been refreshed. */
|
|
231
|
-
refreshLatestSummary(
|
|
232
|
-
proposalHandle: string | undefined,
|
|
233
|
-
result: RefreshSummaryResult,
|
|
234
|
-
readAndParseBlob: ReadAndParseBlob,
|
|
235
|
-
): Promise<void>;
|
|
231
|
+
refreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;
|
|
236
232
|
/** Called when a node is updated. Used to detect and log when an inactive node is changed or loaded. */
|
|
237
233
|
nodeUpdated(
|
|
238
234
|
nodePath: string,
|
package/src/gc/gcHelpers.ts
CHANGED