@fluidframework/container-runtime 2.0.0-dev-rc.5.0.0.272251 → 2.0.0-dev-rc.5.0.0.272889
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-extractor.json +1 -1
- package/container-runtime.test-files.tar +0 -0
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +1 -3
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +4 -5
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +2 -1
- 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.map +1 -1
- package/dist/deltaManagerProxies.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +1 -3
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +2 -2
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.js +1 -1
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js.map +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.map +1 -1
- package/dist/gc/gcTelemetry.js +1 -2
- 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/messageTypes.d.ts +5 -21
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +1 -1
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +1 -2
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +1 -1
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +1 -1
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +1 -2
- 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.map +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +1 -2
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- 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.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +4 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js.map +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.map +1 -1
- package/dist/summary/summaryGenerator.js +1 -2
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +1 -2
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +3 -1
- package/dist/throttler.js.map +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +1 -1
- package/lib/batchTracker.js.map +1 -1
- 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.map +1 -1
- package/lib/channelCollection.js +1 -3
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +6 -7
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +2 -1
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +1 -1
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/deltaManagerProxies.d.ts.map +1 -1
- package/lib/deltaManagerProxies.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +1 -3
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +3 -3
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.js +1 -1
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js.map +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.map +1 -1
- package/lib/gc/gcTelemetry.js +1 -2
- 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/messageTypes.d.ts +5 -21
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +1 -1
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +1 -1
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +1 -2
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +1 -1
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +1 -2
- 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 +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +1 -2
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- 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.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +4 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +1 -2
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +1 -2
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +3 -1
- package/lib/throttler.js.map +1 -1
- package/package.json +23 -19
- package/src/batchTracker.ts +4 -1
- package/src/blobManager.ts +14 -16
- package/src/channelCollection.ts +17 -20
- package/src/connectionTelemetry.ts +3 -8
- package/src/containerRuntime.ts +41 -40
- package/src/dataStoreContext.ts +31 -9
- package/src/dataStoreContexts.ts +7 -2
- package/src/deltaManagerProxies.ts +12 -3
- package/src/deltaScheduler.ts +1 -3
- package/src/gc/garbageCollection.ts +23 -24
- package/src/gc/gcConfigs.ts +7 -3
- package/src/gc/gcHelpers.ts +6 -2
- package/src/gc/gcSummaryStateTracker.ts +4 -1
- package/src/gc/gcTelemetry.ts +1 -2
- package/src/index.ts +0 -1
- package/src/messageTypes.ts +7 -23
- package/src/opLifecycle/index.ts +5 -1
- package/src/opLifecycle/opDecompressor.ts +2 -6
- package/src/opLifecycle/opGroupingManager.ts +1 -4
- package/src/opLifecycle/opSplitter.ts +9 -3
- package/src/opLifecycle/outbox.ts +1 -4
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +4 -2
- package/src/summary/documentSchema.ts +4 -7
- package/src/summary/index.ts +4 -1
- package/src/summary/orderedClientElection.ts +17 -10
- package/src/summary/runningSummarizer.ts +20 -9
- package/src/summary/summarizerClientElection.ts +2 -1
- package/src/summary/summarizerNode/summarizerNode.ts +6 -4
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +7 -2
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +10 -6
- package/src/summary/summarizerTypes.ts +9 -2
- package/src/summary/summaryCollection.ts +4 -1
- package/src/summary/summaryFormat.ts +8 -3
- package/src/summary/summaryGenerator.ts +4 -9
- package/src/summary/summaryManager.ts +6 -9
- package/src/throttler.ts +3 -1
package/src/gc/gcHelpers.ts
CHANGED
|
@@ -78,8 +78,12 @@ export function shouldAllowGcSweep(
|
|
|
78
78
|
/**
|
|
79
79
|
* Sorts the given GC state as per the id of the GC nodes. It also sorts the outbound routes array of each node.
|
|
80
80
|
*/
|
|
81
|
-
export function generateSortedGCState(
|
|
82
|
-
|
|
81
|
+
export function generateSortedGCState(
|
|
82
|
+
gcState: IGarbageCollectionState,
|
|
83
|
+
): IGarbageCollectionState {
|
|
84
|
+
const sortableArray: [string, IGarbageCollectionNodeData][] = Object.entries(
|
|
85
|
+
gcState.gcNodes,
|
|
86
|
+
);
|
|
83
87
|
sortableArray.sort(([a], [b]) => a.localeCompare(b));
|
|
84
88
|
const sortedGCState: IGarbageCollectionState = { gcNodes: {} };
|
|
85
89
|
for (const [nodeId, nodeData] of sortableArray) {
|
|
@@ -18,7 +18,10 @@ import { IRefreshSummaryResult } from "../summary/index.js";
|
|
|
18
18
|
|
|
19
19
|
import { IGCStats, IGarbageCollectorConfigs } from "./gcDefinitions.js";
|
|
20
20
|
import { generateSortedGCState } from "./gcHelpers.js";
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
IGarbageCollectionSnapshotData,
|
|
23
|
+
IGarbageCollectionState,
|
|
24
|
+
} from "./gcSummaryDefinitions.js";
|
|
22
25
|
|
|
23
26
|
export const gcStateBlobKey = `${gcBlobPrefix}_root`;
|
|
24
27
|
|
package/src/gc/gcTelemetry.ts
CHANGED
|
@@ -384,8 +384,7 @@ export class GCTelemetryTracker {
|
|
|
384
384
|
*/
|
|
385
385
|
const nodeStateTracker = this.getNodeStateTracker(detailedProps.trackedId); // Note: This is never SubDataStore path
|
|
386
386
|
const active =
|
|
387
|
-
nodeStateTracker === undefined ||
|
|
388
|
-
nodeStateTracker.state === UnreferencedState.Active;
|
|
387
|
+
nodeStateTracker === undefined || nodeStateTracker.state === UnreferencedState.Active;
|
|
389
388
|
if ((usageType === "Revived") === active) {
|
|
390
389
|
const pkg = await this.getNodePackagePath(eventProps.id.value);
|
|
391
390
|
const fromPkg = eventProps.fromId
|
package/src/index.ts
CHANGED
package/src/messageTypes.ts
CHANGED
|
@@ -60,6 +60,7 @@ export enum ContainerMessageType {
|
|
|
60
60
|
/**
|
|
61
61
|
* How should an older client handle an unrecognized remote op type?
|
|
62
62
|
*
|
|
63
|
+
* @deprecated The utility of a mechanism to handle unknown messages is outweighed by the nuance required to get it right.
|
|
63
64
|
* @internal
|
|
64
65
|
*/
|
|
65
66
|
export type CompatModeBehavior =
|
|
@@ -71,6 +72,7 @@ export type CompatModeBehavior =
|
|
|
71
72
|
/**
|
|
72
73
|
* All the info an older client would need to know how to handle an unrecognized remote op type
|
|
73
74
|
*
|
|
75
|
+
* @deprecated The utility of a mechanism to handle unknown messages is outweighed by the nuance required to get it right.
|
|
74
76
|
* @internal
|
|
75
77
|
*/
|
|
76
78
|
export interface IContainerRuntimeMessageCompatDetails {
|
|
@@ -85,8 +87,7 @@ export interface IContainerRuntimeMessageCompatDetails {
|
|
|
85
87
|
* IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
|
|
86
88
|
* This way stringified values can be compared.
|
|
87
89
|
*/
|
|
88
|
-
interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents>
|
|
89
|
-
extends Partial<RecentlyAddedContainerRuntimeMessageDetails> {
|
|
90
|
+
interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents> {
|
|
90
91
|
/** Type of the op, within the ContainerRuntime's domain */
|
|
91
92
|
type: TType;
|
|
92
93
|
/** Domain-specific contents, interpreted according to the type */
|
|
@@ -95,6 +96,7 @@ interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TCont
|
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* Additional details expected for any recently added message.
|
|
99
|
+
* @deprecated The utility of a mechanism to handle unknown messages is outweighed by the nuance required to get it right.
|
|
98
100
|
* @internal
|
|
99
101
|
*/
|
|
100
102
|
export interface RecentlyAddedContainerRuntimeMessageDetails {
|
|
@@ -137,7 +139,9 @@ export type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<
|
|
|
137
139
|
export type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<
|
|
138
140
|
ContainerMessageType.GC,
|
|
139
141
|
GarbageCollectionMessage
|
|
140
|
-
|
|
142
|
+
> &
|
|
143
|
+
// While deprecating: GC messages may still contain compat details for now
|
|
144
|
+
Partial<RecentlyAddedContainerRuntimeMessageDetails>;
|
|
141
145
|
export type ContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<
|
|
142
146
|
ContainerMessageType.DocumentSchemaChange,
|
|
143
147
|
IDocumentSchemaChangeMessage
|
|
@@ -232,23 +236,3 @@ export type InboundSequencedContainerRuntimeMessageOrSystemMessage =
|
|
|
232
236
|
*/
|
|
233
237
|
export type InboundSequencedRecentlyAddedContainerRuntimeMessage = ISequencedDocumentMessage &
|
|
234
238
|
Partial<RecentlyAddedContainerRuntimeMessageDetails>;
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime
|
|
238
|
-
*
|
|
239
|
-
* IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
|
|
240
|
-
* This way stringified values can be compared.
|
|
241
|
-
*
|
|
242
|
-
* @deprecated this is an internal type which should not be used outside of the package.
|
|
243
|
-
* Internally, it is superseded by `TypedContainerRuntimeMessage`.
|
|
244
|
-
*
|
|
245
|
-
* @internal
|
|
246
|
-
*/
|
|
247
|
-
export interface ContainerRuntimeMessage {
|
|
248
|
-
/** Type of the op, within the ContainerRuntime's domain */
|
|
249
|
-
type: ContainerMessageType;
|
|
250
|
-
/** Domain-specific contents, interpreted according to the type */
|
|
251
|
-
contents: any;
|
|
252
|
-
/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */
|
|
253
|
-
compatDetails?: IContainerRuntimeMessageCompatDetails;
|
|
254
|
-
}
|
package/src/opLifecycle/index.ts
CHANGED
|
@@ -10,4 +10,8 @@ export { OpCompressor } from "./opCompressor.js";
|
|
|
10
10
|
export { OpDecompressor } from "./opDecompressor.js";
|
|
11
11
|
export { OpSplitter, splitOp, isChunkedMessage } from "./opSplitter.js";
|
|
12
12
|
export { RemoteMessageProcessor, unpackRuntimeMessage } from "./remoteMessageProcessor.js";
|
|
13
|
-
export {
|
|
13
|
+
export {
|
|
14
|
+
OpGroupingManager,
|
|
15
|
+
OpGroupingManagerConfig,
|
|
16
|
+
isGroupedBatch,
|
|
17
|
+
} from "./opGroupingManager.js";
|
|
@@ -65,8 +65,7 @@ export class OpDecompressor {
|
|
|
65
65
|
IsoBuffer.from(
|
|
66
66
|
(message.contents as IPackedContentsContents).packedContents,
|
|
67
67
|
"base64",
|
|
68
|
-
).toString("base64") ===
|
|
69
|
-
(message.contents as IPackedContentsContents).packedContents
|
|
68
|
+
).toString("base64") === (message.contents as IPackedContentsContents).packedContents
|
|
70
69
|
) {
|
|
71
70
|
this.logger.sendTelemetryEvent({
|
|
72
71
|
eventName: "LegacyCompression",
|
|
@@ -139,10 +138,7 @@ export class OpDecompressor {
|
|
|
139
138
|
|
|
140
139
|
if (batchMetadata === false || this.isSingleMessageBatch) {
|
|
141
140
|
// End of compressed batch
|
|
142
|
-
const returnMessage = newMessage(
|
|
143
|
-
message,
|
|
144
|
-
this.rootMessageContents[this.processedCount],
|
|
145
|
-
);
|
|
141
|
+
const returnMessage = newMessage(message, this.rootMessageContents[this.processedCount]);
|
|
146
142
|
|
|
147
143
|
this.activeBatch = false;
|
|
148
144
|
this.isSingleMessageBatch = false;
|
|
@@ -73,10 +73,7 @@ export class OpGroupingManager {
|
|
|
73
73
|
if (message.metadata) {
|
|
74
74
|
const keys = Object.keys(message.metadata);
|
|
75
75
|
assert(keys.length < 2, 0x5dd /* cannot group ops with metadata */);
|
|
76
|
-
assert(
|
|
77
|
-
keys.length === 0 || keys[0] === "batch",
|
|
78
|
-
0x5de /* unexpected op metadata */,
|
|
79
|
-
);
|
|
76
|
+
assert(keys.length === 0 || keys[0] === "batch", 0x5de /* unexpected op metadata */);
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
79
|
|
|
@@ -53,7 +53,9 @@ export class OpSplitter {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
public get isBatchChunkingEnabled(): boolean {
|
|
56
|
-
return
|
|
56
|
+
return (
|
|
57
|
+
this.chunkSizeInBytes < Number.POSITIVE_INFINITY && this.submitBatchFn !== undefined
|
|
58
|
+
);
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
public get chunks(): ReadonlyMap<string, string[]> {
|
|
@@ -272,7 +274,8 @@ export const splitOp = (
|
|
|
272
274
|
);
|
|
273
275
|
|
|
274
276
|
const contentLength = op.contents.length;
|
|
275
|
-
const chunkCount =
|
|
277
|
+
const chunkCount =
|
|
278
|
+
Math.floor((contentLength - 1) / chunkSizeInBytes) + 1 + (extraOp ? 1 : 0);
|
|
276
279
|
let offset = 0;
|
|
277
280
|
for (let chunkId = 1; chunkId <= chunkCount; chunkId++) {
|
|
278
281
|
const chunk: IChunkedOp = {
|
|
@@ -306,7 +309,10 @@ export const splitOp = (
|
|
|
306
309
|
);
|
|
307
310
|
}
|
|
308
311
|
|
|
309
|
-
assert(
|
|
312
|
+
assert(
|
|
313
|
+
offset >= contentLength,
|
|
314
|
+
0x58c /* Content offset equal or larger than content length */,
|
|
315
|
+
);
|
|
310
316
|
assert(chunks.length === chunkCount, 0x5a5 /* Expected number of chunks */);
|
|
311
317
|
return chunks;
|
|
312
318
|
};
|
|
@@ -382,10 +382,7 @@ export class Outbox {
|
|
|
382
382
|
|
|
383
383
|
this.params.legacySendBatchFn(batch);
|
|
384
384
|
} else {
|
|
385
|
-
assert(
|
|
386
|
-
batch.referenceSequenceNumber !== undefined,
|
|
387
|
-
0x58e /* Batch must not be empty */,
|
|
388
|
-
);
|
|
385
|
+
assert(batch.referenceSequenceNumber !== undefined, 0x58e /* Batch must not be empty */);
|
|
389
386
|
this.params.submitBatchFn(
|
|
390
387
|
batch.content.map((message) => ({
|
|
391
388
|
contents: message.contents,
|
package/src/packageVersion.ts
CHANGED
|
@@ -153,7 +153,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
153
153
|
message.sequenceNumber !== undefined,
|
|
154
154
|
0x97c /* saved op should already have a sequence number */,
|
|
155
155
|
);
|
|
156
|
-
return message.sequenceNumber
|
|
156
|
+
return message.sequenceNumber > (snapshotSequenceNumber ?? 0);
|
|
157
157
|
});
|
|
158
158
|
this.pendingMessages.toArray().forEach((message) => {
|
|
159
159
|
if (
|
|
@@ -252,7 +252,9 @@ export class PendingStateManager implements IDisposable {
|
|
|
252
252
|
* the batch information was preserved for batch messages.
|
|
253
253
|
* @param message - The message that got ack'd and needs to be processed.
|
|
254
254
|
*/
|
|
255
|
-
public processPendingLocalMessage(
|
|
255
|
+
public processPendingLocalMessage(
|
|
256
|
+
message: InboundSequencedContainerRuntimeMessage,
|
|
257
|
+
): unknown {
|
|
256
258
|
// Pre-processing part - This may be the start of a batch.
|
|
257
259
|
this.maybeProcessBatchBegin(message);
|
|
258
260
|
// Get the next message from the pending queue. Verify a message exists.
|
|
@@ -482,18 +482,16 @@ export class DocumentsSchemaController {
|
|
|
482
482
|
this.documentSchema = !existing
|
|
483
483
|
? this.desiredSchema
|
|
484
484
|
: (documentMetadataSchema as IDocumentSchemaCurrent) ??
|
|
485
|
-
|
|
485
|
+
({
|
|
486
486
|
version: currentDocumentVersionSchema,
|
|
487
487
|
// see comment in summarizeDocumentSchema() on why it has to stay zero
|
|
488
488
|
refSeq: 0,
|
|
489
489
|
// If it's existing document and it has no schema, then it was written by legacy client.
|
|
490
490
|
// If it's a new document, then we define it's legacy-related behaviors.
|
|
491
491
|
runtime: {
|
|
492
|
-
explicitSchemaControl: boolToProp(
|
|
493
|
-
!existing && features.explicitSchemaControl,
|
|
494
|
-
),
|
|
492
|
+
explicitSchemaControl: boolToProp(!existing && features.explicitSchemaControl),
|
|
495
493
|
},
|
|
496
|
-
|
|
494
|
+
} satisfies IDocumentSchemaCurrent);
|
|
497
495
|
|
|
498
496
|
checkRuntimeCompatibility(this.documentSchema, "document");
|
|
499
497
|
this.validateSeqNumber(this.documentSchema.refSeq, snapshotSequenceNumber, "summary");
|
|
@@ -563,8 +561,7 @@ export class DocumentsSchemaController {
|
|
|
563
561
|
if (this.sendOp && this.futureSchema !== undefined) {
|
|
564
562
|
this.sendOp = false;
|
|
565
563
|
assert(
|
|
566
|
-
this.explicitSchemaControl &&
|
|
567
|
-
this.futureSchema.runtime.explicitSchemaControl === true,
|
|
564
|
+
this.explicitSchemaControl && this.futureSchema.runtime.explicitSchemaControl === true,
|
|
568
565
|
0x94e /* not legacy */,
|
|
569
566
|
);
|
|
570
567
|
return {
|
package/src/summary/index.ts
CHANGED
|
@@ -11,7 +11,10 @@ export {
|
|
|
11
11
|
OrderedClientCollection,
|
|
12
12
|
OrderedClientElection,
|
|
13
13
|
} from "./orderedClientElection.js";
|
|
14
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
defaultMaxAttemptsForSubmitFailures,
|
|
16
|
+
RunningSummarizer,
|
|
17
|
+
} from "./runningSummarizer.js";
|
|
15
18
|
export {
|
|
16
19
|
ICancellableSummarizerController,
|
|
17
20
|
neverCancelledSummaryToken,
|
|
@@ -24,12 +24,12 @@ export type ImmutablePrimitives = undefined | null | boolean | string | number |
|
|
|
24
24
|
export type Immutable<T> = T extends ImmutablePrimitives
|
|
25
25
|
? T
|
|
26
26
|
: T extends (infer A)[]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
? readonly Immutable<A>[]
|
|
28
|
+
: T extends Map<infer K, infer V>
|
|
29
|
+
? ReadonlyMap<Immutable<K>, Immutable<V>>
|
|
30
|
+
: T extends Set<infer V>
|
|
31
|
+
? ReadonlySet<Immutable<V>>
|
|
32
|
+
: { readonly [K in keyof T]: Immutable<T[K]> };
|
|
33
33
|
|
|
34
34
|
/** Minimum information for a client tracked for election consideration. */
|
|
35
35
|
export interface ITrackedClient {
|
|
@@ -68,7 +68,8 @@ export interface IOrderedClientCollectionEvents extends IEvent {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/** Contract for a sorted collection of all clients in the quorum. */
|
|
71
|
-
export interface IOrderedClientCollection
|
|
71
|
+
export interface IOrderedClientCollection
|
|
72
|
+
extends IEventProvider<IOrderedClientCollectionEvents> {
|
|
72
73
|
/** Count of clients in the collection. */
|
|
73
74
|
readonly count: number;
|
|
74
75
|
/** Pointer to the oldest client in the collection. */
|
|
@@ -375,7 +376,9 @@ export class OrderedClientElection
|
|
|
375
376
|
}
|
|
376
377
|
}
|
|
377
378
|
orderedClientCollection.on("addClient", (client, seq) => this.addClient(client, seq));
|
|
378
|
-
orderedClientCollection.on("removeClient", (client, seq) =>
|
|
379
|
+
orderedClientCollection.on("removeClient", (client, seq) =>
|
|
380
|
+
this.removeClient(client, seq),
|
|
381
|
+
);
|
|
379
382
|
|
|
380
383
|
if (typeof initialState === "number") {
|
|
381
384
|
this._electionSequenceNumber = initialState;
|
|
@@ -487,7 +490,9 @@ export class OrderedClientElection
|
|
|
487
490
|
* @param client - client to start checking
|
|
488
491
|
* @returns oldest eligible client starting with passed in client or undefined if none.
|
|
489
492
|
*/
|
|
490
|
-
private findFirstEligibleParent(
|
|
493
|
+
private findFirstEligibleParent(
|
|
494
|
+
client: ILinkedClient | undefined,
|
|
495
|
+
): ILinkedClient | undefined {
|
|
491
496
|
let candidateClient = client;
|
|
492
497
|
while (
|
|
493
498
|
candidateClient !== undefined &&
|
|
@@ -597,7 +602,9 @@ export class OrderedClientElection
|
|
|
597
602
|
* and no client has been elected.
|
|
598
603
|
*/
|
|
599
604
|
public resetElectedClient(sequenceNumber: number): void {
|
|
600
|
-
const firstClient = this.findFirstEligibleParent(
|
|
605
|
+
const firstClient = this.findFirstEligibleParent(
|
|
606
|
+
this.orderedClientCollection.oldestClient,
|
|
607
|
+
);
|
|
601
608
|
if (this._electedClient === undefined || this._electedClient === this._electedParent) {
|
|
602
609
|
this.tryElectingClient(firstClient, sequenceNumber, "ResetElectedClient");
|
|
603
610
|
} else {
|
|
@@ -43,7 +43,11 @@ import {
|
|
|
43
43
|
SummarizerStopReason,
|
|
44
44
|
type IRetriableFailureError,
|
|
45
45
|
} from "./summarizerTypes.js";
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
IAckedSummary,
|
|
48
|
+
IClientSummaryWatcher,
|
|
49
|
+
SummaryCollection,
|
|
50
|
+
} from "./summaryCollection.js";
|
|
47
51
|
import {
|
|
48
52
|
RetriableSummaryError,
|
|
49
53
|
SummarizeReason,
|
|
@@ -72,7 +76,10 @@ export const defaultMaxAttemptsForSubmitFailures = 5;
|
|
|
72
76
|
* track of summaries that it is generating as they are broadcast and acked/nacked.
|
|
73
77
|
* This object is created and controlled by Summarizer object.
|
|
74
78
|
*/
|
|
75
|
-
export class RunningSummarizer
|
|
79
|
+
export class RunningSummarizer
|
|
80
|
+
extends TypedEventEmitter<ISummarizerEvents>
|
|
81
|
+
implements IDisposable
|
|
82
|
+
{
|
|
76
83
|
public static async start(
|
|
77
84
|
logger: ITelemetryBaseLogger,
|
|
78
85
|
summaryWatcher: IClientSummaryWatcher,
|
|
@@ -234,7 +241,10 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
234
241
|
// Cap the maximum amount of time client will wait for a summarize op ack to maxSummarizeAckWaitTime
|
|
235
242
|
// configuration.maxAckWaitTime is composed from defaults, server values, and runtime overrides
|
|
236
243
|
|
|
237
|
-
const maxAckWaitTime = Math.min(
|
|
244
|
+
const maxAckWaitTime = Math.min(
|
|
245
|
+
this.configuration.maxAckWaitTime,
|
|
246
|
+
maxSummarizeAckWaitTime,
|
|
247
|
+
);
|
|
238
248
|
|
|
239
249
|
this.pendingAckTimer = new PromiseTimer(maxAckWaitTime, () => {
|
|
240
250
|
// Note: summarizeCount (from ChildLogger definition) may be 0,
|
|
@@ -262,8 +272,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
262
272
|
});
|
|
263
273
|
|
|
264
274
|
const immediatelyRefreshLatestSummaryAck =
|
|
265
|
-
this.mc.config.getBoolean("Fluid.Summarizer.immediatelyRefreshLatestSummaryAck") ??
|
|
266
|
-
true;
|
|
275
|
+
this.mc.config.getBoolean("Fluid.Summarizer.immediatelyRefreshLatestSummaryAck") ?? true;
|
|
267
276
|
this.generator = new SummaryGenerator(
|
|
268
277
|
this.pendingAckTimer,
|
|
269
278
|
this.heuristicData,
|
|
@@ -442,7 +451,10 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
442
451
|
* @param op - op to check
|
|
443
452
|
* @returns true if this op can trigger a summary
|
|
444
453
|
*/
|
|
445
|
-
private opCanTriggerSummary(
|
|
454
|
+
private opCanTriggerSummary(
|
|
455
|
+
op: ISequencedDocumentMessage,
|
|
456
|
+
runtimeMessage: boolean,
|
|
457
|
+
): boolean {
|
|
446
458
|
switch (op.type) {
|
|
447
459
|
case MessageType.Summarize:
|
|
448
460
|
case MessageType.SummaryAck:
|
|
@@ -587,8 +599,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
587
599
|
...options,
|
|
588
600
|
summaryLogger,
|
|
589
601
|
cancellationToken: this.cancellationToken,
|
|
590
|
-
latestSummaryRefSeqNum:
|
|
591
|
-
this.heuristicData.lastSuccessfulSummary.refSequenceNumber,
|
|
602
|
+
latestSummaryRefSeqNum: this.heuristicData.lastSuccessfulSummary.refSequenceNumber,
|
|
592
603
|
};
|
|
593
604
|
const summarizeResult = this.generator.summarize(summaryOptions, resultsBuilder);
|
|
594
605
|
// ensure we wait till the end of the process
|
|
@@ -882,7 +893,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
882
893
|
...results,
|
|
883
894
|
alreadyEnqueued: true,
|
|
884
895
|
overridden: true,
|
|
885
|
-
|
|
896
|
+
}
|
|
886
897
|
: results;
|
|
887
898
|
}
|
|
888
899
|
|
|
@@ -22,7 +22,8 @@ export interface ISummarizerClientElectionEvents extends IEvent {
|
|
|
22
22
|
(event: "electedSummarizerChanged", handler: () => void): void;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export interface ISummarizerClientElection
|
|
25
|
+
export interface ISummarizerClientElection
|
|
26
|
+
extends IEventProvider<ISummarizerClientElectionEvents> {
|
|
26
27
|
readonly electedClientId: string | undefined;
|
|
27
28
|
readonly electedParentId: string | undefined;
|
|
28
29
|
}
|
|
@@ -197,11 +197,10 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
197
197
|
this._latestSummary !== undefined
|
|
198
198
|
? {
|
|
199
199
|
summarySequenceNumber: this.wipReferenceSequenceNumber,
|
|
200
|
-
latestSummarySequenceNumber:
|
|
201
|
-
this._latestSummary.referenceSequenceNumber,
|
|
200
|
+
latestSummarySequenceNumber: this._latestSummary.referenceSequenceNumber,
|
|
202
201
|
// TODO: remove summaryPath
|
|
203
202
|
summaryPath: this._latestSummary.fullPath.path,
|
|
204
|
-
|
|
203
|
+
}
|
|
205
204
|
: undefined;
|
|
206
205
|
}
|
|
207
206
|
|
|
@@ -323,7 +322,10 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
323
322
|
parentPath: EscapedPath | undefined,
|
|
324
323
|
parentSkipRecursion: boolean,
|
|
325
324
|
) {
|
|
326
|
-
assert(
|
|
325
|
+
assert(
|
|
326
|
+
this.wipReferenceSequenceNumber !== undefined,
|
|
327
|
+
0x1a4 /* "Not tracking a summary" */,
|
|
328
|
+
);
|
|
327
329
|
let localPathsToUse = this.wipLocalPaths;
|
|
328
330
|
|
|
329
331
|
if (parentSkipRecursion) {
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import { SummaryObject } from "@fluidframework/driver-definitions";
|
|
7
7
|
import { ISnapshotTree } from "@fluidframework/driver-definitions/internal";
|
|
8
8
|
import { channelsTreeName } from "@fluidframework/runtime-definitions/internal";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
ITelemetryLoggerExt,
|
|
11
|
+
TelemetryDataTag,
|
|
12
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
10
13
|
|
|
11
14
|
export interface IRefreshSummaryResult {
|
|
12
15
|
/** Tells whether this summary is tracked by this client. */
|
|
@@ -173,7 +176,9 @@ export interface ISubtreeInfo<T extends ISnapshotTree | SummaryObject> {
|
|
|
173
176
|
* would be located if exists.
|
|
174
177
|
* @param baseSummary - summary to check
|
|
175
178
|
*/
|
|
176
|
-
export function parseSummaryForSubtrees(
|
|
179
|
+
export function parseSummaryForSubtrees(
|
|
180
|
+
baseSummary: ISnapshotTree,
|
|
181
|
+
): ISubtreeInfo<ISnapshotTree> {
|
|
177
182
|
// New versions of snapshots have child nodes isolated in .channels subtree
|
|
178
183
|
const channelsSubtree = baseSummary.trees[channelsTreeName];
|
|
179
184
|
if (channelsSubtree !== undefined) {
|
|
@@ -82,7 +82,9 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
82
82
|
private baseGCDetailsLoaded: boolean = false;
|
|
83
83
|
|
|
84
84
|
// The base GC details for the child nodes. This is passed to child nodes when creating them.
|
|
85
|
-
private readonly childNodesBaseGCDetailsP: Promise<
|
|
85
|
+
private readonly childNodesBaseGCDetailsP: Promise<
|
|
86
|
+
Map<string, IGarbageCollectionDetailsBase>
|
|
87
|
+
>;
|
|
86
88
|
|
|
87
89
|
private gcData: IGarbageCollectionData | undefined;
|
|
88
90
|
|
|
@@ -224,7 +226,12 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
224
226
|
// GC data may not be available if loaded from a snapshot with either GC disabled or before GC was added.
|
|
225
227
|
// Note - canReuseHandle is checked to be consistent with summarize - generate GC data for nodes for which
|
|
226
228
|
// summary must be generated.
|
|
227
|
-
if (
|
|
229
|
+
if (
|
|
230
|
+
this.canReuseHandle &&
|
|
231
|
+
!fullGC &&
|
|
232
|
+
!this.hasDataChanged() &&
|
|
233
|
+
this.gcData !== undefined
|
|
234
|
+
) {
|
|
228
235
|
return cloneGCData(this.gcData);
|
|
229
236
|
}
|
|
230
237
|
|
|
@@ -320,10 +327,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
320
327
|
if (!this.gcDisabled) {
|
|
321
328
|
const summaryNode = this.pendingSummaries.get(proposalHandle);
|
|
322
329
|
if (summaryNode !== undefined) {
|
|
323
|
-
const summaryNodeWithGC = new SummaryNodeWithGC(
|
|
324
|
-
wipSerializedUsedRoutes,
|
|
325
|
-
summaryNode,
|
|
326
|
-
);
|
|
330
|
+
const summaryNodeWithGC = new SummaryNodeWithGC(wipSerializedUsedRoutes, summaryNode);
|
|
327
331
|
this.pendingSummaries.set(proposalHandle, summaryNodeWithGC);
|
|
328
332
|
}
|
|
329
333
|
}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
IDeltaManager,
|
|
8
|
+
ContainerWarning,
|
|
9
|
+
} from "@fluidframework/container-definitions/internal";
|
|
7
10
|
import {
|
|
8
11
|
IEvent,
|
|
9
12
|
IEventProvider,
|
|
@@ -23,7 +26,11 @@ import {
|
|
|
23
26
|
|
|
24
27
|
import { ISummaryConfigurationHeuristics } from "../containerRuntime.js";
|
|
25
28
|
|
|
26
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
ISummaryAckMessage,
|
|
31
|
+
ISummaryNackMessage,
|
|
32
|
+
ISummaryOpMessage,
|
|
33
|
+
} from "./summaryCollection.js";
|
|
27
34
|
import { SummarizeReason } from "./summaryGenerator.js";
|
|
28
35
|
|
|
29
36
|
/**
|
|
@@ -298,7 +298,10 @@ export class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEve
|
|
|
298
298
|
this.summaryWatchers.delete(clientId);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
public setPendingAckTimerTimeoutCallback(
|
|
301
|
+
public setPendingAckTimerTimeoutCallback(
|
|
302
|
+
maxAckWaitTime: number,
|
|
303
|
+
timeoutCallback: () => void,
|
|
304
|
+
) {
|
|
302
305
|
this.maxAckWaitTime = maxAckWaitTime;
|
|
303
306
|
this.pendingAckTimerTimeoutCallback = timeoutCallback;
|
|
304
307
|
}
|
|
@@ -28,7 +28,10 @@ import { IDocumentSchema } from "./documentSchema.js";
|
|
|
28
28
|
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
29
29
|
* @alpha
|
|
30
30
|
*/
|
|
31
|
-
export type OmitAttributesVersions<T> = Omit<
|
|
31
|
+
export type OmitAttributesVersions<T> = Omit<
|
|
32
|
+
T,
|
|
33
|
+
"snapshotFormatVersion" | "summaryFormatVersion"
|
|
34
|
+
>;
|
|
32
35
|
|
|
33
36
|
/**
|
|
34
37
|
* @deprecated - This interface will no longer be exported in the future(AB#8004).
|
|
@@ -87,7 +90,9 @@ export type ReadFluidDataStoreAttributes =
|
|
|
87
90
|
| IFluidDataStoreAttributes0
|
|
88
91
|
| IFluidDataStoreAttributes1
|
|
89
92
|
| IFluidDataStoreAttributes2;
|
|
90
|
-
export type WriteFluidDataStoreAttributes =
|
|
93
|
+
export type WriteFluidDataStoreAttributes =
|
|
94
|
+
| IFluidDataStoreAttributes1
|
|
95
|
+
| IFluidDataStoreAttributes2;
|
|
91
96
|
|
|
92
97
|
export function getAttributesFormatVersion(attributes: ReadFluidDataStoreAttributes): number {
|
|
93
98
|
if (attributes.summaryFormatVersion) {
|
|
@@ -175,7 +180,7 @@ export const extractSummaryMetadataMessage = (
|
|
|
175
180
|
sequenceNumber: message.sequenceNumber,
|
|
176
181
|
timestamp: message.timestamp,
|
|
177
182
|
type: message.type,
|
|
178
|
-
|
|
183
|
+
};
|
|
179
184
|
|
|
180
185
|
export function getMetadataFormatVersion(metadata?: IContainerRuntimeMetadata): number {
|
|
181
186
|
/**
|
|
@@ -318,8 +318,7 @@ export class SummaryGenerator {
|
|
|
318
318
|
minimumSequenceNumber: summaryData.minimumSequenceNumber,
|
|
319
319
|
opsSinceLastAttempt: referenceSequenceNumber - lastAttemptRefSeqNum,
|
|
320
320
|
opsSinceLastSummary:
|
|
321
|
-
referenceSequenceNumber -
|
|
322
|
-
this.heuristicData.lastSuccessfulSummary.refSequenceNumber,
|
|
321
|
+
referenceSequenceNumber - this.heuristicData.lastSuccessfulSummary.refSequenceNumber,
|
|
323
322
|
stage: summaryData.stage,
|
|
324
323
|
};
|
|
325
324
|
summarizeTelemetryProps = this.addSummaryDataToTelemetryProps(
|
|
@@ -489,13 +488,9 @@ export class SummaryGenerator {
|
|
|
489
488
|
const errorCode: SummarizeErrorCode = "summaryNack";
|
|
490
489
|
|
|
491
490
|
// pre-0.58 error message prefix: summaryNack
|
|
492
|
-
const error = new RetriableSummaryError(
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
{
|
|
496
|
-
errorMessage,
|
|
497
|
-
},
|
|
498
|
-
);
|
|
491
|
+
const error = new RetriableSummaryError(getFailMessage(errorCode), retryAfterSeconds, {
|
|
492
|
+
errorMessage,
|
|
493
|
+
});
|
|
499
494
|
|
|
500
495
|
assert(
|
|
501
496
|
getRetryDelaySecondsFromError(error) === retryAfterSeconds,
|
|
@@ -89,7 +89,10 @@ export interface ISummaryManagerConfig {
|
|
|
89
89
|
* It observes changes in calculated summarizer and reacts to changes by either creating summarizer client or
|
|
90
90
|
* stopping existing summarizer client.
|
|
91
91
|
*/
|
|
92
|
-
export class SummaryManager
|
|
92
|
+
export class SummaryManager
|
|
93
|
+
extends TypedEventEmitter<ISummarizerEvents>
|
|
94
|
+
implements IDisposable
|
|
95
|
+
{
|
|
93
96
|
private readonly logger: ITelemetryLoggerExt;
|
|
94
97
|
private readonly opsToBypassInitialDelay: number;
|
|
95
98
|
private readonly initialDelayMs: number;
|
|
@@ -263,10 +266,7 @@ export class SummaryManager extends TypedEventEmitter<ISummarizerEvents> impleme
|
|
|
263
266
|
// when the electedClient will be replaced with the new summarizer client.
|
|
264
267
|
// The alternative would be to let connectedState.clientId !== clientElection.electedClientId when
|
|
265
268
|
// state === Starting || state === Running.
|
|
266
|
-
assert(
|
|
267
|
-
this.state === SummaryManagerState.Starting,
|
|
268
|
-
0x263 /* "Expected: starting" */,
|
|
269
|
-
);
|
|
269
|
+
assert(this.state === SummaryManagerState.Starting, 0x263 /* "Expected: starting" */);
|
|
270
270
|
this.state = SummaryManagerState.Running;
|
|
271
271
|
|
|
272
272
|
const summarizer = await this.createSummarizerFn();
|
|
@@ -326,10 +326,7 @@ export class SummaryManager extends TypedEventEmitter<ISummarizerEvents> impleme
|
|
|
326
326
|
// means it also lost connection), and error happened on load (we do not have summarizer).
|
|
327
327
|
// We could annotate the error raised in Container.load where the container closed during load with no error
|
|
328
328
|
// and check for that case here, but that does not seem to be necessary.
|
|
329
|
-
if (
|
|
330
|
-
this.getShouldSummarizeState().shouldSummarize ||
|
|
331
|
-
this.summarizer !== undefined
|
|
332
|
-
) {
|
|
329
|
+
if (this.getShouldSummarizeState().shouldSummarize || this.summarizer !== undefined) {
|
|
333
330
|
// Report any failure as an error unless it was due to cancellation (like "disconnected" error)
|
|
334
331
|
// If failure happened on container load, we may not yet realized that socket disconnected, so check
|
|
335
332
|
// offlineError.
|