@fluidframework/container-runtime 2.0.0-internal.1.1.3 → 2.0.0-internal.1.2.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/dist/batchManager.d.ts +37 -0
- package/dist/batchManager.d.ts.map +1 -0
- package/dist/batchManager.js +73 -0
- package/dist/batchManager.js.map +1 -0
- package/dist/batchTracker.d.ts +1 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +1 -2
- package/dist/batchTracker.js.map +1 -1
- package/dist/containerRuntime.d.ts +52 -20
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +240 -119
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +12 -6
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +16 -13
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +6 -2
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +7 -9
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaScheduler.d.ts +6 -4
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +6 -4
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/garbageCollection.d.ts +41 -12
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +176 -98
- package/dist/garbageCollection.js.map +1 -1
- package/dist/gcSweepReadyUsageDetection.d.ts +53 -0
- package/dist/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/dist/gcSweepReadyUsageDetection.js +135 -0
- package/dist/gcSweepReadyUsageDetection.js.map +1 -0
- package/dist/orderedClientElection.d.ts +28 -10
- package/dist/orderedClientElection.d.ts.map +1 -1
- package/dist/orderedClientElection.js +14 -4
- package/dist/orderedClientElection.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 +0 -11
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +9 -44
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runningSummarizer.js +1 -1
- package/dist/runningSummarizer.js.map +1 -1
- package/dist/scheduleManager.d.ts +6 -3
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +22 -14
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summarizerTypes.d.ts +16 -9
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryCollection.d.ts +1 -0
- package/dist/summaryCollection.d.ts.map +1 -1
- package/dist/summaryCollection.js +29 -13
- package/dist/summaryCollection.js.map +1 -1
- package/dist/summaryManager.d.ts +2 -2
- package/dist/summaryManager.js +2 -2
- package/dist/summaryManager.js.map +1 -1
- package/lib/batchManager.d.ts +37 -0
- package/lib/batchManager.d.ts.map +1 -0
- package/lib/batchManager.js +69 -0
- package/lib/batchManager.js.map +1 -0
- package/lib/batchTracker.d.ts +1 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +1 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/containerRuntime.d.ts +52 -20
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +243 -122
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +12 -6
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +16 -13
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +6 -2
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +7 -9
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaScheduler.d.ts +6 -4
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +6 -4
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/garbageCollection.d.ts +41 -12
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +175 -97
- package/lib/garbageCollection.js.map +1 -1
- package/lib/gcSweepReadyUsageDetection.d.ts +53 -0
- package/lib/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/lib/gcSweepReadyUsageDetection.js +130 -0
- package/lib/gcSweepReadyUsageDetection.js.map +1 -0
- package/lib/orderedClientElection.d.ts +28 -10
- package/lib/orderedClientElection.d.ts.map +1 -1
- package/lib/orderedClientElection.js +14 -4
- package/lib/orderedClientElection.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 +0 -11
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +9 -44
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/runningSummarizer.js +1 -1
- package/lib/runningSummarizer.js.map +1 -1
- package/lib/scheduleManager.d.ts +6 -3
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +24 -16
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summarizerTypes.d.ts +16 -9
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryCollection.d.ts +1 -0
- package/lib/summaryCollection.d.ts.map +1 -1
- package/lib/summaryCollection.js +29 -13
- package/lib/summaryCollection.js.map +1 -1
- package/lib/summaryManager.d.ts +2 -2
- package/lib/summaryManager.js +2 -2
- package/lib/summaryManager.js.map +1 -1
- package/package.json +21 -18
- package/src/batchManager.ts +91 -0
- package/src/batchTracker.ts +1 -2
- package/src/containerRuntime.ts +336 -185
- package/src/dataStoreContext.ts +18 -14
- package/src/dataStores.ts +7 -8
- package/src/deltaScheduler.ts +6 -4
- package/src/garbageCollection.ts +224 -134
- package/src/gcSweepReadyUsageDetection.ts +147 -0
- package/src/orderedClientElection.ts +31 -10
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +9 -57
- package/src/runningSummarizer.ts +1 -1
- package/src/scheduleManager.ts +32 -12
- package/src/summarizerTypes.ts +17 -9
- package/src/summaryCollection.ts +31 -16
- package/src/summaryManager.ts +2 -2
package/src/dataStoreContext.ts
CHANGED
|
@@ -519,12 +519,18 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
519
519
|
|
|
520
520
|
/**
|
|
521
521
|
* After GC has run, called to notify the data store of routes used in it. These are used for the following:
|
|
522
|
+
*
|
|
522
523
|
* 1. To identify if this data store is being referenced in the document or not.
|
|
524
|
+
*
|
|
523
525
|
* 2. To determine if it needs to re-summarize in case used routes changed since last summary.
|
|
526
|
+
*
|
|
524
527
|
* 3. These are added to the summary generated by the data store.
|
|
525
|
-
*
|
|
526
|
-
*
|
|
528
|
+
*
|
|
529
|
+
* 4. To notify child contexts of their used routes. This is done immediately if the data store is loaded.
|
|
530
|
+
* Else, it is done when realizing the data store.
|
|
531
|
+
*
|
|
527
532
|
* 5. To update the timestamp when this data store or any children are marked as unreferenced.
|
|
533
|
+
*
|
|
528
534
|
* @param usedRoutes - The routes that are used in this data store.
|
|
529
535
|
* @param gcTimestamp - The time when GC was run that generated these used routes. If any node becomes unreferenced
|
|
530
536
|
* as part of this GC run, this should be used to update the time when it happens.
|
|
@@ -704,7 +710,7 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
704
710
|
public abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
705
711
|
|
|
706
712
|
/**
|
|
707
|
-
* @deprecated
|
|
713
|
+
* @deprecated Sets the datastore as root, for aliasing purposes: #7948
|
|
708
714
|
* This method should not be used outside of the aliasing context.
|
|
709
715
|
* It will be removed, as the source of truth for this flag will be the aliasing blob.
|
|
710
716
|
*/
|
|
@@ -713,7 +719,7 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
713
719
|
}
|
|
714
720
|
|
|
715
721
|
/**
|
|
716
|
-
* @deprecated
|
|
722
|
+
* @deprecated Renamed to `{@link FluidDataStoreContext.getBaseGCDetails}()`.
|
|
717
723
|
*/
|
|
718
724
|
public abstract getInitialGCSummaryDetails(): Promise<IGarbageCollectionSummaryDetails>;
|
|
719
725
|
|
|
@@ -819,11 +825,9 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
819
825
|
// For snapshotFormatVersion = "0.1" (1) or above, pkg is jsonified, otherwise it is just a string.
|
|
820
826
|
const formatVersion = getAttributesFormatVersion(attributes);
|
|
821
827
|
if (formatVersion < 1) {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
pkgFromSnapshot = [attributes.pkg];
|
|
826
|
-
}
|
|
828
|
+
pkgFromSnapshot = attributes.pkg.startsWith("[\"") && attributes.pkg.endsWith("\"]")
|
|
829
|
+
? JSON.parse(attributes.pkg) as string[]
|
|
830
|
+
: [attributes.pkg];
|
|
827
831
|
} else {
|
|
828
832
|
pkgFromSnapshot = JSON.parse(attributes.pkg) as string[];
|
|
829
833
|
}
|
|
@@ -856,7 +860,7 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
856
860
|
}
|
|
857
861
|
|
|
858
862
|
/**
|
|
859
|
-
* @deprecated
|
|
863
|
+
* @deprecated Renamed to {@link RemoteFluidDataStoreContext.getBaseGCDetails}.
|
|
860
864
|
*/
|
|
861
865
|
public async getInitialGCSummaryDetails(): Promise<IGarbageCollectionSummaryDetails> {
|
|
862
866
|
return this.getBaseGCDetails();
|
|
@@ -971,7 +975,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
971
975
|
}
|
|
972
976
|
|
|
973
977
|
/**
|
|
974
|
-
* @deprecated
|
|
978
|
+
* @deprecated Renamed to {@link LocalFluidDataStoreContextBase.getBaseGCDetails}.
|
|
975
979
|
*/
|
|
976
980
|
public async getInitialGCSummaryDetails(): Promise<IGarbageCollectionSummaryDetails> {
|
|
977
981
|
// Local data store does not have initial summary.
|
|
@@ -1014,7 +1018,10 @@ export class LocalDetachedFluidDataStoreContext
|
|
|
1014
1018
|
registry: IProvideFluidDataStoreFactory,
|
|
1015
1019
|
dataStoreChannel: IFluidDataStoreChannel) {
|
|
1016
1020
|
assert(this.detachedRuntimeCreation, 0x154 /* "runtime creation is already attached" */);
|
|
1021
|
+
this.detachedRuntimeCreation = false;
|
|
1022
|
+
|
|
1017
1023
|
assert(this.channelDeferred === undefined, 0x155 /* "channel deferral is already set" */);
|
|
1024
|
+
this.channelDeferred = new Deferred<IFluidDataStoreChannel>();
|
|
1018
1025
|
|
|
1019
1026
|
const factory = registry.IFluidDataStoreFactory;
|
|
1020
1027
|
|
|
@@ -1024,9 +1031,6 @@ export class LocalDetachedFluidDataStoreContext
|
|
|
1024
1031
|
assert(this.registry === undefined, 0x157 /* "datastore registry already attached" */);
|
|
1025
1032
|
this.registry = entry.registry;
|
|
1026
1033
|
|
|
1027
|
-
this.detachedRuntimeCreation = false;
|
|
1028
|
-
this.channelDeferred = new Deferred<IFluidDataStoreChannel>();
|
|
1029
|
-
|
|
1030
1034
|
super.bindRuntime(dataStoreChannel);
|
|
1031
1035
|
|
|
1032
1036
|
if (await this.isRoot()) {
|
package/src/dataStores.ts
CHANGED
|
@@ -469,12 +469,7 @@ export class DataStores implements IDisposable {
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {
|
|
472
|
-
|
|
473
|
-
if (attachState === AttachState.Attaching) {
|
|
474
|
-
eventName = "attaching";
|
|
475
|
-
} else {
|
|
476
|
-
eventName = "attached";
|
|
477
|
-
}
|
|
472
|
+
const eventName = attachState === AttachState.Attaching ? "attaching" : "attached";
|
|
478
473
|
for (const [, context] of this.contexts) {
|
|
479
474
|
// Fire only for bounded stores.
|
|
480
475
|
if (!this.contexts.isNotBound(context.id)) {
|
|
@@ -566,11 +561,15 @@ export class DataStores implements IDisposable {
|
|
|
566
561
|
|
|
567
562
|
/**
|
|
568
563
|
* Generates data used for garbage collection. It does the following:
|
|
564
|
+
*
|
|
569
565
|
* 1. Calls into each child data store context to get its GC data.
|
|
566
|
+
*
|
|
570
567
|
* 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be
|
|
571
|
-
*
|
|
568
|
+
* identified as belonging to the child.
|
|
569
|
+
*
|
|
572
570
|
* 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent
|
|
573
|
-
*
|
|
571
|
+
* the GC data of this channel.
|
|
572
|
+
*
|
|
574
573
|
* @param fullGC - true to bypass optimizations and force full generation of GC data.
|
|
575
574
|
*/
|
|
576
575
|
public async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {
|
package/src/deltaScheduler.ts
CHANGED
|
@@ -18,12 +18,14 @@ import {
|
|
|
18
18
|
* DeltaScheduler is responsible for the scheduling of inbound delta queue in cases where there
|
|
19
19
|
* is more than one op a particular run of the queue. It does not schedule if there is just one
|
|
20
20
|
* op or just one batch in the run. It does the following two things:
|
|
21
|
+
*
|
|
21
22
|
* 1. If the ops have been processed for more than a specific amount of time, it pauses the queue
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* and calls setTimeout to schedule a resume of the queue. This ensures that we don't block
|
|
24
|
+
* the JS thread for a long time processing ops synchronously (for example, when catching up
|
|
25
|
+
* ops right after boot or catching up ops / delayed realizing data stores by summarizer).
|
|
26
|
+
*
|
|
25
27
|
* 2. If we scheduled a particular run of the queue, it logs telemetry for the number of ops
|
|
26
|
-
*
|
|
28
|
+
* processed, the time and number of turns it took to process the ops.
|
|
27
29
|
*/
|
|
28
30
|
export class DeltaScheduler {
|
|
29
31
|
private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|