@fluidframework/container-runtime 2.0.0-dev-rc.5.0.0.267932 → 2.0.0-dev-rc.5.0.0.270401
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 → container-runtime.alpha.api.md} +4 -477
- package/api-report/container-runtime.beta.api.md +73 -0
- package/api-report/container-runtime.public.api.md +73 -0
- package/container-runtime.test-files.tar +0 -0
- package/dist/batchTracker.js +5 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +1 -18
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +39 -48
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +2 -11
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +33 -48
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +1 -2
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +32 -14
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.js +4 -0
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +7 -18
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +145 -43
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +9 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -16
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +142 -120
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.js +29 -28
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.js +1 -0
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerProxies.d.ts +4 -4
- package/dist/deltaManagerProxies.d.ts.map +1 -1
- package/dist/deltaManagerProxies.js +33 -28
- package/dist/deltaManagerProxies.js.map +1 -1
- package/dist/deltaScheduler.d.ts +1 -2
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +13 -9
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.js +2 -1
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +37 -17
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +0 -4
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +1 -3
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +19 -14
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.js +12 -5
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +12 -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 +1 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/messageTypes.d.ts +1 -1
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/batchManager.js +5 -3
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/opCompressor.js +1 -0
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +6 -4
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +3 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +6 -0
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.js +15 -10
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +3 -0
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.d.ts +1 -1
- package/dist/opProperties.d.ts.map +1 -1
- package/dist/opProperties.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 +34 -18
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +1 -2
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +15 -4
- package/dist/scheduleManager.js.map +1 -1
- package/dist/storageServiceWithAttachBlobs.js +1 -0
- package/dist/storageServiceWithAttachBlobs.js.map +1 -1
- package/dist/summary/documentSchema.js +17 -1
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/orderedClientElection.js +19 -11
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +4 -2
- 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 +56 -38
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.js +17 -8
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.js +18 -7
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +30 -25
- 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 +12 -3
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +20 -6
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +2 -2
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +1 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +23 -11
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +1 -2
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.js +12 -5
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.js +58 -48
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.js +4 -1
- package/dist/throttler.js.map +1 -1
- package/lib/batchTracker.js +5 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +1 -18
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +39 -48
- package/lib/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +2 -11
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +34 -49
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +1 -2
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +33 -15
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.js +4 -0
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +7 -18
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +145 -43
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +9 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -16
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +144 -122
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.js +29 -28
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.js +1 -0
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerProxies.d.ts +4 -4
- package/lib/deltaManagerProxies.d.ts.map +1 -1
- package/lib/deltaManagerProxies.js +33 -28
- package/lib/deltaManagerProxies.js.map +1 -1
- package/lib/deltaScheduler.d.ts +1 -2
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +13 -9
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.js +2 -1
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +37 -17
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +0 -4
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +0 -2
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +19 -14
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.js +12 -5
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +12 -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/messageTypes.d.ts +1 -1
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/batchManager.js +5 -3
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/opCompressor.js +1 -0
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +6 -4
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +3 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +6 -0
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.js +15 -10
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +4 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.d.ts +1 -1
- package/lib/opProperties.d.ts.map +1 -1
- package/lib/opProperties.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 +34 -18
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts +1 -2
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +15 -4
- package/lib/scheduleManager.js.map +1 -1
- package/lib/storageServiceWithAttachBlobs.js +1 -0
- package/lib/storageServiceWithAttachBlobs.js.map +1 -1
- package/lib/summary/documentSchema.js +17 -1
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/orderedClientElection.js +19 -11
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +4 -2
- 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 +57 -39
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.js +17 -8
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.js +18 -7
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +30 -25
- 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 +12 -3
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +20 -6
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +2 -2
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +1 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +23 -11
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +1 -2
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.js +12 -5
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.js +58 -48
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.js +4 -1
- package/lib/throttler.js.map +1 -1
- package/package.json +19 -19
- package/src/batchTracker.ts +1 -1
- package/src/blobManager.ts +1 -39
- package/src/channelCollection.ts +19 -72
- package/src/connectionTelemetry.ts +5 -2
- package/src/containerRuntime.ts +9 -32
- package/src/dataStoreContext.ts +4 -38
- package/src/deltaManagerProxies.ts +3 -5
- package/src/deltaScheduler.ts +4 -2
- package/src/gc/garbageCollection.ts +0 -2
- package/src/gc/gcDefinitions.ts +0 -4
- package/src/gc/index.ts +0 -1
- package/src/messageTypes.ts +1 -1
- package/src/opLifecycle/opDecompressor.ts +1 -1
- package/src/opLifecycle/opGroupingManager.ts +1 -1
- package/src/opLifecycle/opSplitter.ts +1 -1
- package/src/opLifecycle/remoteMessageProcessor.ts +4 -2
- package/src/opProperties.ts +4 -2
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +16 -5
- package/src/scheduleManager.ts +4 -2
- package/src/summary/images/appTree.png +0 -0
- package/src/summary/images/protocolAndAppTree.png +0 -0
- package/src/summary/images/summaryTree.png +0 -0
- package/src/summary/runningSummarizer.ts +5 -2
- package/src/summary/summarizerNode/summarizerNode.ts +5 -2
- package/src/summary/summarizerTypes.ts +5 -2
- package/src/summary/summaryCollection.ts +1 -1
- package/src/summary/summaryFormat.ts +2 -1
- package/src/summary/summaryFormats.md +160 -0
- package/tsconfig.json +2 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
7
7
|
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { assert, Lazy } from "@fluidframework/core-utils/internal";
|
|
9
|
-
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
|
|
9
|
+
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
10
10
|
import {
|
|
11
11
|
ITelemetryLoggerExt,
|
|
12
12
|
DataProcessingError,
|
|
@@ -75,6 +75,13 @@ function buildPendingMessageContent(
|
|
|
75
75
|
return JSON.stringify({ type, contents, compatDetails });
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
function withoutLocalOpMetadata(message: IPendingMessage): IPendingMessage {
|
|
79
|
+
return {
|
|
80
|
+
...message,
|
|
81
|
+
localOpMetadata: undefined,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
78
85
|
/**
|
|
79
86
|
* PendingStateManager is responsible for maintaining the messages that have not been sent or have not yet been
|
|
80
87
|
* acknowledged by the server. It also maintains the batch information for both automatically and manually flushed
|
|
@@ -138,6 +145,9 @@ export class PendingStateManager implements IDisposable {
|
|
|
138
145
|
this.initialMessages.isEmpty(),
|
|
139
146
|
0x2e9 /* "Must call getLocalState() after applying initial states" */,
|
|
140
147
|
);
|
|
148
|
+
// Using snapshot sequence number to filter ops older than our latest snapshot.
|
|
149
|
+
// Such ops should not be declared in pending/stashed state. Snapshot seq num will not
|
|
150
|
+
// be available when the container is not attached. Therefore, no filtering is needed.
|
|
141
151
|
const newSavedOps = [...this.savedOps].filter((message) => {
|
|
142
152
|
assert(
|
|
143
153
|
message.sequenceNumber !== undefined,
|
|
@@ -154,9 +164,10 @@ export class PendingStateManager implements IDisposable {
|
|
|
154
164
|
}
|
|
155
165
|
});
|
|
156
166
|
return {
|
|
157
|
-
pendingStates: [
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
pendingStates: [
|
|
168
|
+
...newSavedOps,
|
|
169
|
+
...this.pendingMessages.toArray().map(withoutLocalOpMetadata),
|
|
170
|
+
],
|
|
160
171
|
};
|
|
161
172
|
}
|
|
162
173
|
|
|
@@ -251,7 +262,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
251
262
|
0x169 /* "No pending message found for this remote message" */,
|
|
252
263
|
);
|
|
253
264
|
pendingMessage.sequenceNumber = message.sequenceNumber;
|
|
254
|
-
this.savedOps.push(pendingMessage);
|
|
265
|
+
this.savedOps.push(withoutLocalOpMetadata(pendingMessage));
|
|
255
266
|
|
|
256
267
|
this.pendingMessages.shift();
|
|
257
268
|
|
package/src/scheduleManager.ts
CHANGED
|
@@ -7,8 +7,10 @@ import type { EventEmitter } from "@fluid-internal/client-utils";
|
|
|
7
7
|
import { performance } from "@fluid-internal/client-utils";
|
|
8
8
|
import { IDeltaManager } from "@fluidframework/container-definitions/internal";
|
|
9
9
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
10
|
-
import {
|
|
11
|
-
|
|
10
|
+
import {
|
|
11
|
+
IDocumentMessage,
|
|
12
|
+
ISequencedDocumentMessage,
|
|
13
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
12
14
|
import { isRuntimeMessage } from "@fluidframework/driver-utils/internal";
|
|
13
15
|
import {
|
|
14
16
|
ITelemetryLoggerExt,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { assert, Deferred, PromiseTimer, delay } from "@fluidframework/core-utils/internal";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
DriverErrorTypes,
|
|
11
|
+
MessageType,
|
|
12
|
+
ISequencedDocumentMessage,
|
|
13
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
11
14
|
import {
|
|
12
15
|
MonitoringContext,
|
|
13
16
|
UsageError,
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { SummaryType } from "@fluidframework/driver-definitions";
|
|
9
|
+
import {
|
|
10
|
+
ISnapshotTree,
|
|
11
|
+
ISequencedDocumentMessage,
|
|
12
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
10
13
|
import {
|
|
11
14
|
IExperimentalIncrementalSummaryContext,
|
|
12
15
|
ITelemetryContext,
|
|
@@ -10,8 +10,11 @@ import {
|
|
|
10
10
|
ITelemetryBaseProperties,
|
|
11
11
|
ITelemetryBaseLogger,
|
|
12
12
|
} from "@fluidframework/core-interfaces";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
14
|
+
import {
|
|
15
|
+
IDocumentMessage,
|
|
16
|
+
ISequencedDocumentMessage,
|
|
17
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
15
18
|
import { ISummaryStats } from "@fluidframework/runtime-definitions/internal";
|
|
16
19
|
import {
|
|
17
20
|
ITelemetryLoggerExt,
|
|
@@ -7,13 +7,13 @@ import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
|
7
7
|
import { IDeltaManager } from "@fluidframework/container-definitions/internal";
|
|
8
8
|
import { IDisposable, IEvent } from "@fluidframework/core-interfaces";
|
|
9
9
|
import { assert, Deferred } from "@fluidframework/core-utils/internal";
|
|
10
|
-
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
|
|
11
10
|
import {
|
|
12
11
|
IDocumentMessage,
|
|
13
12
|
ISummaryAck,
|
|
14
13
|
ISummaryContent,
|
|
15
14
|
ISummaryNack,
|
|
16
15
|
MessageType,
|
|
16
|
+
ISequencedDocumentMessage,
|
|
17
17
|
} from "@fluidframework/driver-definitions/internal";
|
|
18
18
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
19
19
|
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import {
|
|
7
|
+
import { SummaryType } from "@fluidframework/driver-definitions";
|
|
8
8
|
import {
|
|
9
9
|
IDocumentStorageService,
|
|
10
10
|
ISnapshotTree,
|
|
11
|
+
ISequencedDocumentMessage,
|
|
11
12
|
} from "@fluidframework/driver-definitions/internal";
|
|
12
13
|
import {
|
|
13
14
|
blobHeadersBlobName as blobNameForBlobHeaders,
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Summary and snapshot formats
|
|
2
|
+
|
|
3
|
+
## Table of contents
|
|
4
|
+
|
|
5
|
+
- [Introduction](#introduction)
|
|
6
|
+
- [Summary Format](#summary-format)
|
|
7
|
+
- [Snapshot Format](#snapshot-format)
|
|
8
|
+
- [Summary / Snapshot Tree Visualization](#summary--snapshot-tree-visualization)
|
|
9
|
+
- [Protocol Tree](#protocol-tree)
|
|
10
|
+
- [App Tree](#app-tree)
|
|
11
|
+
- [Summary Tree distinction](#summary-tree-distinction)
|
|
12
|
+
|
|
13
|
+
## Introduction
|
|
14
|
+
|
|
15
|
+
This document describes the format of summaries and snapshots. For learning the differences between summaries and snapshots, see the FAQ section [here](https://fluidframework.com/docs/faq/#whats-the-difference-between-a-summary-and-a-snapshot).
|
|
16
|
+
|
|
17
|
+
The goal of this document is to describe the fundamental structure of a summary / snapshot tree as produced by the runtime, to explain the various node types within the tree along with their respective data, and to show the distinctions between a summary tree and a snapshot tree.
|
|
18
|
+
|
|
19
|
+
## Summary Format
|
|
20
|
+
|
|
21
|
+
Summary is uploaded to storage and is the container's state at a point in time. A summary is represented by an `ISummaryTree` which is defined in [this file](../../../../../common/lib/protocol-definitions/src/summary.ts) and has the following basic structure (some optional properties are removed for simplicity):
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
export interface ISummaryTree {
|
|
25
|
+
type: SummaryType.Tree;
|
|
26
|
+
tree: { [path: string]: SummaryObject };
|
|
27
|
+
}
|
|
28
|
+
export type SummaryType =
|
|
29
|
+
| SummaryType.Attachment
|
|
30
|
+
| SummaryType.Blob
|
|
31
|
+
| SummaryType.Handle
|
|
32
|
+
| SummaryType.Tree;
|
|
33
|
+
export type SummaryObject = ISummaryTree | ISummaryBlob | ISummaryHandle | ISummaryAttachment;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Each tree node in a summary tree is represented by the `ISummaryTree` interface above and contains the following:
|
|
37
|
+
|
|
38
|
+
- `type` - `SummaryType.Tree`
|
|
39
|
+
- `tree` - A list of children of the tree node. Each child node has the following format:
|
|
40
|
+
|
|
41
|
+
`<tree name>`: `<SummaryObject>` where `tree name` is the name given to the child node and `SummaryObject` is one of the following:
|
|
42
|
+
|
|
43
|
+
- `ISummaryTree` - A subtree which has the same structure as this node. For example, container runtime will have subtrees for its data store which in turn will have subtrees for its DDSes.
|
|
44
|
+
|
|
45
|
+
- `ISummaryBlob` - A blob that has some content for this node. For example, a DDS's node has a ".attributes" blob for its attributes such as type, snapshot versions, etc. It may have additional blobs for the actual user content in the DDS.
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
export interface ISummaryBlob {
|
|
49
|
+
type: SummaryType.Blob;
|
|
50
|
+
content: string | Uint8Array;
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- `ISummaryAttachment` - This is used for attachment blobs that are uploaded to and downloaded from storage directly. The contents of these blobs are not part of the summary. Storage returns an ID after the attachment has been uploaded and this ID is included in the summary attachment. For example, a DDS can upload some of its large content directly to storage and include its ID in the summary.
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
export interface ISummaryAttachment {
|
|
58
|
+
type: SummaryType.Attachment;
|
|
59
|
+
id: string;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- `ISummaryHandle` - A summary handle is used for incremental summaries. If a node hasn't changed since the last successful summary, instead of sending it's entire contents, it can send a "handle" which is a path to its summary tree object in the last summary. For example, if a data store or DDS did not change since the last summary, the runtime will use a handle for the entire data store instead of re-sending the entire subtree. The same concept applies for a summary blob or a summary attachment and the "handleType" should be set according to the type of the node. An example of "handle" that a DDS sends would be something like: "/_dataStoreId_/_ddsId_".
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
export interface ISummaryHandle {
|
|
67
|
+
type: SummaryType.Handle;
|
|
68
|
+
handleType: SummaryTypeNoHandle;
|
|
69
|
+
handle: string;
|
|
70
|
+
}
|
|
71
|
+
export type SummaryTypeNoHandle =
|
|
72
|
+
| SummaryType.Tree
|
|
73
|
+
| SummaryType.Blob
|
|
74
|
+
| SummaryType.Attachment;
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Snapshot Format
|
|
78
|
+
|
|
79
|
+
Snapshot is downloaded from the storage (typically on document load) and is the container's state at a point in time. A snapshot is represented by an `ISnapshotTree` which is defined in [this file](../../../../../common/lib/protocol-definitions/src/storage.ts) and has the following basic structure (some optional properties are removed for simplicity):
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
export interface ISnapshotTree {
|
|
83
|
+
blobs: { [path: string]: string };
|
|
84
|
+
trees: { [path: string]: ISnapshotTree };
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Each node in a snapshot tree is represented by the above interface and contains the following:
|
|
89
|
+
|
|
90
|
+
- `blobs` - A list of blobs that have the contents for the node. For example, a DDS's node has a ".attributes" blob for its attributes such as type, snapshot versions, etc. It may have additional blobs for the actual user content in the DDS. Each blob in the list has the following format:
|
|
91
|
+
|
|
92
|
+
`<blob name>`: `<unique blob id>` where `blob name` is the name given to the blob by the node and `unique blob id` is the id that uniquely represents the blob's content in storage.
|
|
93
|
+
|
|
94
|
+
When a node needs the content of a blob, it fetches it from storage by calling `readBlob` and providing the `unique blob id`.
|
|
95
|
+
|
|
96
|
+
> Note: Summary attachments (described in summary format) are also part of this list.
|
|
97
|
+
|
|
98
|
+
- `trees` - A list of subtrees of the node. For example, container runtime will have subtrees for its data store which in turn will have subtrees for its DDSes. Each subtree in the list has the following format:
|
|
99
|
+
|
|
100
|
+
`<tree name>`: `<snapshot tree>` where `tree name` is the name given to the subtree by the node and `snapshot tree` is its content in `ISnapshotTree` format.
|
|
101
|
+
|
|
102
|
+
## Summary / Snapshot Tree Visualization
|
|
103
|
+
|
|
104
|
+
This section shows what a typical summary or snapshot tree in a container looks like. Some key things to note:
|
|
105
|
+
|
|
106
|
+
- The diagrams in this section show some examples of existing blobs / trees that are added at each node and doesn't show an exhaustive list.
|
|
107
|
+
- The blue boxes represent tree nodes.
|
|
108
|
+
- The green boxes represent blobs.
|
|
109
|
+
- The purple boxes represent attachments.
|
|
110
|
+
- The orange boxes represent other nodes - either existing nodes that are not shown or new nodes that may be added in the future. A node can be a tree, blob or attachment.
|
|
111
|
+
|
|
112
|
+
A typical tree uploaded to or downloaded from storage looks like the following:
|
|
113
|
+

|
|
114
|
+
|
|
115
|
+
`Protocol tree` - This is the tree named `.protocol` and contains protocol level information for the container. These are used by the container to initialize.
|
|
116
|
+
|
|
117
|
+
`App tree` - This is the tree named `.app` and contains the container's state and data. The subtree under .app is what is generated by the container runtime.
|
|
118
|
+
|
|
119
|
+
### Protocol tree
|
|
120
|
+
|
|
121
|
+
The contents of the protocol tree are:
|
|
122
|
+
|
|
123
|
+
- `attributes blob` - Attributes such as the sequence number the summary was taken at.
|
|
124
|
+
- `quorum members blob` - The members in the quorum at the time summary was taken.
|
|
125
|
+
- `quorum proposals blob` - The quorum proposals at the time summary was taken.
|
|
126
|
+
- `quorum values blob` - The quorum values at the time summary was taken.
|
|
127
|
+
- Other blobs and trees may be added at this level as needed.
|
|
128
|
+
|
|
129
|
+
### App tree
|
|
130
|
+
|
|
131
|
+
This is what the ".app" tree looks like which is generated by the container runtime during summary upload. The same is passed to container runtime during snapshot download:
|
|
132
|
+

|
|
133
|
+
|
|
134
|
+
- `Container`: The root represents the container or container runtime node. Its contents are described below:
|
|
135
|
+
|
|
136
|
+
- `.metadata blob` - The container level metadata such as creation time, create version, etc.
|
|
137
|
+
- `.aliases blob` - The list of aliases for data stores and the corresponding internal id.
|
|
138
|
+
- `.idCompressor blob` - The data for the ID compressor.
|
|
139
|
+
- `.blobs tree` - The snapshot for the attachment blobs added by the blob manager. The individual attachment blobs are present as summary attachments (`ISummaryAttachment`).
|
|
140
|
+
- `gc tree` - The snapshot for garbage collection added by the garbage collector.
|
|
141
|
+
- `.channels tree` - The subtrees for all the data stores.
|
|
142
|
+
- There may be other blobs and trees added at this level as needed.
|
|
143
|
+
|
|
144
|
+
- `Data store`: Data store snapshot trees are under ".channels" subtree of container runtime's tree. Its contents are described below:
|
|
145
|
+
|
|
146
|
+
- `.component blob` - The attributes for a data store such as the package name, snapshot version, etc.
|
|
147
|
+
- `.channels tree` - The subtrees for all its DDSs.
|
|
148
|
+
- There may be other blobs and trees added at this level as needed.
|
|
149
|
+
|
|
150
|
+
- `DDS`: DDS snapshot trees are under ".channels" subtree of its parent data store's tree. Its contents are described below:
|
|
151
|
+
- `.attributes blob` - The attributes for a DDS such as the type, snapshot version, etc.
|
|
152
|
+
- `.header blob` - Added by some DDSs and may contains its data. Note that all DDSs may not add this.
|
|
153
|
+
- A DDS may add other blobs and / or trees to represent its data. Basically, a DDS can write its data in any form
|
|
154
|
+
|
|
155
|
+
### Summary tree distinction
|
|
156
|
+
|
|
157
|
+
In the visualization above, a summary tree differs from a snapshot tree in the following way:
|
|
158
|
+
A summary tree supports incremental summaries via summary handles. Any node in the tree that has not changed since the previous successful summary can send a summary handle (`ISummaryHandle`) instead of sending its entire contents in a full summary. The following diagram shows this with an example where certain parts of the summary tree use a summary handle. It is a zoomed in version of the same app tree as above where nodes where summary handles are marked in red:
|
|
159
|
+
|
|
160
|
+

|