@fluidframework/container-runtime 0.59.3001 → 0.59.4000-71128

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.
Files changed (51) hide show
  1. package/dist/batchTracker.js +1 -1
  2. package/dist/batchTracker.js.map +1 -1
  3. package/dist/containerRuntime.d.ts.map +1 -1
  4. package/dist/containerRuntime.js +10 -7
  5. package/dist/containerRuntime.js.map +1 -1
  6. package/dist/dataStoreContext.js +1 -1
  7. package/dist/dataStoreContext.js.map +1 -1
  8. package/dist/dataStores.js +3 -3
  9. package/dist/dataStores.js.map +1 -1
  10. package/dist/garbageCollection.d.ts +23 -10
  11. package/dist/garbageCollection.d.ts.map +1 -1
  12. package/dist/garbageCollection.js +161 -51
  13. package/dist/garbageCollection.js.map +1 -1
  14. package/dist/opTelemetry.js +2 -2
  15. package/dist/opTelemetry.js.map +1 -1
  16. package/dist/packageVersion.d.ts +1 -1
  17. package/dist/packageVersion.d.ts.map +1 -1
  18. package/dist/packageVersion.js +1 -1
  19. package/dist/packageVersion.js.map +1 -1
  20. package/dist/summaryFormat.js +1 -1
  21. package/dist/summaryFormat.js.map +1 -1
  22. package/lib/batchTracker.js +1 -1
  23. package/lib/batchTracker.js.map +1 -1
  24. package/lib/containerRuntime.d.ts.map +1 -1
  25. package/lib/containerRuntime.js +12 -9
  26. package/lib/containerRuntime.js.map +1 -1
  27. package/lib/dataStoreContext.js +1 -1
  28. package/lib/dataStoreContext.js.map +1 -1
  29. package/lib/dataStores.js +3 -3
  30. package/lib/dataStores.js.map +1 -1
  31. package/lib/garbageCollection.d.ts +23 -10
  32. package/lib/garbageCollection.d.ts.map +1 -1
  33. package/lib/garbageCollection.js +139 -48
  34. package/lib/garbageCollection.js.map +1 -1
  35. package/lib/opTelemetry.js +2 -2
  36. package/lib/opTelemetry.js.map +1 -1
  37. package/lib/packageVersion.d.ts +1 -1
  38. package/lib/packageVersion.d.ts.map +1 -1
  39. package/lib/packageVersion.js +1 -1
  40. package/lib/packageVersion.js.map +1 -1
  41. package/lib/summaryFormat.js +1 -1
  42. package/lib/summaryFormat.js.map +1 -1
  43. package/package.json +22 -19
  44. package/src/batchTracker.ts +1 -1
  45. package/src/containerRuntime.ts +21 -8
  46. package/src/dataStoreContext.ts +1 -1
  47. package/src/dataStores.ts +3 -3
  48. package/src/garbageCollection.ts +191 -47
  49. package/src/opTelemetry.ts +2 -2
  50. package/src/packageVersion.ts +1 -1
  51. package/src/summaryFormat.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-runtime",
3
- "version": "0.59.3001",
3
+ "version": "0.59.4000-71128",
4
4
  "description": "Fluid container runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -63,33 +63,34 @@
63
63
  "dependencies": {
64
64
  "@fluidframework/common-definitions": "^0.20.1",
65
65
  "@fluidframework/common-utils": "^0.32.1",
66
- "@fluidframework/container-definitions": "^0.48.1000",
67
- "@fluidframework/container-runtime-definitions": "^0.59.3001",
68
- "@fluidframework/container-utils": "^0.59.3001",
66
+ "@fluidframework/container-definitions": "^0.48.2000-0",
67
+ "@fluidframework/container-runtime-definitions": "0.59.4000-71128",
68
+ "@fluidframework/container-utils": "0.59.4000-71128",
69
69
  "@fluidframework/core-interfaces": "^0.43.1000",
70
- "@fluidframework/datastore": "^0.59.3001",
71
- "@fluidframework/driver-definitions": "^0.46.1000",
72
- "@fluidframework/driver-utils": "^0.59.3001",
73
- "@fluidframework/garbage-collector": "^0.59.3001",
74
- "@fluidframework/protocol-base": "^0.1036.3000",
75
- "@fluidframework/protocol-definitions": "^0.1028.1000",
76
- "@fluidframework/runtime-definitions": "^0.59.3001",
77
- "@fluidframework/runtime-utils": "^0.59.3001",
78
- "@fluidframework/telemetry-utils": "^0.59.3001",
70
+ "@fluidframework/datastore": "0.59.4000-71128",
71
+ "@fluidframework/driver-definitions": "^0.46.2000-0",
72
+ "@fluidframework/driver-utils": "0.59.4000-71128",
73
+ "@fluidframework/garbage-collector": "0.59.4000-71128",
74
+ "@fluidframework/protocol-base": "^0.1036.4000-0",
75
+ "@fluidframework/protocol-definitions": "^0.1028.2000-0",
76
+ "@fluidframework/runtime-definitions": "0.59.4000-71128",
77
+ "@fluidframework/runtime-utils": "0.59.4000-71128",
78
+ "@fluidframework/telemetry-utils": "0.59.4000-71128",
79
79
  "double-ended-queue": "^2.1.0-0",
80
+ "semver": "^7.3.4",
80
81
  "uuid": "^8.3.1"
81
82
  },
