@fluidframework/container-runtime 2.0.0-dev-rc.3.0.0.254674 → 2.0.0-dev-rc.4.0.0.261659
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 +23 -0
- package/api-report/container-runtime.api.md +33 -19
- package/dist/batchTracker.d.ts +1 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/channelCollection.d.ts +5 -3
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +67 -15
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +1 -1
- 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 -27
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +174 -143
- 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.map +1 -1
- package/dist/dataStoreContext.js +1 -0
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +2 -0
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -0
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts +18 -6
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +38 -19
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.d.ts +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +5 -12
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +45 -29
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +27 -6
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +5 -4
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +14 -2
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +14 -4
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +24 -21
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/index.d.ts +2 -2
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +2 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{alpha.d.ts → legacy.d.ts} +3 -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 +0 -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/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +6 -6
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +2 -2
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js +1 -1
- package/dist/opLifecycle/opSplitter.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 +2 -34
- 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 +3 -2
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +17 -10
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/public.d.ts +3 -0
- package/dist/scheduleManager.d.ts +1 -1
- 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 +34 -16
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js.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 +2 -3
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +1 -1
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js.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 +3 -2
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js.map +1 -1
- package/{dist/beta.d.ts → internal.d.ts} +2 -0
- package/{lib/beta.d.ts → legacy.d.ts} +2 -0
- package/lib/batchTracker.d.ts +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/channelCollection.d.ts +5 -3
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +69 -17
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +1 -1
- 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 -27
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +174 -143
- 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.map +1 -1
- package/lib/dataStoreContext.js +1 -0
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +2 -0
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -0
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts +18 -6
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js +36 -18
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.d.ts +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +5 -12
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +47 -31
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +27 -6
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +5 -4
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +12 -1
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +14 -4
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +24 -21
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/index.d.ts +2 -2
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/{alpha.d.ts → legacy.d.ts} +3 -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 +0 -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/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +6 -6
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +2 -2
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +0 -4
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +2 -34
- 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 +3 -2
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +18 -11
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/public.d.ts +3 -0
- package/lib/scheduleManager.d.ts +1 -1
- 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 +34 -16
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +1 -1
- package/lib/summary/orderedClientElection.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 +2 -3
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +1 -1
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js.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 +4 -3
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +1 -1
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +33 -57
- package/src/batchTracker.ts +1 -2
- package/src/channelCollection.ts +87 -35
- package/src/connectionTelemetry.ts +58 -3
- package/src/containerRuntime.ts +214 -222
- package/src/dataStore.ts +5 -2
- package/src/dataStoreContext.ts +1 -0
- package/src/dataStoreContexts.ts +13 -2
- package/src/deltaManagerSummarizerProxy.ts +43 -21
- package/src/deltaScheduler.ts +1 -2
- package/src/gc/garbageCollection.ts +64 -42
- package/src/gc/gcDefinitions.ts +22 -10
- package/src/gc/gcHelpers.ts +14 -1
- package/src/gc/gcTelemetry.ts +57 -50
- package/src/gc/index.ts +2 -1
- package/src/index.ts +2 -0
- package/src/metadata.ts +2 -2
- package/src/opLifecycle/README.md +4 -4
- package/src/opLifecycle/batchManager.ts +0 -14
- package/src/opLifecycle/opDecompressor.ts +12 -6
- package/src/opLifecycle/opGroupingManager.ts +2 -2
- package/src/opLifecycle/opSplitter.ts +1 -1
- package/src/opLifecycle/outbox.ts +2 -49
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +28 -15
- package/src/scheduleManager.ts +1 -1
- package/src/summary/documentSchema.ts +52 -18
- package/src/summary/orderedClientElection.ts +5 -2
- 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 +5 -3
- package/src/summary/summaryCollection.ts +1 -1
- package/src/summary/summaryGenerator.ts +19 -8
- package/src/summary/summaryManager.ts +5 -2
|
@@ -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,16 +452,15 @@ 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,
|
|
459
|
-
|
|
463
|
+
0x949 /* not supported */,
|
|
460
464
|
);
|
|
461
465
|
|
|
462
466
|
// Desired schema by this session - almost all props are coming from arguments
|
|
@@ -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 =
|
|
@@ -505,22 +512,23 @@ export class DocumentsSchemaController {
|
|
|
505
512
|
assert(
|
|
506
513
|
boolToProp(this.explicitSchemaControl) ===
|
|
507
514
|
this.sessionSchema.runtime.explicitSchemaControl,
|
|
508
|
-
|
|
515
|
+
0x94a /* explicitSchemaControl */,
|
|
509
516
|
);
|
|
510
517
|
this.futureSchema = undefined;
|
|
511
518
|
} else {
|
|
512
519
|
this.sessionSchema = and(this.documentSchema, this.desiredSchema);
|
|
513
520
|
this.futureSchema = or(this.documentSchema, this.desiredSchema);
|
|
514
|
-
assert(this.sessionSchema.runtime.explicitSchemaControl === true,
|
|
515
|
-
assert(this.futureSchema.runtime.explicitSchemaControl === true,
|
|
521
|
+
assert(this.sessionSchema.runtime.explicitSchemaControl === true, 0x94b /* legacy */);
|
|
522
|
+
assert(this.futureSchema.runtime.explicitSchemaControl === true, 0x94c /* legacy */);
|
|
516
523
|
if (same(this.documentSchema, this.futureSchema)) {
|
|
517
524
|
this.futureSchema = undefined;
|
|
518
525
|
}
|
|
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 {
|
|
@@ -537,7 +545,10 @@ export class DocumentsSchemaController {
|
|
|
537
545
|
// race conditions. If we put any other number (including latest seq number), then we will have two clients
|
|
538
546
|
// (loading from two different summaries) with different numbers, and eventual consistency will be broken as schema
|
|
539
547
|
// change ops will be interpretted differently by those two clients.
|
|
540
|
-
assert(
|
|
548
|
+
assert(
|
|
549
|
+
this.explicitSchemaControl || schema.refSeq === 0,
|
|
550
|
+
0x94d /* refSeq should be zero */,
|
|
551
|
+
);
|
|
541
552
|
|
|
542
553
|
return schema;
|
|
543
554
|
}
|
|
@@ -545,21 +556,37 @@ export class DocumentsSchemaController {
|
|
|
545
556
|
/**
|
|
546
557
|
* Called by Container runtime whenever it is about to send some op.
|
|
547
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.
|
|
548
560
|
* @returns Optional message to send.
|
|
549
561
|
*/
|
|
550
562
|
public maybeSendSchemaMessage(): IDocumentSchemaChangeMessage | undefined {
|
|
551
563
|
if (this.sendOp && this.futureSchema !== undefined) {
|
|
564
|
+
this.sendOp = false;
|
|
552
565
|
assert(
|
|
553
566
|
this.explicitSchemaControl &&
|
|
554
567
|
this.futureSchema.runtime.explicitSchemaControl === true,
|
|
555
|
-
|
|
568
|
+
0x94e /* not legacy */,
|
|
556
569
|
);
|
|
557
570
|
return {
|
|
558
571
|
...this.futureSchema,
|
|
559
572
|
refSeq: this.documentSchema.refSeq,
|
|
560
573
|
};
|
|
561
574
|
}
|
|
562
|
-
|
|
575
|
+
}
|
|
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
|
+
}
|
|
563
590
|
}
|
|
564
591
|
|
|
565
592
|
/**
|
|
@@ -575,8 +602,14 @@ export class DocumentsSchemaController {
|
|
|
575
602
|
local: boolean,
|
|
576
603
|
sequenceNumber: number,
|
|
577
604
|
) {
|
|
578
|
-
|
|
579
|
-
|
|
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
|
|
608
|
+
assert(
|
|
609
|
+
this.documentSchema.refSeq < sequenceNumber,
|
|
610
|
+
0x950 /* time should move forward only! */,
|
|
611
|
+
);
|
|
612
|
+
|
|
580
613
|
if (content.refSeq !== this.documentSchema.refSeq) {
|
|
581
614
|
// CAS failed
|
|
582
615
|
return false;
|
|
@@ -586,15 +619,16 @@ export class DocumentsSchemaController {
|
|
|
586
619
|
// This will ensure we do not trip on our own messages that are no longer wanted as we processed someone else schema change message.
|
|
587
620
|
assert(
|
|
588
621
|
!local || (this.explicitSchemaControl && this.futureSchema !== undefined),
|
|
589
|
-
|
|
622
|
+
0x951 /* not sending ops */,
|
|
590
623
|
);
|
|
591
624
|
|
|
592
625
|
// Changes are in effect. Immediately check that this client understands these changes
|
|
593
|
-
checkRuntimeCompatibility(content);
|
|
626
|
+
checkRuntimeCompatibility(content, "change");
|
|
594
627
|
|
|
595
628
|
const schema: IDocumentSchema = { ...content, refSeq: sequenceNumber };
|
|
596
629
|
this.documentSchema = schema as IDocumentSchemaCurrent;
|
|
597
630
|
this.sessionSchema = and(this.documentSchema, this.desiredSchema);
|
|
631
|
+
assert(this.sessionSchema.refSeq === sequenceNumber, "seq#");
|
|
598
632
|
|
|
599
633
|
// legacy behavior is automatically off for the document once someone sends a schema op -
|
|
600
634
|
// from now on it's fully controlled by ops.
|
|
@@ -10,8 +10,11 @@ import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
|
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,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) {
|
|
@@ -12,8 +12,10 @@ import {
|
|
|
12
12
|
ISummaryTree,
|
|
13
13
|
} from "@fluidframework/protocol-definitions";
|
|
14
14
|
import { ISummaryStats } from "@fluidframework/runtime-definitions";
|
|
15
|
-
import {
|
|
16
|
-
|
|
15
|
+
import {
|
|
16
|
+
ITelemetryLoggerExt,
|
|
17
|
+
ITelemetryLoggerPropertyBag,
|
|
18
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
17
19
|
|
|
18
20
|
import { ISummaryConfigurationHeuristics } from "../containerRuntime.js";
|
|
19
21
|
|
|
@@ -189,7 +191,7 @@ export interface IGeneratedSummaryStats extends ISummaryStats {
|
|
|
189
191
|
export interface IBaseSummarizeResult {
|
|
190
192
|
readonly stage: "base";
|
|
191
193
|
/** Error object related to failed summarize attempt. */
|
|
192
|
-
readonly error:
|
|
194
|
+
readonly error: Error | undefined;
|
|
193
195
|
/** Reference sequence number as of the generate summary attempt. */
|
|
194
196
|
readonly referenceSequenceNumber: number;
|
|
195
197
|
readonly minimumSequenceNumber: number;
|
|
@@ -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.
|
|
@@ -14,8 +14,13 @@ import {
|
|
|
14
14
|
import { DriverErrorTypes } from "@fluidframework/driver-definitions";
|
|
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();
|
|
@@ -12,8 +12,11 @@ import {
|
|
|
12
12
|
} from "@fluidframework/core-interfaces";
|
|
13
13
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
14
14
|
import { DriverErrorTypes } from "@fluidframework/driver-definitions";
|
|
15
|
-
import {
|
|
16
|
-
|
|
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
|
|