@fluidframework/container-runtime 2.0.0-dev-rc.5.0.0.263932 → 2.0.0-dev-rc.5.0.0.265721
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/api-report/container-runtime.api.md +31 -40
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +2 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +1 -1
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +2 -2
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +3 -3
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.d.ts +2 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +10 -17
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +62 -104
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +6 -6
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +3 -3
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerProxies.js.map +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +1 -2
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +1 -1
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +14 -19
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +4 -22
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +3 -3
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +1 -2
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
- package/dist/gc/gcSummaryDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +2 -2
- package/dist/gc/gcTelemetry.js.map +1 -1
- 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 +2 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +1 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +2 -16
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.js.map +1 -1
- package/dist/storageServiceWithAttachBlobs.js.map +1 -1
- package/dist/summary/documentSchema.js +1 -1
- package/dist/summary/documentSchema.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 +3 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +35 -13
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +0 -5
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +19 -104
- 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 -1
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -2
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +15 -26
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.js +2 -2
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +1 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +7 -8
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +23 -18
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.js.map +1 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +2 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +1 -1
- package/lib/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +2 -2
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +3 -3
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.d.ts +2 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +10 -17
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +62 -104
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +6 -6
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +3 -3
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerProxies.js.map +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +1 -2
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +1 -1
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +15 -20
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +4 -22
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +2 -2
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +1 -2
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +2 -2
- package/lib/gc/gcTelemetry.js.map +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/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +1 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +2 -16
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.js.map +1 -1
- package/lib/storageServiceWithAttachBlobs.js.map +1 -1
- package/lib/summary/documentSchema.js +1 -1
- package/lib/summary/documentSchema.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 +3 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +35 -13
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +0 -5
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +20 -105
- 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 +4 -1
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -2
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +1 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +15 -26
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.js +2 -2
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +1 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +7 -8
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +23 -18
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.js.map +1 -1
- package/package.json +59 -22
- package/src/blobManager.ts +3 -3
- package/src/channelCollection.ts +5 -7
- package/src/containerHandleContext.ts +2 -1
- package/src/containerRuntime.ts +72 -121
- package/src/dataStore.ts +2 -1
- package/src/dataStoreContext.ts +7 -8
- package/src/gc/garbageCollection.md +0 -8
- package/src/gc/garbageCollection.ts +2 -1
- package/src/gc/gcConfigs.ts +12 -19
- package/src/gc/gcDefinitions.ts +5 -23
- package/src/gc/gcHelpers.ts +1 -1
- package/src/gc/gcSummaryDefinitions.ts +1 -1
- package/src/gc/gcSummaryStateTracker.ts +1 -1
- package/src/gc/gcTelemetry.ts +1 -1
- package/src/gc/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/opLifecycle/outbox.ts +2 -26
- package/src/packageVersion.ts +1 -1
- package/src/summary/index.ts +1 -1
- package/src/summary/orderedClientElection.ts +82 -11
- package/src/summary/runningSummarizer.ts +29 -113
- package/src/summary/summarizer.ts +5 -2
- package/src/summary/summarizerNode/summarizerNode.ts +0 -2
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +1 -3
- package/src/summary/summarizerTypes.ts +21 -27
- package/src/summary/summaryFormat.ts +5 -2
- package/src/summary/summaryGenerator.ts +49 -26
package/src/containerRuntime.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
IAudience,
|
|
10
10
|
ISelf,
|
|
11
11
|
ICriticalContainerError,
|
|
12
|
+
type IAudienceEvents,
|
|
12
13
|
} from "@fluidframework/container-definitions";
|
|
13
14
|
import {
|
|
14
15
|
IBatchMessage,
|
|
@@ -17,7 +18,6 @@ import {
|
|
|
17
18
|
ILoader,
|
|
18
19
|
IRuntime,
|
|
19
20
|
LoaderHeader,
|
|
20
|
-
type IAudienceEvents,
|
|
21
21
|
IDeltaManager,
|
|
22
22
|
} from "@fluidframework/container-definitions/internal";
|
|
23
23
|
import {
|
|
@@ -27,12 +27,14 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
FluidObject,
|
|
29
29
|
IFluidHandle,
|
|
30
|
-
IFluidHandleContext,
|
|
31
|
-
type IFluidHandleInternal,
|
|
32
|
-
IProvideFluidHandleContext,
|
|
33
30
|
IRequest,
|
|
34
31
|
IResponse,
|
|
35
32
|
ITelemetryBaseLogger,
|
|
33
|
+
} from "@fluidframework/core-interfaces";
|
|
34
|
+
import {
|
|
35
|
+
IFluidHandleContext,
|
|
36
|
+
type IFluidHandleInternal,
|
|
37
|
+
IProvideFluidHandleContext,
|
|
36
38
|
} from "@fluidframework/core-interfaces/internal";
|
|
37
39
|
import { ISignalEnvelope } from "@fluidframework/core-interfaces/internal";
|
|
38
40
|
import {
|
|
@@ -68,13 +70,11 @@ import {
|
|
|
68
70
|
MessageType,
|
|
69
71
|
SummaryType,
|
|
70
72
|
} from "@fluidframework/protocol-definitions";
|
|
73
|
+
import { IInboundSignalMessage } from "@fluidframework/runtime-definitions";
|
|
71
74
|
import {
|
|
72
|
-
IGarbageCollectionData,
|
|
73
|
-
IInboundSignalMessage,
|
|
74
75
|
ISummaryTreeWithStats,
|
|
75
76
|
ITelemetryContext,
|
|
76
|
-
|
|
77
|
-
import {
|
|
77
|
+
IGarbageCollectionData,
|
|
78
78
|
CreateChildSummarizerNodeParam,
|
|
79
79
|
FlushMode,
|
|
80
80
|
FlushModeExperimental,
|
|
@@ -1188,6 +1188,8 @@ export class ContainerRuntime
|
|
|
1188
1188
|
|
|
1189
1189
|
private readonly summarizerNode: IRootSummarizerNodeWithGC;
|
|
1190
1190
|
|
|
1191
|
+
private readonly logger: ITelemetryLoggerExt;
|
|
1192
|
+
|
|
1191
1193
|
private readonly maxConsecutiveReconnects: number;
|
|
1192
1194
|
private readonly defaultMaxConsecutiveReconnects = 7;
|
|
1193
1195
|
|
|
@@ -1348,7 +1350,8 @@ export class ContainerRuntime
|
|
|
1348
1350
|
dataStoreAliasMap: [string, string][],
|
|
1349
1351
|
private readonly runtimeOptions: Readonly<Required<IContainerRuntimeOptions>>,
|
|
1350
1352
|
private readonly containerScope: FluidObject,
|
|
1351
|
-
|
|
1353
|
+
// Create a custom ITelemetryBaseLogger to output telemetry events.
|
|
1354
|
+
public readonly baseLogger: ITelemetryBaseLogger,
|
|
1352
1355
|
existing: boolean,
|
|
1353
1356
|
blobManagerSnapshot: IBlobManagerLoadInfo,
|
|
1354
1357
|
private readonly _storage: IDocumentStorageService,
|
|
@@ -1389,6 +1392,7 @@ export class ContainerRuntime
|
|
|
1389
1392
|
snapshotWithContents,
|
|
1390
1393
|
} = context;
|
|
1391
1394
|
|
|
1395
|
+
this.logger = createChildLogger({ logger: this.baseLogger });
|
|
1392
1396
|
this.mc = createChildMonitoringContext({
|
|
1393
1397
|
logger: this.logger,
|
|
1394
1398
|
namespace: "ContainerRuntime",
|
|
@@ -1787,6 +1791,9 @@ export class ContainerRuntime
|
|
|
1787
1791
|
orderedClientCollection,
|
|
1788
1792
|
electedSummarizerData ?? this.innerDeltaManager.lastSequenceNumber,
|
|
1789
1793
|
SummarizerClientElection.isClientEligible,
|
|
1794
|
+
this.mc.config.getBoolean(
|
|
1795
|
+
"Fluid.ContainerRuntime.OrderedClientElection.EnablePerformanceEvents",
|
|
1796
|
+
),
|
|
1790
1797
|
);
|
|
1791
1798
|
|
|
1792
1799
|
this.summarizerClientElection = new SummarizerClientElection(
|
|
@@ -1859,7 +1866,7 @@ export class ContainerRuntime
|
|
|
1859
1866
|
}
|
|
1860
1867
|
|
|
1861
1868
|
// logging hardware telemetry
|
|
1862
|
-
logger.sendTelemetryEvent({
|
|
1869
|
+
this.logger.sendTelemetryEvent({
|
|
1863
1870
|
eventName: "DeviceSpec",
|
|
1864
1871
|
...getDeviceSpec(),
|
|
1865
1872
|
});
|
|
@@ -3435,7 +3442,6 @@ export class ContainerRuntime
|
|
|
3435
3442
|
const {
|
|
3436
3443
|
fullTree = false,
|
|
3437
3444
|
finalAttempt = false,
|
|
3438
|
-
refreshLatestAck,
|
|
3439
3445
|
summaryLogger,
|
|
3440
3446
|
latestSummaryRefSeqNum,
|
|
3441
3447
|
} = options;
|
|
@@ -3455,16 +3461,6 @@ export class ContainerRuntime
|
|
|
3455
3461
|
|
|
3456
3462
|
assert(this.outbox.isEmpty, 0x3d1 /* Can't trigger summary in the middle of a batch */);
|
|
3457
3463
|
|
|
3458
|
-
// We close the summarizer and download a new snapshot and reload the container
|
|
3459
|
-
if (refreshLatestAck === true) {
|
|
3460
|
-
return this.prefetchLatestSummaryThenClose(
|
|
3461
|
-
createChildLogger({
|
|
3462
|
-
logger: summaryNumberLogger,
|
|
3463
|
-
properties: { all: { safeSummary: true } },
|
|
3464
|
-
}),
|
|
3465
|
-
);
|
|
3466
|
-
}
|
|
3467
|
-
|
|
3468
3464
|
// If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
|
|
3469
3465
|
// and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
3470
3466
|
// saved within the timeout, check if it should be failed or can continue.
|
|
@@ -3560,7 +3556,7 @@ export class ContainerRuntime
|
|
|
3560
3556
|
stage: "base",
|
|
3561
3557
|
referenceSequenceNumber: summaryRefSeqNum,
|
|
3562
3558
|
minimumSequenceNumber,
|
|
3563
|
-
error: new
|
|
3559
|
+
error: new RetriableSummaryError(
|
|
3564
3560
|
`Summarizer node state inconsistent with summarizer state.`,
|
|
3565
3561
|
),
|
|
3566
3562
|
};
|
|
@@ -3612,7 +3608,7 @@ export class ContainerRuntime
|
|
|
3612
3608
|
stage: "base",
|
|
3613
3609
|
referenceSequenceNumber: summaryRefSeqNum,
|
|
3614
3610
|
minimumSequenceNumber,
|
|
3615
|
-
error: new
|
|
3611
|
+
error: new RetriableSummaryError(continueResult.error),
|
|
3616
3612
|
};
|
|
3617
3613
|
}
|
|
3618
3614
|
|
|
@@ -3633,7 +3629,7 @@ export class ContainerRuntime
|
|
|
3633
3629
|
stage: "base",
|
|
3634
3630
|
referenceSequenceNumber: summaryRefSeqNum,
|
|
3635
3631
|
minimumSequenceNumber,
|
|
3636
|
-
error: wrapError(error, (msg) => new
|
|
3632
|
+
error: wrapError(error, (msg) => new RetriableSummaryError(msg)),
|
|
3637
3633
|
};
|
|
3638
3634
|
}
|
|
3639
3635
|
|
|
@@ -3708,7 +3704,7 @@ export class ContainerRuntime
|
|
|
3708
3704
|
return {
|
|
3709
3705
|
stage: "generate",
|
|
3710
3706
|
...generateSummaryData,
|
|
3711
|
-
error: new
|
|
3707
|
+
error: new RetriableSummaryError(continueResult.error),
|
|
3712
3708
|
};
|
|
3713
3709
|
}
|
|
3714
3710
|
|
|
@@ -3735,7 +3731,7 @@ export class ContainerRuntime
|
|
|
3735
3731
|
return {
|
|
3736
3732
|
stage: "generate",
|
|
3737
3733
|
...generateSummaryData,
|
|
3738
|
-
error: wrapError(error, (msg) => new
|
|
3734
|
+
error: wrapError(error, (msg) => new RetriableSummaryError(msg)),
|
|
3739
3735
|
};
|
|
3740
3736
|
}
|
|
3741
3737
|
|
|
@@ -3758,7 +3754,7 @@ export class ContainerRuntime
|
|
|
3758
3754
|
return {
|
|
3759
3755
|
stage: "upload",
|
|
3760
3756
|
...uploadData,
|
|
3761
|
-
error: new
|
|
3757
|
+
error: new RetriableSummaryError(continueResult.error),
|
|
3762
3758
|
};
|
|
3763
3759
|
}
|
|
3764
3760
|
|
|
@@ -3769,7 +3765,7 @@ export class ContainerRuntime
|
|
|
3769
3765
|
return {
|
|
3770
3766
|
stage: "upload",
|
|
3771
3767
|
...uploadData,
|
|
3772
|
-
error: wrapError(error, (msg) => new
|
|
3768
|
+
error: wrapError(error, (msg) => new RetriableSummaryError(msg)),
|
|
3773
3769
|
};
|
|
3774
3770
|
}
|
|
3775
3771
|
|
|
@@ -3786,7 +3782,7 @@ export class ContainerRuntime
|
|
|
3786
3782
|
return {
|
|
3787
3783
|
stage: "upload",
|
|
3788
3784
|
...uploadData,
|
|
3789
|
-
error: wrapError(error, (msg) => new
|
|
3785
|
+
error: wrapError(error, (msg) => new RetriableSummaryError(msg)),
|
|
3790
3786
|
};
|
|
3791
3787
|
}
|
|
3792
3788
|
return submitData;
|
|
@@ -3919,13 +3915,13 @@ export class ContainerRuntime
|
|
|
3919
3915
|
return this.blobManager.createBlob(blob, signal);
|
|
3920
3916
|
}
|
|
3921
3917
|
|
|
3922
|
-
private submitIdAllocationOpIfNeeded(resubmitOutstandingRanges
|
|
3918
|
+
private submitIdAllocationOpIfNeeded(resubmitOutstandingRanges: boolean): void {
|
|
3923
3919
|
if (this._idCompressor) {
|
|
3924
3920
|
const idRange = resubmitOutstandingRanges
|
|
3925
|
-
? this.
|
|
3921
|
+
? this._idCompressor.takeUnfinalizedCreationRange()
|
|
3926
3922
|
: this._idCompressor.takeNextCreationRange();
|
|
3927
3923
|
// Don't include the idRange if there weren't any Ids allocated
|
|
3928
|
-
if (idRange
|
|
3924
|
+
if (idRange.ids !== undefined) {
|
|
3929
3925
|
const idAllocationMessage: ContainerRuntimeIdAllocationMessage = {
|
|
3930
3926
|
type: ContainerMessageType.IdAllocation,
|
|
3931
3927
|
contents: idRange,
|
|
@@ -3970,6 +3966,10 @@ export class ContainerRuntime
|
|
|
3970
3966
|
}
|
|
3971
3967
|
|
|
3972
3968
|
const type = containerRuntimeMessage.type;
|
|
3969
|
+
assert(
|
|
3970
|
+
type !== ContainerMessageType.IdAllocation,
|
|
3971
|
+
"IdAllocation should be submitted directly to outbox.",
|
|
3972
|
+
);
|
|
3973
3973
|
const message: BatchMessage = {
|
|
3974
3974
|
contents: serializedContent,
|
|
3975
3975
|
metadata,
|
|
@@ -3978,44 +3978,36 @@ export class ContainerRuntime
|
|
|
3978
3978
|
};
|
|
3979
3979
|
|
|
3980
3980
|
try {
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
//
|
|
3984
|
-
//
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
this.
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
contents,
|
|
4006
|
-
};
|
|
4007
|
-
this.outbox.submit({
|
|
4008
|
-
contents: JSON.stringify(msg),
|
|
4009
|
-
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
4010
|
-
});
|
|
4011
|
-
}
|
|
3981
|
+
this.submitIdAllocationOpIfNeeded(false);
|
|
3982
|
+
|
|
3983
|
+
// Allow document schema controller to send a message if it needs to propose change in document schema.
|
|
3984
|
+
// If it needs to send a message, it will call provided callback with payload of such message and rely
|
|
3985
|
+
// on this callback to do actual sending.
|
|
3986
|
+
const contents = this.documentsSchemaController.maybeSendSchemaMessage();
|
|
3987
|
+
if (contents) {
|
|
3988
|
+
this.logger.sendTelemetryEvent({
|
|
3989
|
+
eventName: "SchemaChangeProposal",
|
|
3990
|
+
refSeq: contents.refSeq,
|
|
3991
|
+
version: contents.version,
|
|
3992
|
+
newRuntimeSchema: JSON.stringify(contents.runtime),
|
|
3993
|
+
sessionRuntimeSchema: JSON.stringify(this.sessionSchema),
|
|
3994
|
+
oldRuntimeSchema: JSON.stringify(this.metadata?.documentSchema?.runtime),
|
|
3995
|
+
});
|
|
3996
|
+
const msg: ContainerRuntimeDocumentSchemaMessage = {
|
|
3997
|
+
type: ContainerMessageType.DocumentSchemaChange,
|
|
3998
|
+
contents,
|
|
3999
|
+
};
|
|
4000
|
+
this.outbox.submit({
|
|
4001
|
+
contents: JSON.stringify(msg),
|
|
4002
|
+
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
4003
|
+
});
|
|
4004
|
+
}
|
|
4012
4005
|
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
}
|
|
4006
|
+
if (type === ContainerMessageType.BlobAttach) {
|
|
4007
|
+
// BlobAttach ops must have their metadata visible and cannot be grouped (see opGroupingManager.ts)
|
|
4008
|
+
this.outbox.submitBlobAttach(message);
|
|
4009
|
+
} else {
|
|
4010
|
+
this.outbox.submit(message);
|
|
4019
4011
|
}
|
|
4020
4012
|
|
|
4021
4013
|
if (!this.currentlyBatching()) {
|
|
@@ -4224,7 +4216,7 @@ export class ContainerRuntime
|
|
|
4224
4216
|
* and then close as the current main client is likely to be re-elected as the parent summarizer again.
|
|
4225
4217
|
*/
|
|
4226
4218
|
if (!result.isSummaryTracked && result.isSummaryNewer) {
|
|
4227
|
-
await this.
|
|
4219
|
+
await this.fetchLatestSnapshotAndClose(
|
|
4228
4220
|
summaryLogger,
|
|
4229
4221
|
{
|
|
4230
4222
|
eventName: "RefreshLatestSummaryAckFetch",
|
|
@@ -4233,8 +4225,6 @@ export class ContainerRuntime
|
|
|
4233
4225
|
},
|
|
4234
4226
|
readAndParseBlob,
|
|
4235
4227
|
);
|
|
4236
|
-
|
|
4237
|
-
await this.closeStaleSummarizer();
|
|
4238
4228
|
return;
|
|
4239
4229
|
}
|
|
4240
4230
|
|
|
@@ -4243,54 +4233,16 @@ export class ContainerRuntime
|
|
|
4243
4233
|
}
|
|
4244
4234
|
|
|
4245
4235
|
/**
|
|
4246
|
-
* Fetches the latest snapshot from storage
|
|
4247
|
-
*
|
|
4248
|
-
*
|
|
4249
|
-
* @returns a generic summarization error
|
|
4236
|
+
* Fetches the latest snapshot from storage and closes the container. This is done in cases where
|
|
4237
|
+
* the last known snapshot is older than the latest one. This will ensure that the latest snapshot
|
|
4238
|
+
* is downloaded and we don't end up loading snapshot from cache.
|
|
4250
4239
|
*/
|
|
4251
|
-
private async
|
|
4252
|
-
summaryLogger: ITelemetryLoggerExt,
|
|
4253
|
-
): Promise<IBaseSummarizeResult> {
|
|
4254
|
-
const readAndParseBlob = async <T>(id: string) => readAndParse<T>(this.storage, id);
|
|
4255
|
-
|
|
4256
|
-
// This is a performance optimization as the same parent is likely to be elected again, and would use its
|
|
4257
|
-
// cache to fetch the snapshot instead of the network.
|
|
4258
|
-
await this.fetchLatestSnapshotFromStorage(
|
|
4259
|
-
summaryLogger,
|
|
4260
|
-
{
|
|
4261
|
-
eventName: "RefreshLatestSummaryFromServerFetch",
|
|
4262
|
-
},
|
|
4263
|
-
readAndParseBlob,
|
|
4264
|
-
);
|
|
4265
|
-
|
|
4266
|
-
await this.closeStaleSummarizer();
|
|
4267
|
-
|
|
4268
|
-
return {
|
|
4269
|
-
stage: "base",
|
|
4270
|
-
error: new LoggingError("summary state stale - Unsupported option 'refreshLatestAck'"),
|
|
4271
|
-
referenceSequenceNumber: this.deltaManager.lastSequenceNumber,
|
|
4272
|
-
minimumSequenceNumber: this.deltaManager.minimumSequenceNumber,
|
|
4273
|
-
};
|
|
4274
|
-
}
|
|
4275
|
-
|
|
4276
|
-
private async closeStaleSummarizer(): Promise<void> {
|
|
4277
|
-
// Delay before restarting summarizer to prevent the summarizer from restarting too frequently.
|
|
4278
|
-
await delay(this.closeSummarizerDelayMs);
|
|
4279
|
-
this._summarizer?.stop("latestSummaryStateStale");
|
|
4280
|
-
this.disposeFn();
|
|
4281
|
-
}
|
|
4282
|
-
|
|
4283
|
-
/**
|
|
4284
|
-
* Downloads the latest snapshot from storage.
|
|
4285
|
-
* By default, it also closes the container after downloading the snapshot. However, this may be
|
|
4286
|
-
* overridden via options.
|
|
4287
|
-
*/
|
|
4288
|
-
private async fetchLatestSnapshotFromStorage(
|
|
4240
|
+
private async fetchLatestSnapshotAndClose(
|
|
4289
4241
|
logger: ITelemetryLoggerExt,
|
|
4290
4242
|
event: ITelemetryGenericEventExt,
|
|
4291
4243
|
readAndParseBlob: ReadAndParseBlob,
|
|
4292
|
-
)
|
|
4293
|
-
|
|
4244
|
+
) {
|
|
4245
|
+
await PerformanceEvent.timedExecAsync(
|
|
4294
4246
|
logger,
|
|
4295
4247
|
event,
|
|
4296
4248
|
async (perfEvent: {
|
|
@@ -4329,13 +4281,12 @@ export class ContainerRuntime
|
|
|
4329
4281
|
stats.snapshotVersion = versions[0].id;
|
|
4330
4282
|
|
|
4331
4283
|
perfEvent.end(stats);
|
|
4332
|
-
return {
|
|
4333
|
-
snapshotTree: maybeSnapshot,
|
|
4334
|
-
versionId: versions[0].id,
|
|
4335
|
-
latestSnapshotRefSeq,
|
|
4336
|
-
};
|
|
4337
4284
|
},
|
|
4338
4285
|
);
|
|
4286
|
+
|
|
4287
|
+
await delay(this.closeSummarizerDelayMs);
|
|
4288
|
+
this._summarizer?.stop("latestSummaryStateStale");
|
|
4289
|
+
this.disposeFn();
|
|
4339
4290
|
}
|
|
4340
4291
|
|
|
4341
4292
|
public getPendingLocalState(props?: IGetPendingLocalStateProps): unknown {
|
package/src/dataStore.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
7
|
-
import { FluidObject
|
|
7
|
+
import { FluidObject } from "@fluidframework/core-interfaces";
|
|
8
|
+
import { type IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
8
9
|
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
9
10
|
import {
|
|
10
11
|
AliasResult,
|
package/src/dataStoreContext.ts
CHANGED
|
@@ -12,8 +12,9 @@ import {
|
|
|
12
12
|
IRequest,
|
|
13
13
|
IResponse,
|
|
14
14
|
ITelemetryBaseProperties,
|
|
15
|
+
type IEvent,
|
|
15
16
|
} from "@fluidframework/core-interfaces";
|
|
16
|
-
import { type
|
|
17
|
+
import { type IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
17
18
|
import { assert, LazyPromise, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
18
19
|
import {
|
|
19
20
|
IDocumentStorageService,
|
|
@@ -33,13 +34,11 @@ import {
|
|
|
33
34
|
ISnapshotTree,
|
|
34
35
|
ITreeEntry,
|
|
35
36
|
} from "@fluidframework/protocol-definitions";
|
|
37
|
+
import { IInboundSignalMessage } from "@fluidframework/runtime-definitions";
|
|
36
38
|
import {
|
|
37
|
-
IGarbageCollectionData,
|
|
38
|
-
IInboundSignalMessage,
|
|
39
39
|
ISummaryTreeWithStats,
|
|
40
40
|
ITelemetryContext,
|
|
41
|
-
|
|
42
|
-
import {
|
|
41
|
+
IGarbageCollectionData,
|
|
43
42
|
CreateChildSummarizerNodeFn,
|
|
44
43
|
CreateChildSummarizerNodeParam,
|
|
45
44
|
FluidDataStoreRegistryEntry,
|
|
@@ -211,8 +210,8 @@ export abstract class FluidDataStoreContext
|
|
|
211
210
|
return this.parentContext.clientDetails;
|
|
212
211
|
}
|
|
213
212
|
|
|
214
|
-
public get
|
|
215
|
-
return this.parentContext.
|
|
213
|
+
public get baseLogger() {
|
|
214
|
+
return this.parentContext.baseLogger;
|
|
216
215
|
}
|
|
217
216
|
|
|
218
217
|
public get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
|
|
@@ -383,7 +382,7 @@ export abstract class FluidDataStoreContext
|
|
|
383
382
|
);
|
|
384
383
|
|
|
385
384
|
this.mc = createChildMonitoringContext({
|
|
386
|
-
logger: this.
|
|
385
|
+
logger: this.baseLogger,
|
|
387
386
|
namespace: "FluidDataStoreContext",
|
|
388
387
|
properties: {
|
|
389
388
|
all: tagCodeArtifacts({
|
|
@@ -88,14 +88,6 @@ for apps to override settings easily, e.g. by backing their `IConfigProviderBase
|
|
|
88
88
|
In cases where a behavior is controlled by both a Config Setting and GC Option, you may experiment at first using Config Settings
|
|
89
89
|
and then later update the passed-in GC Options to finalize the configuration in your code.
|
|
90
90
|
|
|
91
|
-
### Disabling Mark Phase
|
|
92
|
-
|
|
93
|
-
If you wish to disable Mark Phase for newly-created documents, set the `gcAllowed` GC Option to `false`.
|
|
94
|
-
Note that this will disable GC permanently (including the sweep phase) for the container during its lifetime.
|
|
95
|
-
|
|
96
|
-
Mark Phase can also be disabled just for the session, among other behaviors,
|
|
97
|
-
covered in the [Advanced Configuration](./gcEarlyAdoption.md#more-advanced-configurations) docs.
|
|
98
|
-
|
|
99
91
|
### Enabling Sweep Phase
|
|
100
92
|
|
|
101
93
|
To enable the Sweep Phase for new documents, you must set the `enableGCSweep` GC Option to true.
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { assert, LazyPromise, Timer } from "@fluidframework/core-utils/internal";
|
|
8
|
-
import { IGarbageCollectionData, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
9
8
|
import {
|
|
10
9
|
IGarbageCollectionDetailsBase,
|
|
11
10
|
ISummarizeResult,
|
|
12
11
|
gcTreeKey,
|
|
12
|
+
type IGarbageCollectionData,
|
|
13
|
+
type ITelemetryContext,
|
|
13
14
|
} from "@fluidframework/runtime-definitions/internal";
|
|
14
15
|
import { createResponseError, responseToException } from "@fluidframework/runtime-utils/internal";
|
|
15
16
|
import {
|
package/src/gc/gcConfigs.ts
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
gcTestModeKey,
|
|
29
29
|
maxSnapshotCacheExpiryMs,
|
|
30
30
|
oneDayMs,
|
|
31
|
-
|
|
31
|
+
runGCTestKey,
|
|
32
32
|
runSessionExpiryKey,
|
|
33
33
|
runSweepKey,
|
|
34
34
|
throwOnTombstoneLoadOverrideKey,
|
|
@@ -54,7 +54,7 @@ export function generateGCConfigs(
|
|
|
54
54
|
isSummarizerClient: boolean;
|
|
55
55
|
},
|
|
56
56
|
): IGarbageCollectorConfigs {
|
|
57
|
-
let
|
|
57
|
+
let gcDisabled: boolean = false;
|
|
58
58
|
let sessionExpiryTimeoutMs: number | undefined;
|
|
59
59
|
let tombstoneTimeoutMs: number | undefined;
|
|
60
60
|
let persistedGcFeatureMatrix: GCFeatureMatrix | undefined;
|
|
@@ -70,9 +70,9 @@ export function generateGCConfigs(
|
|
|
70
70
|
if (createParams.existing) {
|
|
71
71
|
const metadata = createParams.metadata;
|
|
72
72
|
gcVersionInBaseSnapshot = getGCVersion(metadata);
|
|
73
|
-
// Existing documents which did not have metadata blob or had GC disabled have version as 0.
|
|
74
|
-
//
|
|
75
|
-
|
|
73
|
+
// Existing documents which did not have metadata blob or had GC disabled have GC version as 0. GC will be
|
|
74
|
+
// disabled for these documents.
|
|
75
|
+
gcDisabled = gcVersionInBaseSnapshot === 0;
|
|
76
76
|
sessionExpiryTimeoutMs = metadata?.sessionExpiryTimeoutMs;
|
|
77
77
|
const legacyPersistedSweepTimeoutMs = (metadata as IGCMetadata_Deprecated)?.sweepTimeoutMs;
|
|
78
78
|
tombstoneTimeoutMs =
|
|
@@ -86,12 +86,8 @@ export function generateGCConfigs(
|
|
|
86
86
|
"Fluid.GarbageCollection.TestOverride.TombstoneTimeoutMs",
|
|
87
87
|
);
|
|
88
88
|
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
gcEnabled = createParams.gcOptions.gcAllowed !== false;
|
|
92
|
-
|
|
93
|
-
// Set the Session Expiry if GC is enabled and session expiry flag isn't explicitly set to false.
|
|
94
|
-
if (gcEnabled && mc.config.getBoolean(runSessionExpiryKey) !== false) {
|
|
89
|
+
// Set the Session Expiry if session expiry flag isn't explicitly set to false.
|
|
90
|
+
if (mc.config.getBoolean(runSessionExpiryKey) !== false) {
|
|
95
91
|
sessionExpiryTimeoutMs =
|
|
96
92
|
createParams.gcOptions.sessionExpiryTimeoutMs ?? defaultSessionExpiryDurationMs;
|
|
97
93
|
}
|
|
@@ -122,15 +118,12 @@ export function generateGCConfigs(
|
|
|
122
118
|
|
|
123
119
|
/**
|
|
124
120
|
* Whether GC should run or not. The following conditions have to be met to run sweep:
|
|
125
|
-
* 1. GC should be
|
|
126
|
-
* 2. GC should
|
|
127
|
-
* 3. The current GC version should be greater or equal to the GC version in the base snapshot.
|
|
121
|
+
* 1. GC should not be disabled for this container.
|
|
122
|
+
* 2. The current GC version should be greater or equal to the GC version in the base snapshot.
|
|
128
123
|
*
|
|
129
|
-
* These conditions can be overridden via the RunGC feature flag.
|
|
124
|
+
* These conditions can be overridden via the RunGC feature flag for testing.
|
|
130
125
|
*/
|
|
131
|
-
const shouldRunGC =
|
|
132
|
-
mc.config.getBoolean(runGCKey) ??
|
|
133
|
-
(gcEnabled && !createParams.gcOptions.disableGC && isGCVersionUpToDate);
|
|
126
|
+
const shouldRunGC = mc.config.getBoolean(runGCTestKey) ?? (!gcDisabled && isGCVersionUpToDate);
|
|
134
127
|
|
|
135
128
|
/**
|
|
136
129
|
* Whether sweep should run or not. This refers to whether Tombstones should fail on load and whether
|
|
@@ -195,7 +188,7 @@ export function generateGCConfigs(
|
|
|
195
188
|
!createParams.isSummarizerClient;
|
|
196
189
|
|
|
197
190
|
return {
|
|
198
|
-
gcEnabled, // For this document
|
|
191
|
+
gcEnabled: !gcDisabled, // For this document
|
|
199
192
|
sweepEnabled: sweepAllowed, // For this document (based on current GC Generation option)
|
|
200
193
|
shouldRunGC, // For this session
|
|
201
194
|
shouldRunSweep, // For this session
|
package/src/gc/gcDefinitions.ts
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
import { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
7
7
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
9
|
-
import { IGarbageCollectionData, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
10
9
|
import {
|
|
10
|
+
ITelemetryContext,
|
|
11
|
+
IGarbageCollectionData,
|
|
11
12
|
IGarbageCollectionDetailsBase,
|
|
12
13
|
ISummarizeResult,
|
|
13
14
|
} from "@fluidframework/runtime-definitions/internal";
|
|
@@ -59,8 +60,6 @@ export const gcDisableDataStoreSweepOptionName = "disableDataStoreSweep";
|
|
|
59
60
|
*/
|
|
60
61
|
export const gcGenerationOptionName = "gcGeneration";
|
|
61
62
|
|
|
62
|
-
/** Config key to turn GC on / off. */
|
|
63
|
-
export const runGCKey = "Fluid.GarbageCollection.RunGC";
|
|
64
63
|
/** Config key to turn GC sweep on / off. */
|
|
65
64
|
export const runSweepKey = "Fluid.GarbageCollection.RunSweep";
|
|
66
65
|
/** Config key to turn GC test mode on / off. */
|
|
@@ -82,6 +81,8 @@ export const disableDatastoreSweepKey = "Fluid.GarbageCollection.DisableDataStor
|
|
|
82
81
|
export const detectOutboundRoutesViaDDSKey = "Fluid.GarbageCollection.DetectOutboundRoutesViaDDS";
|
|
83
82
|
/** Config key to disable auto-recovery mechanism that protects Tombstones that are loaded from being swept (use true) */
|
|
84
83
|
export const disableAutoRecoveryKey = "Fluid.GarbageCollection.DisableAutoRecovery";
|
|
84
|
+
/** Config key to turn GC on / off for testing. */
|
|
85
|
+
export const runGCTestKey = "Fluid.GarbageCollection.Test.RunGC";
|
|
85
86
|
|
|
86
87
|
// One day in milliseconds.
|
|
87
88
|
export const oneDayMs = 1 * 24 * 60 * 60 * 1000;
|
|
@@ -421,24 +422,6 @@ export interface IGarbageCollectorCreateParams {
|
|
|
421
422
|
* @alpha
|
|
422
423
|
*/
|
|
423
424
|
export interface IGCRuntimeOptions {
|
|
424
|
-
/**
|
|
425
|
-
* Flag that if true, will enable running garbage collection (GC) for a new container.
|
|
426
|
-
*
|
|
427
|
-
* GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified
|
|
428
|
-
* and marked as such in the summary. This option enables the mark phase.
|
|
429
|
-
* In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
|
|
430
|
-
* Sweep phase can be enabled using the "enableGCSweep" option.
|
|
431
|
-
*
|
|
432
|
-
* Note: This setting is persisted in the container's summary and cannot be changed.
|
|
433
|
-
*/
|
|
434
|
-
gcAllowed?: boolean;
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* Flag that if true, will disable garbage collection for the session.
|
|
438
|
-
* Can be used to disable running GC on containers where it is allowed via the gcAllowed option.
|
|
439
|
-
*/
|
|
440
|
-
disableGC?: boolean;
|
|
441
|
-
|
|
442
425
|
/**
|
|
443
426
|
* Flag that if true, will enable the full Sweep Phase of garbage collection for this session,
|
|
444
427
|
* where Tombstoned objects are permanently deleted from the container.
|
|
@@ -481,8 +464,7 @@ export interface IGCRuntimeOptions {
|
|
|
481
464
|
*/
|
|
482
465
|
export interface IGarbageCollectorConfigs {
|
|
483
466
|
/**
|
|
484
|
-
* Tracks if GC is enabled for this document.
|
|
485
|
-
* throughout its lifetime.
|
|
467
|
+
* Tracks if GC is enabled for this document. GC may not be enabled for old documents created pre-GC.
|
|
486
468
|
*/
|
|
487
469
|
readonly gcEnabled: boolean;
|
|
488
470
|
/**
|
package/src/gc/gcHelpers.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
|
|
9
8
|
import {
|
|
10
9
|
IGarbageCollectionDetailsBase,
|
|
11
10
|
gcBlobPrefix,
|
|
12
11
|
gcDeletedBlobKey,
|
|
13
12
|
gcTombstoneBlobKey,
|
|
13
|
+
IGarbageCollectionData,
|
|
14
14
|
} from "@fluidframework/runtime-definitions/internal";
|
|
15
15
|
import type { IConfigProvider } from "@fluidframework/telemetry-utils/internal";
|
|
16
16
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
|
|
6
|
+
import { IGarbageCollectionData } from "@fluidframework/runtime-definitions/internal";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The garbage collection data of each node in the reference graph. Each node's GC data is written in the summary
|
package/src/gc/gcTelemetry.ts
CHANGED