82
83
  "devDependencies": {
83
84
  "@fluidframework/build-common": "^0.23.0",
84
- "@fluidframework/build-tools": "^0.2.66793",
85
+ "@fluidframework/build-tools": "^0.2.70857",
85
86
  "@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@0.59.3000",
86
87
  "@fluidframework/eslint-config-fluid": "^0.28.2000",
87
- "@fluidframework/mocha-test-setup": "^0.59.3001",
88
- "@fluidframework/test-runtime-utils": "^0.59.3001",
88
+ "@fluidframework/mocha-test-setup": "0.59.4000-71128",
89
+ "@fluidframework/test-runtime-utils": "0.59.4000-71128",
89
90
  "@microsoft/api-extractor": "^7.22.2",
90
91
  "@rushstack/eslint-config": "^2.5.1",
91
92
  "@types/double-ended-queue": "^2.1.0",
92
- "@types/mocha": "^8.2.2",
93
+ "@types/mocha": "^9.1.1",
93
94
  "@types/node": "^14.18.0",
94
95
  "@types/sinon": "^7.0.13",
95
96
  "@types/uuid": "^8.3.0",
@@ -103,12 +104,14 @@
103
104
  "eslint-plugin-eslint-comments": "~3.2.0",
104
105
  "eslint-plugin-import": "~2.25.4",
105
106
  "eslint-plugin-jest": "~26.1.3",
107
+ "eslint-plugin-jsdoc": "~39.3.0",
106
108
  "eslint-plugin-mocha": "~10.0.3",
107
109
  "eslint-plugin-promise": "~6.0.0",
108
110
  "eslint-plugin-react": "~7.28.0",
109
111
  "eslint-plugin-tsdoc": "~0.2.14",
110
112
  "eslint-plugin-unicorn": "~40.0.0",
111
- "mocha": "^8.4.0",
113
+ "eslint-plugin-unused-imports": "~2.0.0",
114
+ "mocha": "^10.0.0",
112
115
  "nyc": "^15.0.0",
113
116
  "rimraf": "^2.6.2",
114
117
  "sinon": "^7.4.2",
@@ -116,7 +119,7 @@
116
119
  "typescript-formatter": "7.1.0"
117
120
  },
118
121
  "typeValidation": {
119
- "version": "0.59.3001",
122
+ "version": "0.59.4000",
120
123
  "broken": {}
121
124
  }
122
125
  }
@@ -75,6 +75,6 @@ export class BatchTracker {
75
75
  export const BindBatchTracker = (
76
76
  batchEventEmitter: EventEmitter,
77
77
  logger: ITelemetryLogger,
78
- batchLengthThreshold: number = 128,
78
+ batchLengthThreshold: number = 1000,
79
79
  batchCountSamplingRate: number = 1000,
80
80
  ) => new BatchTracker(batchEventEmitter, logger, batchLengthThreshold, batchCountSamplingRate);
@@ -99,8 +99,9 @@ import {
99
99
  responseToException,
100
100
  seqFromTree,
101
101
  calculateStats,
102
+ addSummarizeResultToSummary,
102
103
  } from "@fluidframework/runtime-utils";
103
- import { GCDataBuilder } from "@fluidframework/garbage-collector";
104
+ import { GCDataBuilder, trimLeadingAndTrailingSlashes } from "@fluidframework/garbage-collector";
104
105
  import { v4 as uuid } from "uuid";
105
106
  import { ContainerFluidHandleContext } from "./containerHandleContext";
106
107
  import { FluidDataStoreRegistry } from "./dataStoreRegistry";
@@ -1029,6 +1030,7 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
1029
1030
  this.mc.logger,
1030
1031
  existing,
1031
1032
  metadata,
1033
+ this.context.clientDetails.type === summarizerClientType,
1032
1034
  );
1033
1035
 
1034
1036
  const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
@@ -1401,8 +1403,12 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
1401
1403
  }
1402
1404
 
1403
1405
  const dataStoreChannel = await dataStoreContext.realize();
1406
+
1407
+ // Remove query params, leading and trailing slashes from the url. This is done to make sure the format is
1408
+ // the same as GC nodes id.
1409
+ const urlWithoutQuery = trimLeadingAndTrailingSlashes(request.url.split("?")[0]);
1404
1410
  this.garbageCollector.nodeUpdated(
1405
- `/${id}`,
1411
+ `/${urlWithoutQuery}`,
1406
1412
  "Loaded",
1407
1413
  undefined /* timestampMs */,
1408
1414
  dataStoreContext.packagePath,
@@ -1429,7 +1435,11 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
1429
1435
  addBlobToSummary(summaryTree, metadataBlobName, JSON.stringify(metadata));
1430
1436
  }
