@fluidframework/container-runtime 2.5.0-302463 → 2.5.0
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 +18 -0
- package/api-report/container-runtime.legacy.alpha.api.md +3 -1
- package/container-runtime.test-files.tar +0 -0
- package/dist/blobManager/blobManager.d.ts +3 -3
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +1 -1
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +20 -5
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +185 -129
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +14 -4
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +138 -55
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +15 -3
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +48 -19
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +6 -14
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +5 -6
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +23 -22
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +2 -2
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +3 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +9 -0
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +1 -0
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +2 -0
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +11 -0
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +43 -28
- package/dist/summary/documentSchema.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +3 -3
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +1 -1
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +20 -5
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +186 -130
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +14 -4
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +137 -54
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +15 -3
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +48 -19
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -15
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +5 -6
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +23 -22
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +2 -2
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +3 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +9 -0
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +1 -0
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +2 -0
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +11 -0
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +43 -28
- package/lib/summary/documentSchema.js.map +1 -1
- package/package.json +23 -19
- package/src/blobManager/blobManager.ts +2 -2
- package/src/channelCollection.ts +234 -176
- package/src/containerRuntime.ts +179 -68
- package/src/dataStoreContext.ts +66 -23
- package/src/dataStoreContexts.ts +7 -20
- package/src/gc/garbageCollection.ts +32 -32
- package/src/gc/gcDefinitions.ts +3 -3
- package/src/opLifecycle/outbox.ts +12 -0
- package/src/opLifecycle/remoteMessageProcessor.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/src/summary/documentSchema.ts +56 -37
|
@@ -59,6 +59,7 @@ export type InboundMessageResult =
|
|
|
59
59
|
messages: InboundSequencedContainerRuntimeMessage[];
|
|
60
60
|
batchStart: BatchStartInfo;
|
|
61
61
|
length: number;
|
|
62
|
+
groupedBatch: boolean; // Messages in a grouped batches are sent to the runtime in bunches.
|
|
62
63
|
}
|
|
63
64
|
| {
|
|
64
65
|
type: "batchStartingMessage";
|
|
@@ -171,6 +172,7 @@ export class RemoteMessageProcessor {
|
|
|
171
172
|
keyMessage: groupedMessages[0] ?? message, // For an empty batch, this is the empty grouped batch message. Needed for sequence numbers for this batch
|
|
172
173
|
},
|
|
173
174
|
length: groupedMessages.length, // Will be 0 for an empty batch
|
|
175
|
+
groupedBatch: true,
|
|
174
176
|
};
|
|
175
177
|
}
|
|
176
178
|
|
|
@@ -220,6 +222,7 @@ export class RemoteMessageProcessor {
|
|
|
220
222
|
keyMessage: message,
|
|
221
223
|
},
|
|
222
224
|
length: 1,
|
|
225
|
+
groupedBatch: false,
|
|
223
226
|
};
|
|
224
227
|
}
|
|
225
228
|
assert(batchMetadataFlag !== true, 0x9d6 /* Unexpected batch start marker */);
|
package/src/packageVersion.ts
CHANGED
|
@@ -429,6 +429,7 @@ function arrayToProp(arr: string[]) {
|
|
|
429
429
|
*
|
|
430
430
|
* @legacy
|
|
431
431
|
* @alpha
|
|
432
|
+
* @sealed
|
|
432
433
|
*/
|
|
433
434
|
export class DocumentsSchemaController {
|
|
434
435
|
private explicitSchemaControl: boolean;
|
|
@@ -601,55 +602,73 @@ export class DocumentsSchemaController {
|
|
|
601
602
|
* @param local - whether op is local
|
|
602
603
|
* @param sequenceNumber - sequence number of the op
|
|
603
604
|
* @returns - true if schema was accepted, otherwise false (rejected due to failed CAS)
|
|
605
|
+
* @deprecated It has been replaced by processDocumentSchemaMessages instead.
|
|
604
606
|
*/
|
|
605
607
|
public processDocumentSchemaOp(
|
|
606
608
|
content: IDocumentSchemaChangeMessage,
|
|
607
609
|
local: boolean,
|
|
608
610
|
sequenceNumber: number,
|
|
609
611
|
) {
|
|
610
|
-
this.
|
|
611
|
-
|
|
612
|
-
// validate is strickly less, not equal
|
|
613
|
-
assert(
|
|
614
|
-
this.documentSchema.refSeq < sequenceNumber,
|
|
615
|
-
0x950 /* time should move forward only! */,
|
|
616
|
-
);
|
|
617
|
-
|
|
618
|
-
if (content.refSeq !== this.documentSchema.refSeq) {
|
|
619
|
-
// CAS failed
|
|
620
|
-
return false;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
// This assert should be after checking for successful CAS above.
|
|
624
|
-
// This will ensure we do not trip on our own messages that are no longer wanted as we processed someone else schema change message.
|
|
625
|
-
assert(
|
|
626
|
-
!local || (this.explicitSchemaControl && this.futureSchema !== undefined),
|
|
627
|
-
0x951 /* not sending ops */,
|
|
628
|
-
);
|
|
612
|
+
return this.processDocumentSchemaMessages([content], local, sequenceNumber);
|
|
613
|
+
}
|
|
629
614
|
|
|
630
|
-
|
|
631
|
-
|
|
615
|
+
/**
|
|
616
|
+
* Process document schema change messages
|
|
617
|
+
* Called by ContainerRuntime whenever it sees document schema messages.
|
|
618
|
+
* @param contents - contents of the messages
|
|
619
|
+
* @param local - whether op is local
|
|
620
|
+
* @param sequenceNumber - sequence number of the op
|
|
621
|
+
* @returns - true if schema was accepted, otherwise false (rejected due to failed CAS)
|
|
622
|
+
*/
|
|
623
|
+
public processDocumentSchemaMessages(
|
|
624
|
+
contents: IDocumentSchemaChangeMessage[],
|
|
625
|
+
local: boolean,
|
|
626
|
+
sequenceNumber: number,
|
|
627
|
+
) {
|
|
628
|
+
for (const content of contents) {
|
|
629
|
+
this.validateSeqNumber(content.refSeq, this.documentSchema.refSeq, "content.refSeq");
|
|
630
|
+
this.validateSeqNumber(this.documentSchema.refSeq, sequenceNumber, "refSeq");
|
|
631
|
+
// validate is strickly less, not equal
|
|
632
|
+
assert(
|
|
633
|
+
this.documentSchema.refSeq < sequenceNumber,
|
|
634
|
+
0x950 /* time should move forward only! */,
|
|
635
|
+
);
|
|
632
636
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
+
if (content.refSeq !== this.documentSchema.refSeq) {
|
|
638
|
+
// CAS failed
|
|
639
|
+
return false;
|
|
640
|
+
}
|
|
637
641
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
+
// This assert should be after checking for successful CAS above.
|
|
643
|
+
// This will ensure we do not trip on our own messages that are no longer wanted as we processed someone else schema change message.
|
|
644
|
+
assert(
|
|
645
|
+
!local || (this.explicitSchemaControl && this.futureSchema !== undefined),
|
|
646
|
+
0x951 /* not sending ops */,
|
|
647
|
+
);
|
|
642
648
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
// If it was remote op, then some changes happened to schema.
|
|
646
|
-
// We would need to recalculate this.futureSchema by merging changes that we just received.
|
|
647
|
-
// Avoid this complexity for now - a new client session (loading from new summary with these changes)
|
|
648
|
-
// will automatically do this recalculation and will figure out
|
|
649
|
-
this.futureSchema = undefined;
|
|
649
|
+
// Changes are in effect. Immediately check that this client understands these changes
|
|
650
|
+
checkRuntimeCompatibility(content, "change");
|
|
650
651
|
|
|
651
|
-
|
|
652
|
+
const schema: IDocumentSchema = { ...content, refSeq: sequenceNumber };
|
|
653
|
+
this.documentSchema = schema as IDocumentSchemaCurrent;
|
|
654
|
+
this.sessionSchema = and(this.documentSchema, this.desiredSchema);
|
|
655
|
+
assert(this.sessionSchema.refSeq === sequenceNumber, 0x97d /* seq# */);
|
|
656
|
+
|
|
657
|
+
// legacy behavior is automatically off for the document once someone sends a schema op -
|
|
658
|
+
// from now on it's fully controlled by ops.
|
|
659
|
+
// This is very important, as summarizeDocumentSchema() should use this new schema!
|
|
660
|
+
this.explicitSchemaControl = true;
|
|
661
|
+
|
|
662
|
+
// Stop attempting changing schema.
|
|
663
|
+
// If it was local op, then we succeeded and do not need to try again.
|
|
664
|
+
// If it was remote op, then some changes happened to schema.
|
|
665
|
+
// We would need to recalculate this.futureSchema by merging changes that we just received.
|
|
666
|
+
// Avoid this complexity for now - a new client session (loading from new summary with these changes)
|
|
667
|
+
// will automatically do this recalculation and will figure out
|
|
668
|
+
this.futureSchema = undefined;
|
|
652
669
|
|
|
670
|
+
this.onSchemaChange(this.sessionSchema);
|
|
671
|
+
}
|
|
653
672
|
return true;
|
|
654
673
|
}
|
|
655
674
|
|