@fluidframework/container-runtime 2.1.0-276985 → 2.1.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 +4 -0
- package/README.md +71 -18
- package/api-extractor/api-extractor.current.json +5 -0
- package/api-extractor/api-extractor.legacy.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/container-runtime.legacy.public.api.md +9 -0
- package/container-runtime.test-files.tar +0 -0
- package/dist/blobManager/blobManager.d.ts +10 -0
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +19 -0
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +1 -1
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +40 -8
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +14 -5
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +151 -99
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +4 -0
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +9 -3
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +14 -8
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +4 -2
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +12 -0
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +3 -2
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +6 -6
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/metadata.d.ts +7 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +6 -0
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +8 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +37 -16
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +1 -1
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +2 -2
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +3 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +12 -8
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +14 -11
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +11 -6
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +22 -6
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +43 -21
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +10 -8
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +39 -15
- 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/pendingStateManager.d.ts +37 -13
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +95 -45
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/public.d.ts +1 -1
- package/dist/scheduleManager.js +4 -0
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +4 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/blobManager/blobManager.d.ts +10 -0
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +19 -0
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +1 -1
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +40 -8
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +14 -5
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +152 -100
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +4 -0
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +10 -4
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +14 -8
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +4 -2
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +12 -0
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +3 -2
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +6 -6
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/metadata.d.ts +7 -1
- package/lib/metadata.d.ts.map +1 -1
- package/lib/metadata.js +4 -1
- package/lib/metadata.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +8 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +35 -15
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +1 -1
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +2 -2
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +2 -2
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +12 -8
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +14 -11
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +11 -6
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +22 -6
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +44 -22
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +10 -8
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +37 -14
- 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/pendingStateManager.d.ts +37 -13
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +95 -45
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/scheduleManager.js +4 -0
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +4 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/package.json +46 -31
- package/src/blobManager/blobManager.ts +19 -0
- package/src/channelCollection.ts +48 -11
- package/src/containerRuntime.ts +203 -133
- package/src/dataStoreContext.ts +22 -4
- package/src/gc/garbageCollection.ts +15 -10
- package/src/gc/gcDefinitions.ts +7 -2
- package/src/gc/gcHelpers.ts +18 -6
- package/src/gc/gcTelemetry.ts +20 -8
- package/src/metadata.ts +11 -1
- package/src/opLifecycle/README.md +0 -8
- package/src/opLifecycle/batchManager.ts +49 -16
- package/src/opLifecycle/definitions.ts +1 -1
- package/src/opLifecycle/index.ts +13 -2
- package/src/opLifecycle/opCompressor.ts +12 -8
- package/src/opLifecycle/opGroupingManager.ts +14 -11
- package/src/opLifecycle/opSplitter.ts +10 -6
- package/src/opLifecycle/outbox.ts +64 -26
- package/src/opLifecycle/remoteMessageProcessor.ts +56 -17
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +173 -74
- package/src/scheduleManager.ts +6 -2
- package/src/summary/README.md +81 -0
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +3 -1
- package/src/summary/summaryFormat.ts +3 -1
- package/src/summary/summaryFormats.md +69 -8
- package/tsconfig.json +0 -1
- package/src/summary/images/appTree.png +0 -0
- package/src/summary/images/protocolAndAppTree.png +0 -0
- package/src/summary/images/summaryTree.png +0 -0
package/src/channelCollection.ts
CHANGED
|
@@ -69,6 +69,7 @@ import {
|
|
|
69
69
|
createChildMonitoringContext,
|
|
70
70
|
extractSafePropertiesFromMessage,
|
|
71
71
|
tagCodeArtifacts,
|
|
72
|
+
type ITelemetryPropertiesExt,
|
|
72
73
|
} from "@fluidframework/telemetry-utils/internal";
|
|
73
74
|
import { v4 as uuid } from "uuid";
|
|
74
75
|
|
|
@@ -562,7 +563,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
562
563
|
return {
|
|
563
564
|
id: localContext.id,
|
|
564
565
|
snapshot,
|
|
565
|
-
|
|
566
|
+
// TODO why are we non null asserting here?
|
|
567
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
568
|
+
type: getLocalDataStoreType(localContext)!,
|
|
566
569
|
} satisfies IAttachMessage;
|
|
567
570
|
}
|
|
568
571
|
|
|
@@ -805,6 +808,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
805
808
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
806
809
|
snapshotTree,
|
|
807
810
|
});
|
|
811
|
+
// add to the list of bound or remoted, as this context must be bound
|
|
812
|
+
// to had an attach message sent, and is the non-detached case is remoted.
|
|
813
|
+
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
808
814
|
|
|
809
815
|
// realize the local context, as local contexts shouldn't be delay
|
|
810
816
|
// loaded, as this client is playing the role of creating client,
|
|
@@ -812,9 +818,6 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
812
818
|
const channel = await dataStoreContext.realize();
|
|
813
819
|
await channel.entryPoint.get();
|
|
814
820
|
|
|
815
|
-
// add to the list of bound or remoted, as this context must be bound
|
|
816
|
-
// to had an attach message sent, and is the non-detached case is remoted.
|
|
817
|
-
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
818
821
|
if (this.parentContext.attachState !== AttachState.Detached) {
|
|
819
822
|
// if the client is not detached put in the pending attach list
|
|
820
823
|
// so that on ack of the stashed op, the context is found.
|
|
@@ -1113,7 +1116,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1113
1116
|
0x166 /* "BaseSnapshot should be there as detached container loaded from snapshot" */,
|
|
1114
1117
|
);
|
|
1115
1118
|
dataStoreSummary = convertSnapshotTreeToSummaryTree(
|
|
1116
|
-
|
|
1119
|
+
// TODO why are we non null asserting here?
|
|
1120
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1121
|
+
getSnapshotTree(this.baseSnapshot).trees[contextId]!,
|
|
1117
1122
|
);
|
|
1118
1123
|
}
|
|
1119
1124
|
builder.addWithStats(contextId, dataStoreSummary);
|
|
@@ -1182,6 +1187,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1182
1187
|
*/
|
|
1183
1188
|
private async visitContextsDuringSummary(
|
|
1184
1189
|
visitor: (contextId: string, context: FluidDataStoreContext) => Promise<void>,
|
|
1190
|
+
telemetryProps: ITelemetryPropertiesExt,
|
|
1185
1191
|
): Promise<void> {
|
|
1186
1192
|
for (const [contextId, context] of this.contexts) {
|
|
1187
1193
|
// Summarizer client and hence GC works only with clients with no local changes. A data store in
|
|
@@ -1197,7 +1203,23 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1197
1203
|
}
|
|
1198
1204
|
|
|
1199
1205
|
if (context.attachState === AttachState.Attached) {
|
|
1206
|
+
// If summary / getGCData results in this data store's realization, let GC know so that it can log in
|
|
1207
|
+
// case the data store is not referenced. This will help identifying scenarios that we see today where
|
|
1208
|
+
// unreferenced data stores are being loaded.
|
|
1209
|
+
const contextLoadedBefore = context.isLoaded;
|
|
1210
|
+
const trailingOpCount = context.pendingCount;
|
|
1211
|
+
|
|
1200
1212
|
await visitor(contextId, context);
|
|
1213
|
+
|
|
1214
|
+
if (!contextLoadedBefore && context.isLoaded) {
|
|
1215
|
+
this.gcNodeUpdated({
|
|
1216
|
+
node: { type: "DataStore", path: `/${context.id}` },
|
|
1217
|
+
reason: "Realized",
|
|
1218
|
+
packagePath: context.packagePath,
|
|
1219
|
+
timestampMs: undefined, // This will be added by the parent context if needed.
|
|
1220
|
+
additionalProps: { trailingOpCount, ...telemetryProps },
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1201
1223
|
}
|
|
1202
1224
|
}
|
|
1203
1225
|
}
|
|
@@ -1213,6 +1235,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1213
1235
|
const contextSummary = await context.summarize(fullTree, trackState, telemetryContext);
|
|
1214
1236
|
summaryBuilder.addWithStats(contextId, contextSummary);
|
|
1215
1237
|
},
|
|
1238
|
+
{ fullTree, realizedDuring: "summarize" },
|
|
1216
1239
|
);
|
|
1217
1240
|
return summaryBuilder.getSummaryTree();
|
|
1218
1241
|
}
|
|
@@ -1239,6 +1262,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1239
1262
|
// This also gradually builds the id of each node to be a path from the root.
|
|
1240
1263
|
builder.prefixAndAddNodes(contextId, contextGCData.gcNodes);
|
|
1241
1264
|
},
|
|
1265
|
+
{ fullGC, realizedDuring: "getGCData" },
|
|
1242
1266
|
);
|
|
1243
1267
|
|
|
1244
1268
|
// Get the outbound routes and add a GC node for this channel.
|
|
@@ -1276,9 +1300,12 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1276
1300
|
this.mc.logger.sendTelemetryEvent({
|
|
1277
1301
|
eventName: "GC_DeletingLoadedDataStore",
|
|
1278
1302
|
...tagCodeArtifacts({
|
|
1279
|
-
id: dataStoreId
|
|
1303
|
+
id: `/${dataStoreId}`, // Make the id consistent with GC node path format by prefixing a slash.
|
|
1280
1304
|
pkg: dataStoreContext.packagePath.join("/"),
|
|
1281
1305
|
}),
|
|
1306
|
+
details: {
|
|
1307
|
+
aliased: this.aliasedDataStores.has(dataStoreId),
|
|
1308
|
+
},
|
|
1282
1309
|
});
|
|
1283
1310
|
}
|
|
1284
1311
|
|
|
@@ -1300,7 +1327,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1300
1327
|
): readonly string[] {
|
|
1301
1328
|
for (const route of sweepReadyDataStoreRoutes) {
|
|
1302
1329
|
const pathParts = route.split("/");
|
|
1303
|
-
|
|
1330
|
+
// TODO why are we non null asserting here?
|
|
1331
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1332
|
+
const dataStoreId = pathParts[1]!;
|
|
1304
1333
|
|
|
1305
1334
|
// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only
|
|
1306
1335
|
// need to delete the data store.
|
|
@@ -1345,7 +1374,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1345
1374
|
if (pathParts.length > 2) {
|
|
1346
1375
|
continue;
|
|
1347
1376
|
}
|
|
1348
|
-
|
|
1377
|
+
// TODO why are we non null asserting here?
|
|
1378
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1379
|
+
const dataStoreId = pathParts[1]!;
|
|
1349
1380
|
assert(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);
|
|
1350
1381
|
tombstonedDataStoresSet.add(dataStoreId);
|
|
1351
1382
|
}
|
|
@@ -1380,7 +1411,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1380
1411
|
): Promise<readonly string[] | undefined> {
|
|
1381
1412
|
// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the
|
|
1382
1413
|
// data store that contains it.
|
|
1383
|
-
|
|
1414
|
+
// TODO why are we non null asserting here?
|
|
1415
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1416
|
+
const context = this.contexts.get(nodePath.split("/")[1]!);
|
|
1384
1417
|
return (await context?.getInitialSnapshotDetails())?.pkg;
|
|
1385
1418
|
}
|
|
1386
1419
|
|
|
@@ -1390,7 +1423,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1390
1423
|
*/
|
|
1391
1424
|
public getGCNodeType(nodePath: string): GCNodeType | undefined {
|
|
1392
1425
|
const pathParts = nodePath.split("/");
|
|
1393
|
-
|
|
1426
|
+
// TODO why are we non null asserting here?
|
|
1427
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1428
|
+
if (!this.contexts.has(pathParts[1]!)) {
|
|
1394
1429
|
return undefined;
|
|
1395
1430
|
}
|
|
1396
1431
|
|
|
@@ -1408,7 +1443,9 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
1408
1443
|
|
|
1409
1444
|
public async request(request: IRequest): Promise<IResponse> {
|
|
1410
1445
|
const requestParser = RequestParser.create(request);
|
|
1411
|
-
|
|
1446
|
+
// TODO why are we non null asserting here?
|
|
1447
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1448
|
+
const id = requestParser.pathParts[0]!;
|
|
1412
1449
|
|
|
1413
1450
|
// Differentiate between requesting the dataStore directly, or one of its children
|
|
1414
1451
|
const requestForChild = !requestParser.isLeaf(1);
|