1431
1437
 
1432
- private addContainerStateToSummary(summaryTree: ISummaryTreeWithStats) {
1438
+ private addContainerStateToSummary(
1439
+ summaryTree: ISummaryTreeWithStats,
1440
+ fullTree: boolean,
1441
+ trackState: boolean,
1442
+ ) {
1433
1443
  this.addMetadataToSummary(summaryTree);
1434
1444
 
1435
1445
  if (this.chunkMap.size > 0) {
@@ -1455,9 +1465,9 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
1455
1465
  }
1456
1466
 
1457
1467
  if (this.garbageCollector.writeDataAtRoot) {
1458
- const gcSummary = this.garbageCollector.summarize();
1468
+ const gcSummary = this.garbageCollector.summarize(fullTree, trackState);
1459
1469
  if (gcSummary !== undefined) {
1460
- addTreeToSummary(summaryTree, gcTreeKey, gcSummary);
1470
+ addSummarizeResultToSummary(summaryTree, gcTreeKey, gcSummary);
1461
1471
  }
1462
1472
  }
1463
1473
  }
@@ -1997,7 +2007,10 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
1997
2007
  // Wrap data store summaries in .channels subtree.
1998
2008
  wrapSummaryInChannelsTree(summarizeResult);
1999
2009
  }
2000
- this.addContainerStateToSummary(summarizeResult);
2010
+ this.addContainerStateToSummary(
2011
+ summarizeResult,
2012
+ true /* fullTree */,
2013
+ false /* trackState */);
2001
2014
  return summarizeResult.summary;
2002
2015
  }
2003
2016
 
@@ -2020,7 +2033,7 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
2020
2033
  wrapSummaryInChannelsTree(summarizeResult);
2021
2034
  pathPartsForChildren = [channelsTreeName];
2022
2035
  }
2023
- this.addContainerStateToSummary(summarizeResult);
2036
+ this.addContainerStateToSummary(summarizeResult, fullTree, trackState);
2024
2037
  return {
2025
2038
  ...summarizeResult,
2026
2039
  id: "",
@@ -2343,7 +2356,7 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>
2343
2356
  const handleCount = Object.values(dataStoreTree.tree).filter(
2344
2357
  (value) => value.type === SummaryType.Handle).length;
2345
2358
  const gcSummaryTreeStats = summaryTree.tree[gcTreeKey]
2346
- ? calculateStats((summaryTree.tree[gcTreeKey] as ISummaryTree))
2359
+ ? calculateStats(summaryTree.tree[gcTreeKey])
2347
2360
  : undefined;
2348
2361
 
2349
2362
  const summaryStats: IGeneratedSummaryStats = {
@@ -275,7 +275,7 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
275
275
 
276
276
  // URIs use slashes as delimiters. Handles use URIs.
277
277
  // Thus having slashes in types almost guarantees trouble down the road!
278
- assert(this.id.indexOf("/") === -1, 0x13a /* `Data store ID contains slash: ${id}` */);
278
+ assert(!this.id.includes("/"), 0x13a /* Data store ID contains slash */);
279
279
 
280
280
  this._attachState = this.containerRuntime.attachState !== AttachState.Detached && this.existing ?
281
281
  this.containerRuntime.attachState : AttachState.Detached;
package/src/dataStores.ts CHANGED
@@ -536,7 +536,7 @@ export class DataStores implements IDisposable {
536
536
  public async updateStateBeforeGC(): Promise<void> {
537
537
  for (const id of this.dataStoresSinceLastGC) {
538
538
  const context = this.contexts.get(id);
539
- assert(context !== undefined, 0x2b6 /* `Missing data store context with id ${id}` */);
539
+ assert(context !== undefined, 0x2b6 /* Missing data store context */);
540
540
  if (await context.isRoot()) {
541
541
  // A root data store is basically a reference from the container runtime to the data store.
542
542
  const handle = new FluidObjectHandle(context, id, this.runtime.IFluidHandleContext);
@@ -610,7 +610,7 @@ export class DataStores implements IDisposable {
610
610
  continue;
611
611
  }
612
612
  const dataStoreId = pathParts[1];
613
- assert(this.contexts.has(dataStoreId), 0x2d7 /* `${dataStoreId} is not a data store` */);
613
+ assert(this.contexts.has(dataStoreId), 0x2d7 /* No data store with specified id */);
614
614
  // Delete the contexts of unused data stores.
615
615
  this.contexts.delete(dataStoreId);
616
616
  // Delete the summarizer node of the unused data stores.
@@ -672,7 +672,7 @@ export function getSummaryForDatastores(
672
672
 
673
673
  if (rootHasIsolatedChannels(metadata)) {
674
674
  const datastoresSnapshot = snapshot.trees[channelsTreeName];
675
- assert(!!datastoresSnapshot, 0x168 /* `expected ${channelsTreeName} tree in snapshot` */);
675
+ assert(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);
676
676
  return datastoresSnapshot;
677
677
  } else {
678
678
  // back-compat: strip out all non-datastore paths before giving to DataStores object.