@fluidframework/container-runtime 2.0.0-internal.6.2.0 → 2.0.0-internal.6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +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
|
@@ -12,12 +12,11 @@ import {
|
|
|
12
12
|
ISummarizeResult,
|
|
13
13
|
ISummaryTreeWithStats,
|
|
14
14
|
} from "@fluidframework/runtime-definitions";
|
|
15
|
-
import { mergeStats,
|
|
16
|
-
import {
|
|
17
|
-
import { GCVersion, IGCStats } from "./gcDefinitions";
|
|
18
|
-
import {
|
|
15
|
+
import { mergeStats, SummaryTreeBuilder } from "@fluidframework/runtime-utils";
|
|
16
|
+
import { IRefreshSummaryResult } from "../summary";
|
|
17
|
+
import { GCVersion, IGarbageCollectorConfigs, IGCStats } from "./gcDefinitions";
|
|
18
|
+
import { generateSortedGCState } from "./gcHelpers";
|
|
19
19
|
import { IGarbageCollectionSnapshotData, IGarbageCollectionState } from "./gcSummaryDefinitions";
|
|
20
|
-
import { IGarbageCollectorConfigs } from ".";
|
|
21
20
|
|
|
22
21
|
export const gcStateBlobKey = `${gcBlobPrefix}_root`;
|
|
23
22
|
|
|
@@ -264,72 +263,27 @@ export class GCSummaryStateTracker {
|
|
|
264
263
|
}
|
|
265
264
|
|
|
266
265
|
/**
|
|
267
|
-
* Called to refresh the latest summary state. This happens when either a pending summary is acked
|
|
268
|
-
* is downloaded and should be used to update the state.
|
|
266
|
+
* Called to refresh the latest summary state. This happens when either a pending summary is acked.
|
|
269
267
|
*/
|
|
270
|
-
public async refreshLatestSummary(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
readAndParseBlob: ReadAndParseBlob,
|
|
274
|
-
): Promise<IGarbageCollectionSnapshotData | undefined> {
|
|
275
|
-
// If the latest summary was updated and the summary was tracked, this client is the one that generated this
|
|
276
|
-
// summary. So, update wasGCRunInLatestSummary.
|
|
277
|
-
// Note that this has to be updated if GC did not run too. Otherwise, `gcStateNeedsReset` will always return
|
|
278
|
-
// true in scenarios where GC is disabled but enabled in the snapshot we loaded from.
|
|
279
|
-
if (result.latestSummaryUpdated && result.wasSummaryTracked) {
|
|
280
|
-
this.wasGCRunInLatestSummary = this.configs.shouldRunGC;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (!result.latestSummaryUpdated || !this.configs.shouldRunGC) {
|
|
284
|
-
return undefined;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// If the summary was tracked by this client, it was the one that generated the summary in the first place.
|
|
288
|
-
// Update latest state from pending.
|
|
289
|
-
if (result.wasSummaryTracked) {
|
|
290
|
-
this.latestSummaryGCVersion = this.configs.gcVersionInEffect;
|
|
291
|
-
this.latestSummaryData = this.pendingSummaryData;
|
|
292
|
-
this.pendingSummaryData = undefined;
|
|
293
|
-
this.updatedDSCountSinceLastSummary = 0;
|
|
294
|
-
return undefined;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// If the summary was not tracked by this client, the state should be updated from the downloaded snapshot.
|
|
298
|
-
const snapshotTree = result.snapshotTree;
|
|
299
|
-
const metadataBlobId = snapshotTree.blobs[metadataBlobName];
|
|
300
|
-
const metadata = metadataBlobId
|
|
301
|
-
? await readAndParseBlob<IContainerRuntimeMetadata>(metadataBlobId)
|
|
302
|
-
: undefined;
|
|
303
|
-
this.latestSummaryGCVersion = getGCVersion(metadata);
|
|
304
|
-
|
|
305
|
-
const gcSnapshotTree = snapshotTree.trees[gcTreeKey];
|
|
306
|
-
// If GC ran in the container that generated this snapshot, it will have a GC tree.
|
|
307
|
-
this.wasGCRunInLatestSummary = gcSnapshotTree !== undefined;
|
|
308
|
-
|
|
309
|
-
if (gcSnapshotTree === undefined) {
|
|
310
|
-
return undefined;
|
|
268
|
+
public async refreshLatestSummary(result: IRefreshSummaryResult): Promise<void> {
|
|
269
|
+
if (!result.isSummaryTracked) {
|
|
270
|
+
return;
|
|
311
271
|
}
|
|
312
272
|
|
|
313
|
-
|
|
273
|
+
// If the summary is tracked, this client is the one that generated it. So, update wasGCRunInLatestSummary.
|
|
274
|
+
// Note that this has to be updated if GC did not run too. Otherwise, `gcStateNeedsReset` will always return
|
|
275
|
+
// true in scenarios where GC is currently disabled but enabled in the snapshot we loaded from.
|
|
276
|
+
this.wasGCRunInLatestSummary = this.configs.shouldRunGC;
|
|
314
277
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
// because irrespective of GC versions, these nodes have been deleted and cannot be brought back. The
|
|
318
|
-
// deletedNodes info is needed to identify when these nodes are used.
|
|
319
|
-
if (getGCVersion(metadata) !== this.configs.gcVersionInEffect) {
|
|
320
|
-
snapshotData = {
|
|
321
|
-
gcState: undefined,
|
|
322
|
-
tombstones: undefined,
|
|
323
|
-
deletedNodes: snapshotData.deletedNodes,
|
|
324
|
-
};
|
|
278
|
+
if (!this.configs.shouldRunGC) {
|
|
279
|
+
return;
|
|
325
280
|
}
|
|
326
281
|
|
|
327
|
-
this.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
return snapshotData;
|
|
282
|
+
this.latestSummaryGCVersion = this.configs.gcVersionInEffect;
|
|
283
|
+
this.latestSummaryData = this.pendingSummaryData;
|
|
284
|
+
this.pendingSummaryData = undefined;
|
|
285
|
+
this.updatedDSCountSinceLastSummary = 0;
|
|
286
|
+
return;
|
|
333
287
|
}
|
|
334
288
|
|
|
335
289
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert, Timer } from "@fluidframework/
|
|
6
|
+
import { assert, Timer } from "@fluidframework/core-utils";
|
|
7
7
|
import { UnreferencedState } from "./gcDefinitions";
|
|
8
8
|
|
|
9
9
|
/** A wrapper around common-utils Timer that requires the timeout when calling start/restart */
|
package/src/gc/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/
|
|
6
|
+
import { assert } from "@fluidframework/core-utils";
|
|
7
7
|
import { IdCluster, clustersEqual, lastAllocatedFinal, lastFinalizedFinal } from "./sessions";
|
|
8
8
|
import { FinalCompressedId } from "./identifiers";
|
|
9
9
|
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert
|
|
6
|
+
import { assert } from "@fluidframework/core-utils";
|
|
7
|
+
import { bufferToString, stringToBuffer } from "@fluid-internal/client-utils";
|
|
7
8
|
import {
|
|
8
9
|
IdCreationRange,
|
|
9
10
|
IIdCompressor,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import BTree from "sorted-btree";
|
|
7
7
|
import { SessionId, StableId } from "@fluidframework/runtime-definitions";
|
|
8
|
-
import { assert } from "@fluidframework/
|
|
8
|
+
import { assert } from "@fluidframework/core-utils";
|
|
9
9
|
import {
|
|
10
10
|
compareBigints,
|
|
11
11
|
localIdFromGenCount,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/* eslint-disable no-bitwise */
|
|
7
|
-
import { assert } from "@fluidframework/
|
|
7
|
+
import { assert } from "@fluidframework/core-utils";
|
|
8
8
|
import { SessionId, StableId } from "@fluidframework/runtime-definitions";
|
|
9
9
|
import { v4 } from "uuid";
|
|
10
10
|
import { LocalCompressedId, NumericUuid } from "./identifiers";
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { createChildLogger, UsageError } from "@fluidframework/telemetry-utils";
|
|
7
|
-
import { assert
|
|
7
|
+
import { assert } from "@fluidframework/core-utils";
|
|
8
|
+
import { IsoBuffer } from "@fluid-internal/client-utils";
|
|
8
9
|
import { compress } from "lz4js";
|
|
9
10
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
10
11
|
import { CompressionAlgorithms } from "../containerRuntime";
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { decompress } from "lz4js";
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { assert
|
|
8
|
+
import { assert } from "@fluidframework/core-utils";
|
|
9
|
+
import { IsoBuffer, Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
9
10
|
import { createChildLogger } from "@fluidframework/telemetry-utils";
|
|
10
11
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
11
12
|
import { CompressionAlgorithms } from "../containerRuntime";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/
|
|
6
|
+
import { assert } from "@fluidframework/core-utils";
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import { ContainerMessageType } from "..";
|
|
9
9
|
import { IBatch } from "./definitions";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
DataCorruptionError,
|
|
9
9
|
extractSafePropertiesFromMessage,
|
|
10
10
|
} from "@fluidframework/telemetry-utils";
|
|
11
|
-
import { assert } from "@fluidframework/
|
|
11
|
+
import { assert } from "@fluidframework/core-utils";
|
|
12
12
|
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
13
13
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
14
14
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
MonitoringContext,
|
|
10
10
|
UsageError,
|
|
11
11
|
} from "@fluidframework/telemetry-utils";
|
|
12
|
-
import { assert } from "@fluidframework/
|
|
12
|
+
import { assert } from "@fluidframework/core-utils";
|
|
13
13
|
import { IBatchMessage, ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
14
14
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
15
15
|
import { ICompressionRuntimeOptions } from "../containerRuntime";
|
package/src/packageVersion.ts
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
import Deque from "double-ended-queue";
|
|
7
7
|
|
|
8
8
|
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
9
|
-
import { assert } from "@fluidframework/
|
|
9
|
+
import { assert, Lazy } from "@fluidframework/core-utils";
|
|
10
10
|
import { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
11
|
-
import { Lazy } from "@fluidframework/core-utils";
|
|
12
11
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
13
12
|
import { DataProcessingError, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
14
13
|
|
package/src/scheduleManager.ts
CHANGED
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
extractSafePropertiesFromMessage,
|
|
13
13
|
ITelemetryLoggerExt,
|
|
14
14
|
} from "@fluidframework/telemetry-utils";
|
|
15
|
-
import { assert
|
|
15
|
+
import { assert } from "@fluidframework/core-utils";
|
|
16
|
+
import { performance } from "@fluid-internal/client-utils";
|
|
16
17
|
import { isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
17
18
|
import { DeltaScheduler } from "./deltaScheduler";
|
|
18
19
|
import { pkgVersion } from "./packageVersion";
|
package/src/summary/index.ts
CHANGED
|
@@ -28,10 +28,9 @@ export { SummarizeHeuristicData, SummarizeHeuristicRunner } from "./summarizerHe
|
|
|
28
28
|
export {
|
|
29
29
|
createRootSummarizerNode,
|
|
30
30
|
createRootSummarizerNodeWithGC,
|
|
31
|
-
|
|
31
|
+
IRefreshSummaryResult,
|
|
32
32
|
IRootSummarizerNode,
|
|
33
33
|
IRootSummarizerNodeWithGC,
|
|
34
|
-
RefreshSummaryResult,
|
|
35
34
|
} from "./summarizerNode";
|
|
36
35
|
export {
|
|
37
36
|
IConnectableRuntime,
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
createChildLogger,
|
|
10
10
|
UsageError,
|
|
11
11
|
} from "@fluidframework/telemetry-utils";
|
|
12
|
-
import { assert
|
|
12
|
+
import { assert } from "@fluidframework/core-utils";
|
|
13
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
13
14
|
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
14
15
|
import { IClient, IQuorumClients, ISequencedClient } from "@fluidframework/protocol-definitions";
|
|
15
16
|
import { summarizerClientType } from "./summarizerClientElection";
|
|
@@ -11,14 +11,9 @@ import {
|
|
|
11
11
|
createChildLogger,
|
|
12
12
|
UsageError,
|
|
13
13
|
} from "@fluidframework/telemetry-utils";
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Deferred,
|
|
18
|
-
PromiseTimer,
|
|
19
|
-
TypedEventEmitter,
|
|
20
|
-
} from "@fluidframework/common-utils";
|
|
21
|
-
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
14
|
+
import { assert, delay, Deferred, PromiseTimer } from "@fluidframework/core-utils";
|
|
15
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
16
|
+
import { DriverErrorTypes } from "@fluidframework/driver-definitions";
|
|
22
17
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
23
18
|
import { ISummaryConfiguration } from "../containerRuntime";
|
|
24
19
|
import { opSize } from "../opProperties";
|
|
@@ -316,7 +311,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
316
311
|
// by calling `refreshLatestSummaryAckFromServer` and we will be fine.
|
|
317
312
|
const isIgnoredError =
|
|
318
313
|
isFluidError(error) &&
|
|
319
|
-
error.errorType ===
|
|
314
|
+
error.errorType === DriverErrorTypes.fileNotFoundOrAccessDeniedError;
|
|
320
315
|
|
|
321
316
|
summaryLogger.sendTelemetryEvent(
|
|
322
317
|
{
|
|
@@ -606,7 +601,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
606
601
|
this.beforeSummaryAction();
|
|
607
602
|
},
|
|
608
603
|
async () => {
|
|
609
|
-
return this.mc.config.getBoolean("Fluid.Summarizer.
|
|
604
|
+
return this.mc.config.getBoolean("Fluid.Summarizer.UseDynamicRetries")
|
|
610
605
|
? this.trySummarizeWithRetries(reason)
|
|
611
606
|
: this.trySummarizeWithStaticAttempts(reason);
|
|
612
607
|
},
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { Deferred
|
|
6
|
+
import { Deferred } from "@fluidframework/core-utils";
|
|
7
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
8
|
import {
|
|
8
9
|
ITelemetryLoggerExt,
|
|
9
10
|
createChildLogger,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { IEvent, IEventProvider } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
8
|
-
import { TypedEventEmitter } from "@
|
|
8
|
+
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
9
9
|
import { IClientDetails, MessageType } from "@fluidframework/protocol-definitions";
|
|
10
10
|
import {
|
|
11
11
|
IOrderedClientElection,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
|
-
import { Timer } from "@fluidframework/
|
|
7
|
+
import { Timer } from "@fluidframework/core-utils";
|
|
8
8
|
import { ISummaryConfigurationHeuristics } from "../containerRuntime";
|
|
9
9
|
import {
|
|
10
10
|
ISummarizeHeuristicData,
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
IRefreshSummaryResult,
|
|
8
8
|
ISummarizerNodeRootContract,
|
|
9
|
-
RefreshSummaryResult,
|
|
10
9
|
ValidateSummaryResult,
|
|
11
10
|
} from "./summarizerNodeUtils";
|
|
12
11
|
export { IRootSummarizerNode, createRootSummarizerNode } from "./summarizerNode";
|
|
@@ -29,22 +29,16 @@ import {
|
|
|
29
29
|
TelemetryDataTag,
|
|
30
30
|
tagCodeArtifacts,
|
|
31
31
|
} from "@fluidframework/telemetry-utils";
|
|
32
|
-
import { assert, unreachableCase } from "@fluidframework/
|
|
33
|
-
import {
|
|
34
|
-
convertToSummaryTree,
|
|
35
|
-
calculateStats,
|
|
36
|
-
mergeStats,
|
|
37
|
-
ReadAndParseBlob,
|
|
38
|
-
} from "@fluidframework/runtime-utils";
|
|
32
|
+
import { assert, unreachableCase } from "@fluidframework/core-utils";
|
|
33
|
+
import { convertToSummaryTree, calculateStats, mergeStats } from "@fluidframework/runtime-utils";
|
|
39
34
|
import {
|
|
40
35
|
EscapedPath,
|
|
41
36
|
ICreateChildDetails,
|
|
42
|
-
IFetchSnapshotResult,
|
|
43
37
|
IInitialSummary,
|
|
38
|
+
IRefreshSummaryResult,
|
|
44
39
|
ISummarizerNodeRootContract,
|
|
45
40
|
parseSummaryForSubtrees,
|
|
46
41
|
parseSummaryTreeForSubtrees,
|
|
47
|
-
RefreshSummaryResult,
|
|
48
42
|
SummaryNode,
|
|
49
43
|
ValidateSummaryResult,
|
|
50
44
|
} from "./summarizerNodeUtils";
|
|
@@ -371,31 +365,21 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
371
365
|
|
|
372
366
|
/**
|
|
373
367
|
* Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,
|
|
374
|
-
* it becomes the latest summary. If the current summary is already ahead
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
* @returns A RefreshSummaryResult type which returns information based on the following three scenarios:
|
|
378
|
-
*
|
|
379
|
-
* 1. The latest summary was not updated.
|
|
368
|
+
* it becomes the latest summary. If the current summary is already ahead, we skip the update.
|
|
369
|
+
* If the current summary is behind, then we do not refresh.
|
|
380
370
|
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
* 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this
|
|
384
|
-
* case, the latest summary is updated based on the downloaded snapshot which is also returned.
|
|
371
|
+
* @returns true if the summary is tracked by this node, false otherwise.
|
|
385
372
|
*/
|
|
386
373
|
public async refreshLatestSummary(
|
|
387
|
-
proposalHandle: string
|
|
374
|
+
proposalHandle: string,
|
|
388
375
|
summaryRefSeq: number,
|
|
389
|
-
|
|
390
|
-
readAndParseBlob: ReadAndParseBlob,
|
|
391
|
-
correlatedSummaryLogger: ITelemetryLoggerExt,
|
|
392
|
-
): Promise<RefreshSummaryResult> {
|
|
376
|
+
): Promise<IRefreshSummaryResult> {
|
|
393
377
|
const eventProps: {
|
|
394
378
|
proposalHandle: string | undefined;
|
|
395
379
|
summaryRefSeq: number;
|
|
396
380
|
referenceSequenceNumber: number;
|
|
397
|
-
|
|
398
|
-
|
|
381
|
+
isSummaryTracked?: boolean;
|
|
382
|
+
pendingSummaryFound?: boolean;
|
|
399
383
|
} = {
|
|
400
384
|
proposalHandle,
|
|
401
385
|
summaryRefSeq,
|
|
@@ -416,75 +400,22 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
416
400
|
});
|
|
417
401
|
}
|
|
418
402
|
|
|
419
|
-
|
|
420
|
-
|
|
403
|
+
let isSummaryTracked = false;
|
|
404
|
+
let isSummaryNewer = false;
|
|
421
405
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
proposalHandle,
|
|
425
|
-
maybeSummaryNode.referenceSequenceNumber,
|
|
426
|
-
);
|
|
427
|
-
eventProps.wasSummaryTracked = true;
|
|
428
|
-
eventProps.latestSummaryUpdated = true;
|
|
429
|
-
event.end(eventProps);
|
|
430
|
-
return {
|
|
431
|
-
latestSummaryUpdated: true,
|
|
432
|
-
wasSummaryTracked: true,
|
|
433
|
-
summaryRefSeq,
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
const props = {
|
|
438
|
-
summaryRefSeq,
|
|
439
|
-
pendingSize: this.pendingSummaries.size ?? undefined,
|
|
440
|
-
};
|
|
441
|
-
this.logger.sendTelemetryEvent({
|
|
442
|
-
eventName: "PendingSummaryNotFound",
|
|
443
|
-
proposalHandle,
|
|
444
|
-
referenceSequenceNumber: this.referenceSequenceNumber,
|
|
445
|
-
details: JSON.stringify(props),
|
|
446
|
-
});
|
|
406
|
+
if (summaryRefSeq > this.referenceSequenceNumber) {
|
|
407
|
+
isSummaryNewer = true;
|
|
447
408
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
// Fetch the latest snapshot and refresh state from it. Note that we need to use the reference sequence number
|
|
457
|
-
// of the fetched snapshot and not the "summaryRefSeq" that was passed in.
|
|
458
|
-
const { snapshotTree, snapshotRefSeq: fetchedSnapshotRefSeq } =
|
|
459
|
-
await fetchLatestSnapshot();
|
|
460
|
-
|
|
461
|
-
// Possible re-entrancy. We may have updated latest summary state while fetching the snapshot. If the fetched
|
|
462
|
-
// snapshot is older than the latest tracked summary, ignore it.
|
|
463
|
-
if (this.referenceSequenceNumber >= fetchedSnapshotRefSeq) {
|
|
464
|
-
eventProps.latestSummaryUpdated = false;
|
|
465
|
-
event.end(eventProps);
|
|
466
|
-
return { latestSummaryUpdated: false };
|
|
409
|
+
const maybeSummaryNode = this.pendingSummaries.get(proposalHandle);
|
|
410
|
+
if (maybeSummaryNode !== undefined) {
|
|
411
|
+
this.refreshLatestSummaryFromPending(
|
|
412
|
+
proposalHandle,
|
|
413
|
+
maybeSummaryNode.referenceSequenceNumber,
|
|
414
|
+
);
|
|
415
|
+
isSummaryTracked = true;
|
|
467
416
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
fetchedSnapshotRefSeq,
|
|
471
|
-
snapshotTree,
|
|
472
|
-
undefined,
|
|
473
|
-
EscapedPath.create(""),
|
|
474
|
-
correlatedSummaryLogger,
|
|
475
|
-
readAndParseBlob,
|
|
476
|
-
);
|
|
477
|
-
|
|
478
|
-
eventProps.latestSummaryUpdated = true;
|
|
479
|
-
eventProps.wasSummaryTracked = false;
|
|
480
|
-
eventProps.summaryRefSeq = fetchedSnapshotRefSeq;
|
|
481
|
-
event.end(eventProps);
|
|
482
|
-
return {
|
|
483
|
-
latestSummaryUpdated: true,
|
|
484
|
-
wasSummaryTracked: false,
|
|
485
|
-
snapshotTree,
|
|
486
|
-
summaryRefSeq: fetchedSnapshotRefSeq,
|
|
487
|
-
};
|
|
417
|
+
event.end({ ...eventProps, isSummaryNewer, pendingSummaryFound: isSummaryTracked });
|
|
418
|
+
return { isSummaryTracked, isSummaryNewer };
|
|
488
419
|
},
|
|
489
420
|
{ start: true, end: true, cancel: "error" },
|
|
490
421
|
);
|
|
@@ -526,59 +457,6 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
526
457
|
}
|
|
527
458
|
}
|
|
528
459
|
|
|
529
|
-
protected async refreshLatestSummaryFromSnapshot(
|
|
530
|
-
referenceSequenceNumber: number,
|
|
531
|
-
snapshotTree: ISnapshotTree,
|
|
532
|
-
basePath: EscapedPath | undefined,
|
|
533
|
-
localPath: EscapedPath,
|
|
534
|
-
correlatedSummaryLogger: ITelemetryLoggerExt,
|
|
535
|
-
readAndParseBlob: ReadAndParseBlob,
|
|
536
|
-
): Promise<void> {
|
|
537
|
-
// Possible re-entrancy. If we have already seen a summary later than this one, ignore it.
|
|
538
|
-
if (this.referenceSequenceNumber >= referenceSequenceNumber) {
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
this.refreshLatestSummaryCore(referenceSequenceNumber);
|
|
543
|
-
|
|
544
|
-
this._latestSummary = new SummaryNode({
|
|
545
|
-
referenceSequenceNumber,
|
|
546
|
-
basePath,
|
|
547
|
-
localPath,
|
|
548
|
-
});
|
|
549
|
-
|
|
550
|
-
const pathParts: string[] = [];
|
|
551
|
-
const { childrenTree, childrenPathPart } = parseSummaryForSubtrees(snapshotTree);
|
|
552
|
-
if (childrenPathPart !== undefined) {
|
|
553
|
-
pathParts.push(childrenPathPart);
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
if (pathParts.length > 0) {
|
|
557
|
-
this._latestSummary.additionalPath = EscapedPath.createAndConcat(pathParts);
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
// Propagate update to all child nodes
|
|
561
|
-
const pathForChildren = this._latestSummary.fullPathForChildren;
|
|
562
|
-
await Promise.all(
|
|
563
|
-
Array.from(this.children)
|
|
564
|
-
.filter(([id]) => {
|
|
565
|
-
// Assuming subtrees missing from snapshot are newer than the snapshot,
|
|
566
|
-
// but might be nice to assert this using earliest seq for node.
|
|
567
|
-
return childrenTree.trees[id] !== undefined;
|
|
568
|
-
})
|
|
569
|
-
.map(async ([id, child]) => {
|
|
570
|
-
return child.refreshLatestSummaryFromSnapshot(
|
|
571
|
-
referenceSequenceNumber,
|
|
572
|
-
childrenTree.trees[id],
|
|
573
|
-
pathForChildren,
|
|
574
|
-
EscapedPath.create(id),
|
|
575
|
-
correlatedSummaryLogger,
|
|
576
|
-
readAndParseBlob,
|
|
577
|
-
);
|
|
578
|
-
}),
|
|
579
|
-
);
|
|
580
|
-
}
|
|
581
|
-
|
|
582
460
|
private refreshLatestSummaryCore(referenceSequenceNumber: number): void {
|
|
583
461
|
for (const [key, value] of this.pendingSummaries) {
|
|
584
462
|
if (value.referenceSequenceNumber < referenceSequenceNumber) {
|
|
@@ -6,40 +6,12 @@
|
|
|
6
6
|
import { ITelemetryLoggerExt, TelemetryDataTag } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { ISnapshotTree, ISummaryTree, SummaryObject } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import { channelsTreeName, ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
9
|
-
import { ReadAndParseBlob } from "@fluidframework/runtime-utils";
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* 2. The latest summary was updated and the summary corresponding to the params was tracked by this client.
|
|
17
|
-
*
|
|
18
|
-
* 3. The latest summary was updated but the summary corresponding to the params was not tracked. In this case, the
|
|
19
|
-
* latest snapshot is fetched and the latest summary state is updated based on it.
|
|
20
|
-
*/
|
|
21
|
-
export type RefreshSummaryResult =
|
|
22
|
-
| {
|
|
23
|
-
latestSummaryUpdated: false;
|
|
24
|
-
}
|
|
25
|
-
| {
|
|
26
|
-
latestSummaryUpdated: true;
|
|
27
|
-
wasSummaryTracked: true;
|
|
28
|
-
summaryRefSeq: number;
|
|
29
|
-
}
|
|
30
|
-
| {
|
|
31
|
-
latestSummaryUpdated: true;
|
|
32
|
-
wasSummaryTracked: false;
|
|
33
|
-
snapshotTree: ISnapshotTree;
|
|
34
|
-
summaryRefSeq: number;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Result of snapshot fetch during refreshing latest summary state.
|
|
39
|
-
*/
|
|
40
|
-
export interface IFetchSnapshotResult {
|
|
41
|
-
snapshotTree: ISnapshotTree;
|
|
42
|
-
snapshotRefSeq: number;
|
|
10
|
+
export interface IRefreshSummaryResult {
|
|
11
|
+
/** Tells whether this summary is tracked by this client. */
|
|
12
|
+
isSummaryTracked: boolean;
|
|
13
|
+
/** Tells whether this summary is newer than the latest one tracked by this client. */
|
|
14
|
+
isSummaryNewer: boolean;
|
|
43
15
|
}
|
|
44
16
|
|
|
45
17
|
/**
|
|
@@ -70,12 +42,9 @@ export interface ISummarizerNodeRootContract {
|
|
|
70
42
|
completeSummary(proposalHandle: string, validate: boolean): void;
|
|
71
43
|
clearSummary(): void;
|
|
72
44
|
refreshLatestSummary(
|
|
73
|
-
proposalHandle: string
|
|
45
|
+
proposalHandle: string,
|
|
74
46
|
summaryRefSeq: number,
|
|
75
|
-
|
|
76
|
-
readAndParseBlob: ReadAndParseBlob,
|
|
77
|
-
correlatedSummaryLogger: ITelemetryLoggerExt,
|
|
78
|
-
): Promise<RefreshSummaryResult>;
|
|
47
|
+
): Promise<IRefreshSummaryResult>;
|
|
79
48
|
}
|
|
80
49
|
|
|
81
50
|
/** Path for nodes in a tree with escaped special characters */
|