@fluidframework/container-runtime 2.43.0-343119 → 2.50.0-345060
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 +4 -0
- package/container-runtime.test-files.tar +0 -0
- package/dist/channelCollection.d.ts +1 -1
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +3 -1
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +1 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +18 -17
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +0 -2
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +1 -0
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +3 -2
- package/dist/opLifecycle/batchManager.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 +2 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +2 -5
- 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 +7 -6
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +20 -15
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runtimeLayerCompatState.d.ts +3 -3
- package/dist/runtimeLayerCompatState.d.ts.map +1 -1
- package/dist/runtimeLayerCompatState.js +10 -10
- package/dist/runtimeLayerCompatState.js.map +1 -1
- package/lib/channelCollection.d.ts +1 -1
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +3 -1
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +1 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +18 -17
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +0 -2
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +1 -0
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +1 -1
- package/lib/opLifecycle/batchManager.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/opGroupingManager.d.ts +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +2 -5
- 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 +7 -6
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +20 -15
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/runtimeLayerCompatState.d.ts +3 -3
- package/lib/runtimeLayerCompatState.d.ts.map +1 -1
- package/lib/runtimeLayerCompatState.js +9 -9
- package/lib/runtimeLayerCompatState.js.map +1 -1
- package/package.json +20 -20
- package/src/channelCollection.ts +3 -1
- package/src/containerRuntime.ts +24 -28
- package/src/dataStoreContext.ts +0 -2
- package/src/index.ts +7 -0
- package/src/opLifecycle/batchManager.ts +1 -1
- package/src/opLifecycle/index.ts +1 -0
- package/src/opLifecycle/opGroupingManager.ts +1 -1
- package/src/opLifecycle/outbox.ts +2 -5
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +30 -22
- package/src/runtimeLayerCompatState.ts +10 -10
package/lib/containerRuntime.js
CHANGED
|
@@ -448,11 +448,11 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
448
448
|
runtime.setConnectionStateCore(true, runtime.delayConnectClientId);
|
|
449
449
|
}
|
|
450
450
|
}, (error) => runtime.closeFn(error));
|
|
451
|
+
// Initialize the base state of the runtime before it's returned.
|
|
452
|
+
await runtime.initializeBaseState(context.loader);
|
|
451
453
|
// Apply stashed ops with a reference sequence number equal to the sequence number of the snapshot,
|
|
452
454
|
// or zero. This must be done before Container replays saved ops.
|
|
453
455
|
await runtime.pendingStateManager.applyStashedOpsAt(runtimeSequenceNumber ?? 0);
|
|
454
|
-
// Initialize the base state of the runtime before it's returned.
|
|
455
|
-
await runtime.initializeBaseState(context.loader);
|
|
456
456
|
return runtime;
|
|
457
457
|
}
|
|
458
458
|
get clientId() {
|
|
@@ -621,15 +621,15 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
621
621
|
// eslint-disable-next-line import/no-deprecated
|
|
622
622
|
this.enterStagingMode = () => {
|
|
623
623
|
if (this.stageControls !== undefined) {
|
|
624
|
-
throw new UsageError("
|
|
624
|
+
throw new UsageError("Already in staging mode");
|
|
625
625
|
}
|
|
626
626
|
if (this.attachState === AttachState.Detached) {
|
|
627
|
-
throw new UsageError("
|
|
627
|
+
throw new UsageError("Cannot enter staging mode while Detached");
|
|
628
628
|
}
|
|
629
629
|
// Make sure Outbox is empty before entering staging mode,
|
|
630
630
|
// since we mark whole batches as "staged" or not to indicate whether to submit them.
|
|
631
631
|
this.flush();
|
|
632
|
-
const exitStagingMode = (discardOrCommit) =>
|
|
632
|
+
const exitStagingMode = (discardOrCommit) => {
|
|
633
633
|
try {
|
|
634
634
|
// Final flush of any last staged changes
|
|
635
635
|
// NOTE: We can't use this.flush() here, because orderSequentially uses StagingMode and in the rollback case we'll hit assert 0x24c
|
|
@@ -649,22 +649,23 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
649
649
|
};
|
|
650
650
|
// eslint-disable-next-line import/no-deprecated
|
|
651
651
|
const stageControls = {
|
|
652
|
-
discardChanges: exitStagingMode(() => {
|
|
652
|
+
discardChanges: () => exitStagingMode(() => {
|
|
653
653
|
// Pop all staged batches from the PSM and roll them back in LIFO order
|
|
654
654
|
this.pendingStateManager.popStagedBatches(({ runtimeOp, localOpMetadata }) => {
|
|
655
|
-
|
|
656
|
-
this.rollbackStagedChanges(runtimeOp, localOpMetadata);
|
|
655
|
+
this.rollbackStagedChange(runtimeOp, localOpMetadata);
|
|
657
656
|
});
|
|
658
657
|
this.updateDocumentDirtyState();
|
|
659
658
|
}),
|
|
660
|
-
commitChanges: (
|
|
661
|
-
const
|
|
662
|
-
|
|
659
|
+
commitChanges: (options) => {
|
|
660
|
+
const { squash } = { ...defaultStagingCommitOptions, ...options };
|
|
661
|
+
exitStagingMode(() => {
|
|
662
|
+
// Replay all staged batches in typical FIFO order.
|
|
663
|
+
// We'll be out of staging mode so they'll be sent to the service finally.
|
|
663
664
|
this.pendingStateManager.replayPendingStates({
|
|
664
|
-
|
|
665
|
-
squash
|
|
665
|
+
committingStagedBatches: true,
|
|
666
|
+
squash,
|
|
666
667
|
});
|
|
667
|
-
})
|
|
668
|
+
});
|
|
668
669
|
},
|
|
669
670
|
};
|
|
670
671
|
this.stageControls = stageControls;
|
|
@@ -1109,7 +1110,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1109
1110
|
* Initializes the state from the base snapshot this container runtime loaded from.
|
|
1110
1111
|
*/
|
|
1111
1112
|
async initializeBaseState(loader) {
|
|
1112
|
-
await this.initializeSummarizer(loader);
|
|
1113
1113
|
if (this.sessionSchema.idCompressorMode === "on" ||
|
|
1114
1114
|
(this.sessionSchema.idCompressorMode === "delayed" && this.connected)) {
|
|
1115
1115
|
PerformanceEvent.timedExec(this.mc.logger, { eventName: "CreateIdCompressorOnBoot" }, (event) => {
|
|
@@ -1123,6 +1123,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1123
1123
|
// This is called from loadRuntime(), long before we process any ops, so there should be no ops accumulated yet.
|
|
1124
1124
|
assert(this.pendingIdCompressorOps.length === 0, 0x8ec /* no pending ops */);
|
|
1125
1125
|
}
|
|
1126
|
+
await this.initializeSummarizer(loader);
|
|
1126
1127
|
await this.garbageCollector.initializeBaseState();
|
|
1127
1128
|
}
|
|
1128
1129
|
async initializeSummarizer(loader) {
|
|
@@ -2076,7 +2077,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2076
2077
|
try {
|
|
2077
2078
|
checkpoint.rollback((message) =>
|
|
2078
2079
|
// These changes are staged since we entered staging mode above
|
|
2079
|
-
this.
|
|
2080
|
+
this.rollbackStagedChange(message.runtimeOp, message.localOpMetadata));
|
|
2080
2081
|
this.updateDocumentDirtyState();
|
|
2081
2082
|
stageControls?.discardChanges();
|
|
2082
2083
|
stageControls = undefined;
|
|
@@ -3055,7 +3056,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
3055
3056
|
/**
|
|
3056
3057
|
* Rollback the given op which was only staged but not yet submitted.
|
|
3057
3058
|
*/
|
|
3058
|
-
|
|
3059
|
+
rollbackStagedChange({ type, contents }, localOpMetadata) {
|
|
3059
3060
|
assert(canStageMessageOfType(type), 0xbbc /* Unexpected message type to be rolled back */);
|
|
3060
3061
|
switch (type) {
|
|
3061
3062
|
case ContainerMessageType.FluidDataStoreOp: {
|