@fluidframework/container-runtime 2.0.0-rc.3.0.3 → 2.0.0-rc.4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/api-report/container-runtime.api.md +72 -34
- package/dist/batchTracker.d.ts +1 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +7 -7
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +2 -4
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +6 -4
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +20 -7
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +2 -2
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +54 -5
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +17 -35
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +194 -163
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +9 -6
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +19 -5
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/deltaManagerProxies.d.ts +81 -0
- package/dist/deltaManagerProxies.d.ts.map +1 -0
- package/dist/{deltaManagerSummarizerProxy.js → deltaManagerProxies.js} +75 -20
- package/dist/deltaManagerProxies.js.map +1 -0
- package/dist/deltaScheduler.d.ts +2 -2
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +1 -1
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +1 -2
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.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 +6 -1
- package/dist/messageTypes.d.ts +5 -2
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/metadata.d.ts +2 -2
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +4 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +0 -10
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +0 -4
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +7 -38
- 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 +9 -2
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +26 -10
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +2 -2
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +3 -1
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +25 -7
- 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 +2 -2
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runningSummarizer.js +10 -10
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -2
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +4 -3
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +4 -10
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -3
- 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 +1 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +2 -9
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +3 -5
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +2 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +25 -5
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +1 -2
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +12 -11
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +5 -5
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +7 -7
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +3 -5
- package/lib/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +6 -4
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +21 -8
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +2 -2
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +49 -0
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +17 -35
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +195 -164
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +1 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +9 -6
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +21 -7
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/deltaManagerProxies.d.ts +81 -0
- package/lib/deltaManagerProxies.d.ts.map +1 -0
- package/lib/{deltaManagerSummarizerProxy.js → deltaManagerProxies.js} +72 -19
- package/lib/deltaManagerProxies.js.map +1 -0
- package/lib/deltaScheduler.d.ts +2 -2
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +1 -1
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +1 -2
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.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 +6 -1
- package/lib/messageTypes.d.ts +5 -2
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/metadata.d.ts +2 -2
- package/lib/metadata.d.ts.map +1 -1
- package/lib/metadata.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +4 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +0 -10
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +0 -4
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -38
- 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 +9 -2
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +27 -11
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts +2 -2
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +3 -1
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +25 -7
- 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 +2 -2
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runningSummarizer.js +1 -1
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -2
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +4 -3
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +4 -10
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -3
- 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 +1 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +2 -9
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +3 -5
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +2 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +25 -5
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +1 -2
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +5 -4
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +2 -2
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +28 -50
- package/src/batchTracker.ts +1 -2
- package/src/blobManager.ts +11 -10
- package/src/channelCollection.ts +30 -12
- package/src/connectionTelemetry.ts +59 -4
- package/src/containerRuntime.ts +262 -239
- package/src/dataStore.ts +7 -4
- package/src/dataStoreContext.ts +57 -16
- package/src/dataStoreContexts.ts +1 -2
- package/src/{deltaManagerSummarizerProxy.ts → deltaManagerProxies.ts} +98 -24
- package/src/deltaScheduler.ts +2 -3
- package/src/gc/garbageCollection.ts +1 -1
- package/src/gc/gcDefinitions.ts +1 -1
- package/src/gc/gcTelemetry.ts +1 -3
- package/src/index.ts +5 -0
- package/src/messageTypes.ts +4 -2
- package/src/metadata.ts +2 -2
- package/src/opLifecycle/README.md +4 -4
- package/src/opLifecycle/batchManager.ts +5 -14
- package/src/opLifecycle/outbox.ts +7 -53
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +38 -15
- package/src/scheduleManager.ts +2 -2
- package/src/summary/documentSchema.ts +37 -12
- package/src/summary/index.ts +4 -0
- package/src/summary/orderedClientElection.ts +6 -3
- package/src/summary/runningSummarizer.ts +1 -1
- package/src/summary/summarizer.ts +1 -1
- package/src/summary/summarizerClientElection.ts +1 -1
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/summarizerNode.ts +3 -12
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +2 -3
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +1 -10
- package/src/summary/summarizerTypes.ts +6 -5
- package/src/summary/summaryCollection.ts +2 -2
- package/src/summary/summaryFormat.ts +30 -4
- package/src/summary/summaryGenerator.ts +20 -9
- package/src/summary/summaryManager.ts +6 -3
- package/dist/deltaManagerSummarizerProxy.d.ts +0 -44
- package/dist/deltaManagerSummarizerProxy.d.ts.map +0 -1
- package/dist/deltaManagerSummarizerProxy.js.map +0 -1
- package/lib/deltaManagerSummarizerProxy.d.ts +0 -44
- package/lib/deltaManagerSummarizerProxy.d.ts.map +0 -1
- package/lib/deltaManagerSummarizerProxy.js.map +0 -1
package/src/packageVersion.ts
CHANGED
|
@@ -7,8 +7,11 @@ 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
9
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
10
|
-
import {
|
|
11
|
-
|
|
10
|
+
import {
|
|
11
|
+
ITelemetryLoggerExt,
|
|
12
|
+
DataProcessingError,
|
|
13
|
+
LoggingError,
|
|
14
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
12
15
|
import Deque from "double-ended-queue";
|
|
13
16
|
|
|
14
17
|
import { InboundSequencedContainerRuntimeMessage } from "./messageTypes.js";
|
|
@@ -25,6 +28,7 @@ export interface IPendingMessage {
|
|
|
25
28
|
content: string;
|
|
26
29
|
localOpMetadata: unknown;
|
|
27
30
|
opMetadata: Record<string, unknown> | undefined;
|
|
31
|
+
sequenceNumber?: number;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
export interface IPendingLocalState {
|
|
@@ -82,6 +86,7 @@ function buildPendingMessageContent(
|
|
|
82
86
|
*/
|
|
83
87
|
export class PendingStateManager implements IDisposable {
|
|
84
88
|
private readonly pendingMessages = new Deque<IPendingMessage>();
|
|
89
|
+
// This queue represents already acked messages.
|
|
85
90
|
private readonly initialMessages = new Deque<IPendingMessage>();
|
|
86
91
|
|
|
87
92
|
/**
|
|
@@ -111,6 +116,15 @@ export class PendingStateManager implements IDisposable {
|
|
|
111
116
|
return this.pendingMessages.length + this.initialMessages.length;
|
|
112
117
|
}
|
|
113
118
|
|
|
119
|
+
/**
|
|
120
|
+
* The minimumPendingMessageSequenceNumber is the minimum of the first pending message and the first initial message.
|
|
121
|
+
*
|
|
122
|
+
* We need this so that we can properly keep local data and maintain the correct sequence window.
|
|
123
|
+
*/
|
|
124
|
+
public get minimumPendingMessageSequenceNumber(): number | undefined {
|
|
125
|
+
return this.pendingMessages.peekFront()?.referenceSequenceNumber;
|
|
126
|
+
}
|
|
127
|
+
|
|
114
128
|
/**
|
|
115
129
|
* Called to check if there are any pending messages in the pending message queue.
|
|
116
130
|
* @returns A boolean indicating whether there are messages or not.
|
|
@@ -119,22 +133,31 @@ export class PendingStateManager implements IDisposable {
|
|
|
119
133
|
return this.pendingMessagesCount !== 0;
|
|
120
134
|
}
|
|
121
135
|
|
|
122
|
-
public getLocalState(): IPendingLocalState
|
|
136
|
+
public getLocalState(snapshotSequenceNumber?: number): IPendingLocalState {
|
|
123
137
|
assert(
|
|
124
138
|
this.initialMessages.isEmpty(),
|
|
125
139
|
0x2e9 /* "Must call getLocalState() after applying initial states" */,
|
|
126
140
|
);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
const newSavedOps = [...this.savedOps].filter((message) => {
|
|
142
|
+
assert(
|
|
143
|
+
message.sequenceNumber !== undefined,
|
|
144
|
+
0x97c /* saved op should already have a sequence number */,
|
|
145
|
+
);
|
|
146
|
+
return message.sequenceNumber >= (snapshotSequenceNumber ?? 0);
|
|
147
|
+
});
|
|
148
|
+
this.pendingMessages.toArray().forEach((message) => {
|
|
149
|
+
if (
|
|
150
|
+
snapshotSequenceNumber !== undefined &&
|
|
151
|
+
message.referenceSequenceNumber < snapshotSequenceNumber
|
|
152
|
+
) {
|
|
153
|
+
throw new LoggingError("trying to stash ops older than our latest snapshot");
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
pendingStates: [...newSavedOps, ...this.pendingMessages.toArray()].map((message) => {
|
|
158
|
+
return { ...message, localOpMetadata: undefined };
|
|
159
|
+
}),
|
|
160
|
+
};
|
|
138
161
|
}
|
|
139
162
|
|
|
140
163
|
constructor(
|
|
@@ -221,13 +244,13 @@ export class PendingStateManager implements IDisposable {
|
|
|
221
244
|
public processPendingLocalMessage(message: InboundSequencedContainerRuntimeMessage): unknown {
|
|
222
245
|
// Pre-processing part - This may be the start of a batch.
|
|
223
246
|
this.maybeProcessBatchBegin(message);
|
|
224
|
-
|
|
225
247
|
// Get the next message from the pending queue. Verify a message exists.
|
|
226
248
|
const pendingMessage = this.pendingMessages.peekFront();
|
|
227
249
|
assert(
|
|
228
250
|
pendingMessage !== undefined,
|
|
229
251
|
0x169 /* "No pending message found for this remote message" */,
|
|
230
252
|
);
|
|
253
|
+
pendingMessage.sequenceNumber = message.sequenceNumber;
|
|
231
254
|
this.savedOps.push(pendingMessage);
|
|
232
255
|
|
|
233
256
|
this.pendingMessages.shift();
|
package/src/scheduleManager.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
import type { EventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import { performance } from "@fluid-internal/client-utils";
|
|
8
|
-
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
8
|
+
import { IDeltaManager } from "@fluidframework/container-definitions/internal";
|
|
9
9
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
10
10
|
import { isRuntimeMessage } from "@fluidframework/driver-utils/internal";
|
|
11
11
|
import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
12
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
13
12
|
import {
|
|
13
|
+
ITelemetryLoggerExt,
|
|
14
14
|
DataCorruptionError,
|
|
15
15
|
DataProcessingError,
|
|
16
16
|
createChildLogger,
|
|
@@ -228,7 +228,10 @@ const documentSchemaSupportedConfigs = {
|
|
|
228
228
|
* If schema is not compatible with current code, it throws an exception.
|
|
229
229
|
* @param documentSchema - current schema
|
|
230
230
|
*/
|
|
231
|
-
function checkRuntimeCompatibility(
|
|
231
|
+
function checkRuntimeCompatibility(
|
|
232
|
+
documentSchema: IDocumentSchema | undefined,
|
|
233
|
+
schemaName: string,
|
|
234
|
+
) {
|
|
232
235
|
// Back-compat - we can't do anything about legacy documents.
|
|
233
236
|
// There is no way to validate them, so we are taking a guess that safe deployment processes used by a given app
|
|
234
237
|
// do not run into compat problems.
|
|
@@ -245,6 +248,7 @@ function checkRuntimeCompatibility(documentSchema?: IDocumentSchema) {
|
|
|
245
248
|
{
|
|
246
249
|
runtimeSchemaVersion: documentSchema.version,
|
|
247
250
|
currentRuntimeSchemaVersion: currentDocumentVersionSchema,
|
|
251
|
+
schemaName,
|
|
248
252
|
},
|
|
249
253
|
);
|
|
250
254
|
}
|
|
@@ -276,6 +280,7 @@ function checkRuntimeCompatibility(documentSchema?: IDocumentSchema) {
|
|
|
276
280
|
codeVersion: currentDocumentVersionSchema,
|
|
277
281
|
property: unknownProperty,
|
|
278
282
|
value,
|
|
283
|
+
schemaName,
|
|
279
284
|
},
|
|
280
285
|
);
|
|
281
286
|
}
|
|
@@ -432,8 +437,8 @@ export class DocumentsSchemaController {
|
|
|
432
437
|
private futureSchema: IDocumentSchemaCurrent | undefined;
|
|
433
438
|
|
|
434
439
|
// Current schema this session operates with.
|
|
435
|
-
// 1) Legacy mode: this is same as desired schema - all options that were requested to be on are on, and all options requested to be off are off.
|
|
436
|
-
// 2) Non-legacy mode: this is AND() of document schema and desired schema. Only options that are enabled in both are enabled here.
|
|
440
|
+
// 1) Legacy mode (explicitSchemaControl === false): this is same as desired schema - all options that were requested to be on are on, and all options requested to be off are off.
|
|
441
|
+
// 2) Non-legacy mode (explicitSchemaControl === true): this is AND() of document schema and desired schema. Only options that are enabled in both are enabled here.
|
|
437
442
|
// If there are any options that are not enabled in document schema, but are enabled in desired schema, then attempt to change schema
|
|
438
443
|
// (and enable such options) will be made through the session.
|
|
439
444
|
public sessionSchema: IDocumentSchemaCurrent;
|
|
@@ -447,12 +452,11 @@ export class DocumentsSchemaController {
|
|
|
447
452
|
*/
|
|
448
453
|
constructor(
|
|
449
454
|
existing: boolean,
|
|
455
|
+
snapshotSequenceNumber: number,
|
|
450
456
|
documentMetadataSchema: IDocumentSchema | undefined,
|
|
451
457
|
features: IDocumentSchemaFeatures,
|
|
452
458
|
private readonly onSchemaChange: (schema: IDocumentSchemaCurrent) => void,
|
|
453
459
|
) {
|
|
454
|
-
checkRuntimeCompatibility(documentMetadataSchema);
|
|
455
|
-
|
|
456
460
|
// For simplicity, let's only support new schema features for explicit schema control mode
|
|
457
461
|
assert(
|
|
458
462
|
features.disallowedVersions.length === 0 || features.explicitSchemaControl,
|
|
@@ -491,6 +495,9 @@ export class DocumentsSchemaController {
|
|
|
491
495
|
},
|
|
492
496
|
} satisfies IDocumentSchemaCurrent);
|
|
493
497
|
|
|
498
|
+
checkRuntimeCompatibility(this.documentSchema, "document");
|
|
499
|
+
this.validateSeqNumber(this.documentSchema.refSeq, snapshotSequenceNumber, "summary");
|
|
500
|
+
|
|
494
501
|
// Use legacy behavior only if both document and options tell us to use legacy.
|
|
495
502
|
// Otherwise it's no longer legacy time!
|
|
496
503
|
this.explicitSchemaControl =
|
|
@@ -519,8 +526,9 @@ export class DocumentsSchemaController {
|
|
|
519
526
|
}
|
|
520
527
|
|
|
521
528
|
// Validate that schema we are operating in is actually a schema we consider compatible with current runtime.
|
|
522
|
-
checkRuntimeCompatibility(this.
|
|
523
|
-
checkRuntimeCompatibility(this.
|
|
529
|
+
checkRuntimeCompatibility(this.desiredSchema, "desired");
|
|
530
|
+
checkRuntimeCompatibility(this.sessionSchema, "session");
|
|
531
|
+
checkRuntimeCompatibility(this.futureSchema, "future");
|
|
524
532
|
}
|
|
525
533
|
|
|
526
534
|
public summarizeDocumentSchema(refSeq: number): IDocumentSchemaCurrent | undefined {
|
|
@@ -548,6 +556,7 @@ export class DocumentsSchemaController {
|
|
|
548
556
|
/**
|
|
549
557
|
* Called by Container runtime whenever it is about to send some op.
|
|
550
558
|
* It gives opportunity for controller to issue its own ops - we do not want to send ops if there are no local changes in document.
|
|
559
|
+
* Please consider note above constructor about race conditions - current design is to send op only once in a session lifetime.
|
|
551
560
|
* @returns Optional message to send.
|
|
552
561
|
*/
|
|
553
562
|
public maybeSendSchemaMessage(): IDocumentSchemaChangeMessage | undefined {
|
|
@@ -565,6 +574,21 @@ export class DocumentsSchemaController {
|
|
|
565
574
|
}
|
|
566
575
|
}
|
|
567
576
|
|
|
577
|
+
private validateSeqNumber(schemaSeqNumber: number, lastKnowSeqNumber, message: string) {
|
|
578
|
+
if (!Number.isInteger(schemaSeqNumber) || !(schemaSeqNumber <= lastKnowSeqNumber)) {
|
|
579
|
+
throw DataProcessingError.create(
|
|
580
|
+
"DocSchema: Incorrect sequence number",
|
|
581
|
+
"checkRuntimeCompat3",
|
|
582
|
+
undefined, // message
|
|
583
|
+
{
|
|
584
|
+
schemaSeqNumber,
|
|
585
|
+
sequenceNumber: lastKnowSeqNumber,
|
|
586
|
+
message,
|
|
587
|
+
},
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
568
592
|
/**
|
|
569
593
|
* Process document schema change message
|
|
570
594
|
* Called by ContainerRuntime whenever it sees document schema messages.
|
|
@@ -578,14 +602,14 @@ export class DocumentsSchemaController {
|
|
|
578
602
|
local: boolean,
|
|
579
603
|
sequenceNumber: number,
|
|
580
604
|
) {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
);
|
|
605
|
+
this.validateSeqNumber(content.refSeq, this.documentSchema.refSeq, "content.refSeq");
|
|
606
|
+
this.validateSeqNumber(this.documentSchema.refSeq, sequenceNumber, "refSeq");
|
|
607
|
+
// validate is strickly less, not equal
|
|
585
608
|
assert(
|
|
586
609
|
this.documentSchema.refSeq < sequenceNumber,
|
|
587
610
|
0x950 /* time should move forward only! */,
|
|
588
611
|
);
|
|
612
|
+
|
|
589
613
|
if (content.refSeq !== this.documentSchema.refSeq) {
|
|
590
614
|
// CAS failed
|
|
591
615
|
return false;
|
|
@@ -599,11 +623,12 @@ export class DocumentsSchemaController {
|
|
|
599
623
|
);
|
|
600
624
|
|
|
601
625
|
// Changes are in effect. Immediately check that this client understands these changes
|
|
602
|
-
checkRuntimeCompatibility(content);
|
|
626
|
+
checkRuntimeCompatibility(content, "change");
|
|
603
627
|
|
|
604
628
|
const schema: IDocumentSchema = { ...content, refSeq: sequenceNumber };
|
|
605
629
|
this.documentSchema = schema as IDocumentSchemaCurrent;
|
|
606
630
|
this.sessionSchema = and(this.documentSchema, this.desiredSchema);
|
|
631
|
+
assert(this.sessionSchema.refSeq === sequenceNumber, 0x97d /* seq# */);
|
|
607
632
|
|
|
608
633
|
// legacy behavior is automatically off for the document once someone sends a schema op -
|
|
609
634
|
// from now on it's fully controlled by ops.
|
package/src/summary/index.ts
CHANGED
|
@@ -98,6 +98,10 @@ export {
|
|
|
98
98
|
WriteFluidDataStoreAttributes,
|
|
99
99
|
wrapSummaryInChannelsTree,
|
|
100
100
|
idCompressorBlobName,
|
|
101
|
+
IFluidDataStoreAttributes0,
|
|
102
|
+
IFluidDataStoreAttributes1,
|
|
103
|
+
IFluidDataStoreAttributes2,
|
|
104
|
+
OmitAttributesVersions,
|
|
101
105
|
} from "./summaryFormat.js";
|
|
102
106
|
export {
|
|
103
107
|
IdCompressorMode,
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
/* eslint-disable @rushstack/no-new-null */
|
|
7
7
|
|
|
8
8
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
9
|
-
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
9
|
+
import { IDeltaManager } from "@fluidframework/container-definitions/internal";
|
|
10
10
|
import { IEvent, IEventProvider, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
11
11
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
12
12
|
import { IClient, IQuorumClients, ISequencedClient } from "@fluidframework/protocol-definitions";
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
ITelemetryLoggerExt,
|
|
15
|
+
UsageError,
|
|
16
|
+
createChildLogger,
|
|
17
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
15
18
|
|
|
16
19
|
import { summarizerClientType } from "./summarizerClientElection.js";
|
|
17
20
|
|
|
@@ -6,7 +6,7 @@
|
|
|
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 { DriverErrorTypes } from "@fluidframework/driver-definitions";
|
|
9
|
+
import { DriverErrorTypes } from "@fluidframework/driver-definitions/internal";
|
|
10
10
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
11
11
|
import {
|
|
12
12
|
MonitoringContext,
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import { IFluidHandleContext } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { Deferred } from "@fluidframework/core-utils/internal";
|
|
9
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
10
9
|
import {
|
|
11
10
|
IFluidErrorBase,
|
|
11
|
+
ITelemetryLoggerExt,
|
|
12
12
|
LoggingError,
|
|
13
13
|
UsageError,
|
|
14
14
|
createChildLogger,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
7
|
import { IEvent, IEventProvider } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { IClientDetails, MessageType } from "@fluidframework/protocol-definitions";
|
|
9
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
9
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
IOrderedClientElection,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { Timer } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
|
|
9
9
|
import { ISummaryConfigurationHeuristics } from "../containerRuntime.js";
|
|
10
10
|
|
|
@@ -23,8 +23,9 @@ import {
|
|
|
23
23
|
SummarizeInternalFn,
|
|
24
24
|
} from "@fluidframework/runtime-definitions/internal";
|
|
25
25
|
import { mergeStats } from "@fluidframework/runtime-utils/internal";
|
|
26
|
-
import { type ITelemetryErrorEventExt
|
|
26
|
+
import { type ITelemetryErrorEventExt } from "@fluidframework/telemetry-utils/internal";
|
|
27
27
|
import {
|
|
28
|
+
ITelemetryLoggerExt,
|
|
28
29
|
LoggingError,
|
|
29
30
|
PerformanceEvent,
|
|
30
31
|
TelemetryDataTag,
|
|
@@ -310,12 +311,11 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
310
311
|
* queue. We track this until we get an ack from the server for this summary.
|
|
311
312
|
* @param proposalHandle - The handle of the summary that was uploaded to the server.
|
|
312
313
|
*/
|
|
313
|
-
public completeSummary(proposalHandle: string
|
|
314
|
+
public completeSummary(proposalHandle: string) {
|
|
314
315
|
this.completeSummaryCore(
|
|
315
316
|
proposalHandle,
|
|
316
317
|
undefined /* parentPath */,
|
|
317
318
|
false /* parentSkipRecursion */,
|
|
318
|
-
validate,
|
|
319
319
|
);
|
|
320
320
|
}
|
|
321
321
|
|
|
@@ -331,15 +331,7 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
331
331
|
proposalHandle: string,
|
|
332
332
|
parentPath: EscapedPath | undefined,
|
|
333
333
|
parentSkipRecursion: boolean,
|
|
334
|
-
validate: boolean,
|
|
335
334
|
) {
|
|
336
|
-
if (validate && this.wasSummarizeMissed(parentSkipRecursion)) {
|
|
337
|
-
this.throwUnexpectedError({
|
|
338
|
-
eventName: "NodeDidNotSummarize",
|
|
339
|
-
proposalHandle,
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
|
|
343
335
|
assert(this.wipReferenceSequenceNumber !== undefined, 0x1a4 /* "Not tracking a summary" */);
|
|
344
336
|
let localPathsToUse = this.wipLocalPaths;
|
|
345
337
|
|
|
@@ -382,7 +374,6 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
382
374
|
proposalHandle,
|
|
383
375
|
fullPathForChildren,
|
|
384
376
|
this.wipSkipRecursion || parentSkipRecursion,
|
|
385
|
-
validate,
|
|
386
377
|
);
|
|
387
378
|
}
|
|
388
379
|
// Note that this overwrites existing pending summary with
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { ISnapshotTree, SummaryObject } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import { channelsTreeName } from "@fluidframework/runtime-definitions/internal";
|
|
8
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
9
|
-
import { TelemetryDataTag } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
+
import { ITelemetryLoggerExt, TelemetryDataTag } from "@fluidframework/telemetry-utils/internal";
|
|
10
9
|
|
|
11
10
|
export interface IRefreshSummaryResult {
|
|
12
11
|
/** Tells whether this summary is tracked by this client. */
|
|
@@ -53,7 +52,7 @@ export interface ISummarizerNodeRootContract {
|
|
|
53
52
|
latestSummaryRefSeqNum: number,
|
|
54
53
|
): IStartSummaryResult;
|
|
55
54
|
validateSummary(): ValidateSummaryResult;
|
|
56
|
-
completeSummary(proposalHandle: string
|
|
55
|
+
completeSummary(proposalHandle: string): void;
|
|
57
56
|
clearSummary(): void;
|
|
58
57
|
refreshLatestSummary(
|
|
59
58
|
proposalHandle: string,
|
|
@@ -306,28 +306,19 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
306
306
|
* @param parentPath - The path of the parent node which is used to build the path of this node.
|
|
307
307
|
* @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.
|
|
308
308
|
* In that case, the children will not have work-in-progress state.
|
|
309
|
-
* @param validate - true to validate that the in-progress summary is correct for all nodes.
|
|
310
309
|
*/
|
|
311
310
|
protected completeSummaryCore(
|
|
312
311
|
proposalHandle: string,
|
|
313
312
|
parentPath: EscapedPath | undefined,
|
|
314
313
|
parentSkipRecursion: boolean,
|
|
315
|
-
validate: boolean,
|
|
316
314
|
) {
|
|
317
|
-
if (validate && this.wasGCMissed()) {
|
|
318
|
-
this.throwUnexpectedError({
|
|
319
|
-
eventName: "NodeDidNotRunGC",
|
|
320
|
-
proposalHandle,
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
|
|
324
315
|
let wipSerializedUsedRoutes: string | undefined;
|
|
325
316
|
// If GC is disabled, don't set wip used routes.
|
|
326
317
|
if (!this.gcDisabled) {
|
|
327
318
|
wipSerializedUsedRoutes = this.wipSerializedUsedRoutes;
|
|
328
319
|
}
|
|
329
320
|
|
|
330
|
-
super.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion
|
|
321
|
+
super.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion);
|
|
331
322
|
|
|
332
323
|
// If GC is disabled, skip setting pending summary with GC state.
|
|
333
324
|
if (!this.gcDisabled) {
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
7
|
-
import { ContainerWarning } from "@fluidframework/container-definitions/internal";
|
|
6
|
+
import { IDeltaManager, ContainerWarning } from "@fluidframework/container-definitions/internal";
|
|
8
7
|
import { IEvent, IEventProvider, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
9
8
|
import {
|
|
10
9
|
IDocumentMessage,
|
|
@@ -12,8 +11,10 @@ import {
|
|
|
12
11
|
ISummaryTree,
|
|
13
12
|
} from "@fluidframework/protocol-definitions";
|
|
14
13
|
import { ISummaryStats } from "@fluidframework/runtime-definitions";
|
|
15
|
-
import {
|
|
16
|
-
|
|
14
|
+
import {
|
|
15
|
+
ITelemetryLoggerExt,
|
|
16
|
+
ITelemetryLoggerPropertyBag,
|
|
17
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
17
18
|
|
|
18
19
|
import { ISummaryConfigurationHeuristics } from "../containerRuntime.js";
|
|
19
20
|
|
|
@@ -189,7 +190,7 @@ export interface IGeneratedSummaryStats extends ISummaryStats {
|
|
|
189
190
|
export interface IBaseSummarizeResult {
|
|
190
191
|
readonly stage: "base";
|
|
191
192
|
/** Error object related to failed summarize attempt. */
|
|
192
|
-
readonly error:
|
|
193
|
+
readonly error: Error | undefined;
|
|
193
194
|
/** Reference sequence number as of the generate summary attempt. */
|
|
194
195
|
readonly referenceSequenceNumber: number;
|
|
195
196
|
readonly minimumSequenceNumber: number;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
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
10
|
import {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
ISummaryNack,
|
|
16
16
|
MessageType,
|
|
17
17
|
} from "@fluidframework/protocol-definitions";
|
|
18
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
18
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Interface for summary op messages with typed contents.
|
|
@@ -21,8 +21,17 @@ import { IGCMetadata } from "../gc/index.js";
|
|
|
21
21
|
|
|
22
22
|
import { IDocumentSchema } from "./documentSchema.js";
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
interface
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
26
|
+
* @alpha
|
|
27
|
+
*/
|
|
28
|
+
export type OmitAttributesVersions<T> = Omit<T, "snapshotFormatVersion" | "summaryFormatVersion">;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
32
|
+
* @alpha
|
|
33
|
+
*/
|
|
34
|
+
export interface IFluidDataStoreAttributes0 {
|
|
26
35
|
readonly snapshotFormatVersion?: undefined;
|
|
27
36
|
readonly summaryFormatVersion?: undefined;
|
|
28
37
|
pkg: string;
|
|
@@ -33,11 +42,23 @@ interface IFluidDataStoreAttributes0 {
|
|
|
33
42
|
*/
|
|
34
43
|
readonly isRootDataStore?: boolean;
|
|
35
44
|
}
|
|
36
|
-
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
48
|
+
* @alpha
|
|
49
|
+
*/
|
|
50
|
+
export interface IFluidDataStoreAttributes1
|
|
51
|
+
extends OmitAttributesVersions<IFluidDataStoreAttributes0> {
|
|
37
52
|
readonly snapshotFormatVersion: "0.1";
|
|
38
53
|
readonly summaryFormatVersion?: undefined;
|
|
39
54
|
}
|
|
40
|
-
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
58
|
+
* @alpha
|
|
59
|
+
*/
|
|
60
|
+
export interface IFluidDataStoreAttributes2
|
|
61
|
+
extends OmitAttributesVersions<IFluidDataStoreAttributes1> {
|
|
41
62
|
/** Switch from snapshotFormatVersion to summaryFormatVersion */
|
|
42
63
|
readonly snapshotFormatVersion?: undefined;
|
|
43
64
|
readonly summaryFormatVersion: 2;
|
|
@@ -53,6 +74,11 @@ interface IFluidDataStoreAttributes2 extends OmitAttributesVersions<IFluidDataSt
|
|
|
53
74
|
* Added IFluidDataStoreAttributes similar to IChannelAttributes which will tell the attributes of a
|
|
54
75
|
* store like the package, snapshotFormatVersion to take different decisions based on a particular
|
|
55
76
|
* snapshotFormatVersion.
|
|
77
|
+
*
|
|
78
|
+
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
79
|
+
*
|
|
80
|
+
* @alpha
|
|
81
|
+
*
|
|
56
82
|
*/
|
|
57
83
|
export type ReadFluidDataStoreAttributes =
|
|
58
84
|
| IFluidDataStoreAttributes0
|
|
@@ -11,11 +11,16 @@ import {
|
|
|
11
11
|
IPromiseTimerResult,
|
|
12
12
|
Timer,
|
|
13
13
|
} from "@fluidframework/core-utils/internal";
|
|
14
|
-
import { DriverErrorTypes } from "@fluidframework/driver-definitions";
|
|
14
|
+
import { DriverErrorTypes } from "@fluidframework/driver-definitions/internal";
|
|
15
15
|
import { getRetryDelaySecondsFromError } from "@fluidframework/driver-utils/internal";
|
|
16
16
|
import { MessageType } from "@fluidframework/protocol-definitions";
|
|
17
|
-
import {
|
|
18
|
-
|
|
17
|
+
import {
|
|
18
|
+
isFluidError,
|
|
19
|
+
ITelemetryLoggerExt,
|
|
20
|
+
LoggingError,
|
|
21
|
+
PerformanceEvent,
|
|
22
|
+
wrapError,
|
|
23
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
19
24
|
|
|
20
25
|
import {
|
|
21
26
|
IAckSummaryResult,
|
|
@@ -269,7 +274,7 @@ export class SummaryGenerator {
|
|
|
269
274
|
*/
|
|
270
275
|
const fail = (
|
|
271
276
|
errorCode: keyof typeof summarizeErrors,
|
|
272
|
-
error?:
|
|
277
|
+
error?: Error,
|
|
273
278
|
properties?: SummaryGeneratorTelemetry,
|
|
274
279
|
submitFailureResult?: SubmitSummaryFailureData,
|
|
275
280
|
nackSummaryResult?: INackSummaryResult,
|
|
@@ -278,7 +283,8 @@ export class SummaryGenerator {
|
|
|
278
283
|
// If failure happened on upload, we may not yet realized that socket disconnected, so check
|
|
279
284
|
// offlineError too.
|
|
280
285
|
const category =
|
|
281
|
-
cancellationToken.cancelled ||
|
|
286
|
+
cancellationToken.cancelled ||
|
|
287
|
+
(isFluidError(error) && error?.errorType === DriverErrorTypes.offlineError)
|
|
282
288
|
? "generic"
|
|
283
289
|
: "error";
|
|
284
290
|
|
|
@@ -360,10 +366,15 @@ export class SummaryGenerator {
|
|
|
360
366
|
summarizeEvent.reportEvent("generate", { ...summarizeTelemetryProps });
|
|
361
367
|
resultsBuilder.summarySubmitted.resolve({ success: true, data: summaryData });
|
|
362
368
|
} catch (error) {
|
|
363
|
-
return fail(
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
369
|
+
return fail(
|
|
370
|
+
"submitSummaryFailure",
|
|
371
|
+
wrapError(error, (message) => new LoggingError(message)),
|
|
372
|
+
undefined /* properties */,
|
|
373
|
+
{
|
|
374
|
+
stage: "unknown",
|
|
375
|
+
retryAfterSeconds: getRetryDelaySecondsFromError(error),
|
|
376
|
+
},
|
|
377
|
+
);
|
|
367
378
|
} finally {
|
|
368
379
|
if (summaryData === undefined) {
|
|
369
380
|
this.heuristicData.recordAttempt();
|
|
@@ -11,9 +11,12 @@ import {
|
|
|
11
11
|
ITelemetryBaseLogger,
|
|
12
12
|
} from "@fluidframework/core-interfaces";
|
|
13
13
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
14
|
-
import { DriverErrorTypes } from "@fluidframework/driver-definitions";
|
|
15
|
-
import {
|
|
16
|
-
|
|
14
|
+
import { DriverErrorTypes } from "@fluidframework/driver-definitions/internal";
|
|
15
|
+
import {
|
|
16
|
+
ITelemetryLoggerExt,
|
|
17
|
+
PerformanceEvent,
|
|
18
|
+
createChildLogger,
|
|
19
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
17
20
|
|
|
18
21
|
import { IThrottler } from "../throttler.js";
|
|
19
22
|
|