@fluidframework/datastore 2.0.0-dev.3.1.0.125672 → 2.0.0-dev.4.2.0.153917
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 +34 -0
- package/README.md +38 -0
- package/dist/channelContext.d.ts +2 -2
- package/dist/channelContext.d.ts.map +1 -1
- package/dist/channelContext.js +2 -2
- package/dist/channelContext.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts +14 -9
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +47 -48
- package/dist/dataStoreRuntime.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/remoteChannelContext.d.ts +2 -2
- package/dist/remoteChannelContext.d.ts.map +1 -1
- package/dist/remoteChannelContext.js +41 -60
- package/dist/remoteChannelContext.js.map +1 -1
- package/lib/channelContext.d.ts +2 -2
- package/lib/channelContext.d.ts.map +1 -1
- package/lib/channelContext.js +2 -2
- package/lib/channelContext.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +14 -9
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +48 -49
- package/lib/dataStoreRuntime.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/remoteChannelContext.d.ts +2 -2
- package/lib/remoteChannelContext.d.ts.map +1 -1
- package/lib/remoteChannelContext.js +41 -60
- package/lib/remoteChannelContext.js.map +1 -1
- package/package.json +58 -59
- package/src/channelContext.ts +8 -1
- package/src/dataStoreRuntime.ts +77 -68
- package/src/packageVersion.ts +1 -1
- package/src/remoteChannelContext.ts +49 -60
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @fluidframework/datastore
|
|
2
|
+
|
|
3
|
+
## 2.0.0-internal.4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- GC interfaces removed from runtime-definitions ([#14750](https://github.com/microsoft/FluidFramework/pull-requests/14750)) [60274eacab](https://github.com/microsoft/FluidFramework/commits/60274eacabf14d42f52f6ad1c2f64356e64ba1a2)
|
|
8
|
+
|
|
9
|
+
The following interfaces available in `@fluidframework/runtime-definitions` are internal implementation details and have been deprecated for public use. They will be removed in an upcoming release.
|
|
10
|
+
|
|
11
|
+
- `IGarbageCollectionNodeData`
|
|
12
|
+
- `IGarbageCollectionState`
|
|
13
|
+
- `IGarbageCollectionSnapshotData`
|
|
14
|
+
- `IGarbageCollectionSummaryDetailsLegacy`
|
|
15
|
+
|
|
16
|
+
- @fluidframework/garbage-collector deprecated ([#14750](https://github.com/microsoft/FluidFramework/pull-requests/14750)) [60274eacab](https://github.com/microsoft/FluidFramework/commits/60274eacabf14d42f52f6ad1c2f64356e64ba1a2)
|
|
17
|
+
|
|
18
|
+
The `@fluidframework/garbage-collector` package is deprecated with the following functions, interfaces, and types in it.
|
|
19
|
+
These are internal implementation details and have been deprecated for public use. They will be removed in an upcoming
|
|
20
|
+
release.
|
|
21
|
+
|
|
22
|
+
- `cloneGCData`
|
|
23
|
+
- `concatGarbageCollectionData`
|
|
24
|
+
- `concatGarbageCollectionStates`
|
|
25
|
+
- `GCDataBuilder`
|
|
26
|
+
- `getGCDataFromSnapshot`
|
|
27
|
+
- `IGCResult`
|
|
28
|
+
- `removeRouteFromAllNodes`
|
|
29
|
+
- `runGarbageCollection`
|
|
30
|
+
- `trimLeadingAndTrailingSlashes`
|
|
31
|
+
- `trimLeadingSlashes`
|
|
32
|
+
- `trimTrailingSlashes`
|
|
33
|
+
- `unpackChildNodesGCDetails`
|
|
34
|
+
- `unpackChildNodesUsedRoutes`
|
package/README.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @fluidframework/datastore
|
|
2
2
|
|
|
3
|
+
<!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
|
|
4
|
+
|
|
5
|
+
<!-- prettier-ignore-start -->
|
|
6
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
7
|
+
|
|
8
|
+
## Using Fluid Framework libraries
|
|
9
|
+
|
|
10
|
+
When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
|
|
11
|
+
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
12
|
+
library consumers should always prefer `^`.
|
|
13
|
+
|
|
14
|
+
Note that when depending on a library version of the form 2.0.0-internal.x.y.z, called the Fluid internal version
|
|
15
|
+
scheme, you must use a `>= <` dependency range. Standard `^` and `~` ranges will not work as expected. See the
|
|
16
|
+
[@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
17
|
+
package for more information including tools to convert between version schemes.
|
|
18
|
+
|
|
19
|
+
<!-- prettier-ignore-end -->
|
|
20
|
+
|
|
21
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
22
|
+
|
|
3
23
|
# Fluid Handle
|
|
4
24
|
|
|
5
25
|
A Fluid handle is a handle to a Fluid object like a `DataStore` or a `SharedObject` (DDS). It can be used to represent the object in the system and has the capability to get the underlying object by calling `get()` on it.
|
|
@@ -15,3 +35,21 @@ The two major interfaces required to implement a Fluid handle are `IFluidHandle`
|
|
|
15
35
|
`IFluidHandleContext` describes a routing context (another `IFluidHandleContext`) that has a path to this `IFluidHandleContext`. When creating a Data Store Handle the route context should be the `FluidDataStoreRuntime` which knows how to reach the `FluidDataStore`. Similarly, the `FluidDataStoreRuntime's` route context should be the `ContainerRuntime` which knows how to reach it.
|
|
16
36
|
|
|
17
37
|
For more details on Fluid Handles, check this [doc](../../../content/docs/advanced/handles.md).
|
|
38
|
+
|
|
39
|
+
<!-- AUTO-GENERATED-CONTENT:START (README_TRADEMARK_SECTION:includeHeading=TRUE) -->
|
|
40
|
+
|
|
41
|
+
<!-- prettier-ignore-start -->
|
|
42
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
43
|
+
|
|
44
|
+
## Trademark
|
|
45
|
+
|
|
46
|
+
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
47
|
+
|
|
48
|
+
Use of these trademarks or logos must follow Microsoft's [Trademark & Brand
|
|
49
|
+
Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
50
|
+
|
|
51
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
52
|
+
|
|
53
|
+
<!-- prettier-ignore-end -->
|
|
54
|
+
|
|
55
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
package/dist/channelContext.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
|
7
7
|
import { IChannel } from "@fluidframework/datastore-definitions";
|
|
8
8
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
9
9
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
10
|
-
import { IGarbageCollectionData, ISummarizeResult, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
10
|
+
import { IGarbageCollectionData, IExperimentalIncrementalSummaryContext, ISummarizeResult, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
11
11
|
import { ChannelDeltaConnection } from "./channelDeltaConnection";
|
|
12
12
|
import { ChannelStorageService } from "./channelStorageService";
|
|
13
13
|
export declare const attributesBlobKey = ".attributes";
|
|
@@ -38,5 +38,5 @@ export declare function createServiceEndpoints(id: string, connected: boolean, s
|
|
|
38
38
|
objectStorage: ChannelStorageService;
|
|
39
39
|
};
|
|
40
40
|
export declare function summarizeChannel(channel: IChannel, fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
41
|
-
export declare function summarizeChannelAsync(channel: IChannel, fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
|
|
41
|
+
export declare function summarizeChannelAsync(channel: IChannel, fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
|
|
42
42
|
//# sourceMappingURL=channelContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelContext.d.ts","sourceRoot":"","sources":["../src/channelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EACN,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC/B,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEhC,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,OAAE;IAE1D,SAAS,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,OAAO,GAA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,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvD;;;;OAIG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAE7D;;;;;OAKG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC7C;AAED,wBAAgB,sBAAsB,CACrC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,EAC1D,OAAO,EAAE,MAAM,IAAI,EACnB,0BAA0B,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,KAAK,IAAI,EAC3F,cAAc,EAAE,uBAAuB,EACvC,MAAM,EAAE,gBAAgB,EACxB,IAAI,CAAC,EAAE,aAAa,EACpB,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC;;;EAezC;AAED,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,QAAQ,EACjB,QAAQ,GAAE,OAAe,EACzB,UAAU,GAAE,OAAe,EAC3B,gBAAgB,CAAC,EAAE,iBAAiB,GAClC,qBAAqB,CAMvB;AAED,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,QAAQ,EACjB,QAAQ,GAAE,OAAe,EACzB,UAAU,GAAE,OAAe,EAC3B,gBAAgB,CAAC,EAAE,iBAAiB,EACpC,yBAAyB,CAAC,EAAE,sCAAsC,GAChE,OAAO,CAAC,qBAAqB,CAAC,CAWhC"}
|
package/dist/channelContext.js
CHANGED
|
@@ -25,8 +25,8 @@ function summarizeChannel(channel, fullTree = false, trackState = false, telemet
|
|
|
25
25
|
return summarizeResult;
|
|
26
26
|
}
|
|
27
27
|
exports.summarizeChannel = summarizeChannel;
|
|
28
|
-
async function summarizeChannelAsync(channel, fullTree = false, trackState = false, telemetryContext) {
|
|
29
|
-
const summarizeResult = await channel.summarize(fullTree, trackState, telemetryContext);
|
|
28
|
+
async function summarizeChannelAsync(channel, fullTree = false, trackState = false, telemetryContext, incrementalSummaryContext) {
|
|
29
|
+
const summarizeResult = await channel.summarize(fullTree, trackState, telemetryContext, incrementalSummaryContext);
|
|
30
30
|
// Add the channel attributes to the returned result.
|
|
31
31
|
(0, runtime_utils_1.addBlobToSummary)(summarizeResult, exports.attributesBlobKey, JSON.stringify(channel.attributes));
|
|
32
32
|
return summarizeResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelContext.js","sourceRoot":"","sources":["../src/channelContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"channelContext.js","sourceRoot":"","sources":["../src/channelContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,iEAAiE;AACjE,qEAAkE;AAClE,mEAAgE;AAEnD,QAAA,iBAAiB,GAAG,aAAa,CAAC;AAqC/C,SAAgB,sBAAsB,CACrC,EAAU,EACV,SAAkB,EAClB,QAA0D,EAC1D,OAAmB,EACnB,0BAA2F,EAC3F,cAAuC,EACvC,MAAwB,EACxB,IAAoB,EACpB,UAAyC;IAEzC,MAAM,eAAe,GAAG,IAAI,+CAAsB,CACjD,EAAE,EACF,SAAS,EACT,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,EAChE,OAAO,EACP,0BAA0B,CAC1B,CAAC;IACF,MAAM,aAAa,GAAG,IAAI,6CAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAE1F,OAAO;QACN,eAAe;QACf,aAAa;KACb,CAAC;AACH,CAAC;AAxBD,wDAwBC;AAED,SAAgB,gBAAgB,CAC/B,OAAiB,EACjB,WAAoB,KAAK,EACzB,aAAsB,KAAK,EAC3B,gBAAoC;IAEpC,MAAM,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAEzF,qDAAqD;IACrD,IAAA,gCAAgB,EAAC,eAAe,EAAE,yBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACzF,OAAO,eAAe,CAAC;AACxB,CAAC;AAXD,4CAWC;AAEM,KAAK,UAAU,qBAAqB,CAC1C,OAAiB,EACjB,WAAoB,KAAK,EACzB,aAAsB,KAAK,EAC3B,gBAAoC,EACpC,yBAAkE;IAElE,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,SAAS,CAC9C,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,yBAAyB,CACzB,CAAC;IAEF,qDAAqD;IACrD,IAAA,gCAAgB,EAAC,eAAe,EAAE,yBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACzF,OAAO,eAAe,CAAC;AACxB,CAAC;AAjBD,sDAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { IChannel } from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIGarbageCollectionData,\n\tIExperimentalIncrementalSummaryContext,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { addBlobToSummary } from \"@fluidframework/runtime-utils\";\nimport { ChannelDeltaConnection } from \"./channelDeltaConnection\";\nimport { ChannelStorageService } from \"./channelStorageService\";\n\nexport const attributesBlobKey = \".attributes\";\n\nexport interface IChannelContext {\n\tgetChannel(): Promise<IChannel>;\n\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\tprocessOp(message: ISequencedDocumentMessage, local: boolean, localOpMetadata?: unknown): void;\n\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult>;\n\n\treSubmit(content: any, localOpMetadata: unknown): void;\n\n\tapplyStashedOp(content: any): unknown;\n\n\trollback(message: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n\t * including any of its children. Each node has a set of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * After GC has run, called to notify this context of routes that are used in it. These are used for the following:\n\t * 1. To identify if this context is being referenced in the document or not.\n\t * 2. To identify if this context or any of its children's used routes changed since last summary.\n\t * 3. They are added to the summary generated by this context.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n}\n\nexport function createServiceEndpoints(\n\tid: string,\n\tconnected: boolean,\n\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\tdirtyFn: () => void,\n\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\tstorageService: IDocumentStorageService,\n\tlogger: ITelemetryLogger,\n\ttree?: ISnapshotTree,\n\textraBlobs?: Map<string, ArrayBufferLike>,\n) {\n\tconst deltaConnection = new ChannelDeltaConnection(\n\t\tid,\n\t\tconnected,\n\t\t(message, localOpMetadata) => submitFn(message, localOpMetadata),\n\t\tdirtyFn,\n\t\taddedGCOutboundReferenceFn,\n\t);\n\tconst objectStorage = new ChannelStorageService(tree, storageService, logger, extraBlobs);\n\n\treturn {\n\t\tdeltaConnection,\n\t\tobjectStorage,\n\t};\n}\n\nexport function summarizeChannel(\n\tchannel: IChannel,\n\tfullTree: boolean = false,\n\ttrackState: boolean = false,\n\ttelemetryContext?: ITelemetryContext,\n): ISummaryTreeWithStats {\n\tconst summarizeResult = channel.getAttachSummary(fullTree, trackState, telemetryContext);\n\n\t// Add the channel attributes to the returned result.\n\taddBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));\n\treturn summarizeResult;\n}\n\nexport async function summarizeChannelAsync(\n\tchannel: IChannel,\n\tfullTree: boolean = false,\n\ttrackState: boolean = false,\n\ttelemetryContext?: ITelemetryContext,\n\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n): Promise<ISummaryTreeWithStats> {\n\tconst summarizeResult = await channel.summarize(\n\t\tfullTree,\n\t\ttrackState,\n\t\ttelemetryContext,\n\t\tincrementalSummaryContext,\n\t);\n\n\t// Add the channel attributes to the returned result.\n\taddBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));\n\treturn summarizeResult;\n}\n"]}
|
|
@@ -52,7 +52,6 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
52
52
|
private readonly contexts;
|
|
53
53
|
private readonly contextsDeferred;
|
|
54
54
|
private readonly pendingAttach;
|
|
55
|
-
private bindState;
|
|
56
55
|
private readonly deferredAttached;
|
|
57
56
|
private readonly localChannelContextQueue;
|
|
58
57
|
private readonly notBoundedChannelContextSet;
|
|
@@ -64,8 +63,14 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
64
63
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
65
64
|
private readonly quorum;
|
|
66
65
|
private readonly audience;
|
|
67
|
-
readonly
|
|
68
|
-
|
|
66
|
+
private readonly mc;
|
|
67
|
+
get logger(): ITelemetryLogger;
|
|
68
|
+
/**
|
|
69
|
+
* If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.
|
|
70
|
+
* So, adding a count of how many telemetry events are logged per data store context. This can be
|
|
71
|
+
* controlled via feature flags.
|
|
72
|
+
*/
|
|
73
|
+
private localChangesTelemetryCount;
|
|
69
74
|
/**
|
|
70
75
|
* Invokes the given callback and expects that no ops are submitted
|
|
71
76
|
* until execution finishes. If an op is submitted, an error will be raised.
|
|
@@ -172,12 +177,6 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
172
177
|
* @param outboundHandle - The handle of the outbound node that is referenced.
|
|
173
178
|
*/
|
|
174
179
|
private addedGCOutboundReference;
|
|
175
|
-
/**
|
|
176
|
-
* Returns the base GC details for the channel with the given id. This is used to initialize its GC state.
|
|
177
|
-
* @param channelId - The id of the channel context that is asked for the initial GC details.
|
|
178
|
-
* @returns the requested channel's base GC details.
|
|
179
|
-
*/
|
|
180
|
-
private getChannelBaseGCDetails;
|
|
181
180
|
/**
|
|
182
181
|
* Returns a summary at the current sequence number.
|
|
183
182
|
* @param fullTree - true to bypass optimizations and force a full summary tree
|
|
@@ -217,6 +216,12 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
217
216
|
private processChannelOp;
|
|
218
217
|
private attachListener;
|
|
219
218
|
private verifyNotClosed;
|
|
219
|
+
/**
|
|
220
|
+
* Summarizer client should not have local changes. These changes can become part of the summary and can break
|
|
221
|
+
* eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
|
|
222
|
+
* other clients that are up-to-date till seq# 100 may not have them yet.
|
|
223
|
+
*/
|
|
224
|
+
private identifyLocalChangeInSummarizer;
|
|
220
225
|
}
|
|
221
226
|
/**
|
|
222
227
|
* Mixin class that adds request handler to FluidDataStoreRuntime
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACN,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,MAAM,iCA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BAAgB;IAqBxB,OAAO,CAAC,cAAc;IA0CtB,OAAO,CAAC,eAAe;IAMvB;;;;OAIG;IACH,OAAO,CAAC,+BAA+B;CA8BvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,6BACL,QAAQ,WAAW,qBAAqB,KAAK,QAAQ,SAAS,CAAC,SACnF,4BAA4B,iCAUD,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sBAErB,qBAAqB,KAC1B,QAAQ;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,SACvD,4BAA4B,iCAkCD,CAAC"}
|
package/dist/dataStoreRuntime.js
CHANGED
|
@@ -13,7 +13,6 @@ const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
|
13
13
|
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
14
14
|
const runtime_definitions_1 = require("@fluidframework/runtime-definitions");
|
|
15
15
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
16
|
-
const garbage_collector_1 = require("@fluidframework/garbage-collector");
|
|
17
16
|
const uuid_1 = require("uuid");
|
|
18
17
|
const channelContext_1 = require("./channelContext");
|
|
19
18
|
const localChannelContext_1 = require("./localChannelContext");
|
|
@@ -41,6 +40,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
41
40
|
* and the primary way of interacting with some Fluid objects, and should be used if possible.
|
|
42
41
|
*/
|
|
43
42
|
constructor(dataStoreContext, sharedObjectRegistry, existing, initializeEntryPoint) {
|
|
43
|
+
var _a;
|
|
44
44
|
super();
|
|
45
45
|
this.dataStoreContext = dataStoreContext;
|
|
46
46
|
this.sharedObjectRegistry = sharedObjectRegistry;
|
|
@@ -55,19 +55,15 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
55
55
|
// store becomes visible.
|
|
56
56
|
this.pendingHandlesToMakeVisible = new Set();
|
|
57
57
|
(0, common_utils_1.assert)(!dataStoreContext.id.includes("/"), 0x30e /* Id cannot contain slashes. DataStoreContext should have validated this. */);
|
|
58
|
-
this.
|
|
58
|
+
this.mc = (0, telemetry_utils_1.loggerToMonitoringContext)(telemetry_utils_1.ChildLogger.create(dataStoreContext.logger, "FluidDataStoreRuntime", {
|
|
59
59
|
all: { dataStoreId: (0, uuid_1.v4)() },
|
|
60
|
-
});
|
|
60
|
+
}));
|
|
61
61
|
this.id = dataStoreContext.id;
|
|
62
62
|
this.options = dataStoreContext.options;
|
|
63
63
|
this.deltaManager = dataStoreContext.deltaManager;
|
|
64
64
|
this.quorum = dataStoreContext.getQuorum();
|
|
65
65
|
this.audience = dataStoreContext.getAudience();
|
|
66
66
|
const tree = dataStoreContext.baseSnapshot;
|
|
67
|
-
this.channelsBaseGCDetails = new common_utils_1.LazyPromise(async () => {
|
|
68
|
-
const baseGCDetails = await this.dataStoreContext.getBaseGCDetails();
|
|
69
|
-
return (0, garbage_collector_1.unpackChildNodesGCDetails)(baseGCDetails);
|
|
70
|
-
});
|
|
71
67
|
// Must always receive the data store type inside of the attributes
|
|
72
68
|
if ((tree === null || tree === void 0 ? void 0 : tree.trees) !== undefined) {
|
|
73
69
|
Object.keys(tree.trees).forEach((path) => {
|
|
@@ -95,7 +91,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
95
91
|
else {
|
|
96
92
|
channelContext = new remoteChannelContext_1.RemoteChannelContext(this, dataStoreContext, dataStoreContext.storage, (content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata), (address) => this.setChannelDirty(address), (srcHandle, outboundHandle) => this.addedGCOutboundReference(srcHandle, outboundHandle), path, tree.trees[path], this.sharedObjectRegistry, undefined /* extraBlobs */, this.dataStoreContext.getCreateChildSummarizerNodeFn(path, {
|
|
97
93
|
type: runtime_definitions_1.CreateSummarizerNodeSource.FromSummary,
|
|
98
|
-
})
|
|
94
|
+
}));
|
|
99
95
|
}
|
|
100
96
|
const deferred = new common_utils_1.Deferred();
|
|
101
97
|
deferred.resolve(channelContext);
|
|
@@ -108,8 +104,6 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
108
104
|
this.entryPoint = new fluidHandle_1.FluidObjectHandle(promise, "", this.objectsRoutingContext);
|
|
109
105
|
}
|
|
110
106
|
this.attachListener();
|
|
111
|
-
// If exists on storage or loaded from a snapshot, it should already be bound.
|
|
112
|
-
this.bindState = existing ? runtime_definitions_1.BindState.Bound : runtime_definitions_1.BindState.NotBound;
|
|
113
107
|
this._attachState = dataStoreContext.attachState;
|
|
114
108
|
/**
|
|
115
109
|
* If existing flag is false, this is a new data store and is not visible. The existing flag can be true in two
|
|
@@ -134,6 +128,9 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
134
128
|
if (existing) {
|
|
135
129
|
this.deferredAttached.resolve();
|
|
136
130
|
}
|
|
131
|
+
// By default, a data store can log maximum 10 local changes telemetry in summarizer.
|
|
132
|
+
this.localChangesTelemetryCount =
|
|
133
|
+
(_a = this.mc.config.getNumber("Fluid.Telemetry.LocalChangesTelemetryCount")) !== null && _a !== void 0 ? _a : 10;
|
|
137
134
|
}
|
|
138
135
|
/**
|
|
139
136
|
* @deprecated - Instantiate the class using its constructor instead.
|
|
@@ -185,6 +182,9 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
185
182
|
get disposed() {
|
|
186
183
|
return this._disposed;
|
|
187
184
|
}
|
|
185
|
+
get logger() {
|
|
186
|
+
return this.mc.logger;
|
|
187
|
+
}
|
|
188
188
|
/**
|
|
189
189
|
* Invokes the given callback and expects that no ops are submitted
|
|
190
190
|
* until execution finishes. If an op is submitted, an error will be raised.
|
|
@@ -226,7 +226,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
226
226
|
return { mimeType: "fluid/object", status: 200, value: channel };
|
|
227
227
|
}
|
|
228
228
|
catch (error) {
|
|
229
|
-
this.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
|
|
229
|
+
this.mc.logger.sendErrorEvent({ eventName: "GetChannelFailedInRequest" }, error);
|
|
230
230
|
return (0, runtime_utils_1.createResponseError)(500, `Failed to get Channel: ${error}`, request);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -268,6 +268,8 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
268
268
|
deferred.resolve(context);
|
|
269
269
|
this.contextsDeferred.set(id, deferred);
|
|
270
270
|
}
|
|
271
|
+
// Channels (DDS) should not be created in summarizer client.
|
|
272
|
+
this.identifyLocalChangeInSummarizer("DDSCreatedInSummarizer", id, type);
|
|
271
273
|
(0, common_utils_1.assert)(!!context.channel, 0x17a /* "Channel should be loaded when created!!" */);
|
|
272
274
|
return context.channel;
|
|
273
275
|
}
|
|
@@ -317,7 +319,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
317
319
|
handle.attachGraph();
|
|
318
320
|
});
|
|
319
321
|
this.pendingHandlesToMakeVisible.clear();
|
|
320
|
-
this.
|
|
322
|
+
this.dataStoreContext.makeLocallyVisible();
|
|
321
323
|
}
|
|
322
324
|
/**
|
|
323
325
|
* This function is called when a handle to this data store is added to a visible DDS.
|
|
@@ -333,12 +335,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
333
335
|
* 2. Attaching the graph if the data store becomes attached.
|
|
334
336
|
*/
|
|
335
337
|
bindToContext() {
|
|
336
|
-
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
this.bindState = runtime_definitions_1.BindState.Binding;
|
|
340
|
-
this.dataStoreContext.bindToContext();
|
|
341
|
-
this.bindState = runtime_definitions_1.BindState.Bound;
|
|
338
|
+
this.makeVisibleAndAttachGraph();
|
|
342
339
|
}
|
|
343
340
|
bind(handle) {
|
|
344
341
|
// If visible, attach the incoming handle's graph. Else, this will be done when we become visible.
|
|
@@ -380,16 +377,14 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
380
377
|
this.pendingAttach.delete(id);
|
|
381
378
|
}
|
|
382
379
|
else {
|
|
383
|
-
(0, common_utils_1.assert)(!this.contexts.has(id), 0x17d /*
|
|
384
|
-
is in pendingAttach set: ${this.pendingAttach.has(id)},
|
|
385
|
-
is local channel contexts: ${this.contexts.get(id) instanceof LocalChannelContextBase}` */);
|
|
380
|
+
(0, common_utils_1.assert)(!this.contexts.has(id), 0x17d /* "Unexpected attach channel OP" */);
|
|
386
381
|
const flatBlobs = new Map();
|
|
387
382
|
const snapshotTree = (0, driver_utils_1.buildSnapshotTree)(attachMessage.snapshot.entries, flatBlobs);
|
|
388
383
|
const remoteChannelContext = new remoteChannelContext_1.RemoteChannelContext(this, this.dataStoreContext, this.dataStoreContext.storage, (content, localContentMetadata) => this.submitChannelOp(id, content, localContentMetadata), (address) => this.setChannelDirty(address), (srcHandle, outboundHandle) => this.addedGCOutboundReference(srcHandle, outboundHandle), id, snapshotTree, this.sharedObjectRegistry, flatBlobs, this.dataStoreContext.getCreateChildSummarizerNodeFn(id, {
|
|
389
384
|
type: runtime_definitions_1.CreateSummarizerNodeSource.FromAttach,
|
|
390
385
|
sequenceNumber: message.sequenceNumber,
|
|
391
386
|
snapshot: attachMessage.snapshot,
|
|
392
|
-
}),
|
|
387
|
+
}), attachMessage.type);
|
|
393
388
|
this.contexts.set(id, remoteChannelContext);
|
|
394
389
|
if (this.contextsDeferred.has(id)) {
|
|
395
390
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -470,7 +465,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
470
465
|
* @param fullGC - true to bypass optimizations and force full generation of GC data.
|
|
471
466
|
*/
|
|
472
467
|
async getGCData(fullGC = false) {
|
|
473
|
-
const builder = new
|
|
468
|
+
const builder = new runtime_utils_1.GCDataBuilder();
|
|
474
469
|
// Iterate over each channel context and get their GC data.
|
|
475
470
|
await Promise.all(Array.from(this.contexts)
|
|
476
471
|
.filter(([contextId, _]) => {
|
|
@@ -495,7 +490,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
495
490
|
updateUsedRoutes(usedRoutes) {
|
|
496
491
|
var _a;
|
|
497
492
|
// Get a map of channel ids to routes used in it.
|
|
498
|
-
const usedContextRoutes = (0,
|
|
493
|
+
const usedContextRoutes = (0, runtime_utils_1.unpackChildNodesUsedRoutes)(usedRoutes);
|
|
499
494
|
// Verify that the used routes are correct.
|
|
500
495
|
for (const [id] of usedContextRoutes) {
|
|
501
496
|
(0, common_utils_1.assert)(this.contexts.has(id), 0x17e /* "Used route does not belong to any known context" */);
|
|
@@ -515,30 +510,6 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
515
510
|
var _a, _b;
|
|
516
511
|
(_b = (_a = this.dataStoreContext).addedGCOutboundReference) === null || _b === void 0 ? void 0 : _b.call(_a, srcHandle, outboundHandle);
|
|
517
512
|
}
|
|
518
|
-
/**
|
|
519
|
-
* Returns the base GC details for the channel with the given id. This is used to initialize its GC state.
|
|
520
|
-
* @param channelId - The id of the channel context that is asked for the initial GC details.
|
|
521
|
-
* @returns the requested channel's base GC details.
|
|
522
|
-
*/
|
|
523
|
-
async getChannelBaseGCDetails(channelId) {
|
|
524
|
-
var _a;
|
|
525
|
-
let channelBaseGCDetails = (await this.channelsBaseGCDetails).get(channelId);
|
|
526
|
-
if (channelBaseGCDetails === undefined) {
|
|
527
|
-
channelBaseGCDetails = {};
|
|
528
|
-
}
|
|
529
|
-
else if (((_a = channelBaseGCDetails.gcData) === null || _a === void 0 ? void 0 : _a.gcNodes) !== undefined) {
|
|
530
|
-
// Note: if the child channel has an explicit handle route to its parent, it will be removed here and
|
|
531
|
-
// expected to be added back by the parent when getGCData is called.
|
|
532
|
-
(0, garbage_collector_1.removeRouteFromAllNodes)(channelBaseGCDetails.gcData.gcNodes, this.absolutePath);
|
|
533
|
-
}
|
|
534
|
-
// Currently, channel context's are always considered used. So, it there are no used routes for it, we still
|
|
535
|
-
// need to mark it as used. Add self-route (empty string) to the channel context's used routes.
|
|
536
|
-
if (channelBaseGCDetails.usedRoutes === undefined ||
|
|
537
|
-
channelBaseGCDetails.usedRoutes.length === 0) {
|
|
538
|
-
channelBaseGCDetails.usedRoutes = [""];
|
|
539
|
-
}
|
|
540
|
-
return channelBaseGCDetails;
|
|
541
|
-
}
|
|
542
513
|
/**
|
|
543
514
|
* Returns a summary at the current sequence number.
|
|
544
515
|
* @param fullTree - true to bypass optimizations and force a full summary tree
|
|
@@ -754,6 +725,34 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
754
725
|
throw new telemetry_utils_1.LoggingError("Runtime is closed");
|
|
755
726
|
}
|
|
756
727
|
}
|
|
728
|
+
/**
|
|
729
|
+
* Summarizer client should not have local changes. These changes can become part of the summary and can break
|
|
730
|
+
* eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
|
|
731
|
+
* other clients that are up-to-date till seq# 100 may not have them yet.
|
|
732
|
+
*/
|
|
733
|
+
identifyLocalChangeInSummarizer(eventName, channelId, channelType) {
|
|
734
|
+
if (this.clientDetails.type !== "summarizer" || this.localChangesTelemetryCount <= 0) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
// Log a telemetry if there are local changes in the summarizer. This will give us data on how often
|
|
738
|
+
// this is happening and which data stores do this. The eventual goal is to disallow local changes
|
|
739
|
+
// in the summarizer and the data will help us plan this.
|
|
740
|
+
this.mc.logger.sendTelemetryEvent({
|
|
741
|
+
eventName,
|
|
742
|
+
channelType,
|
|
743
|
+
channelId: {
|
|
744
|
+
value: channelId,
|
|
745
|
+
tag: telemetry_utils_1.TelemetryDataTag.CodeArtifact,
|
|
746
|
+
},
|
|
747
|
+
fluidDataStoreId: {
|
|
748
|
+
value: this.id,
|
|
749
|
+
tag: telemetry_utils_1.TelemetryDataTag.CodeArtifact,
|
|
750
|
+
},
|
|
751
|
+
fluidDataStorePackagePath: (0, runtime_utils_1.packagePathToTelemetryProperty)(this.dataStoreContext.packagePath),
|
|
752
|
+
stack: (0, telemetry_utils_1.generateStack)(),
|
|
753
|
+
});
|
|
754
|
+
this.localChangesTelemetryCount--;
|
|
755
|
+
}
|
|
757
756
|
}
|
|
758
757
|
exports.FluidDataStoreRuntime = FluidDataStoreRuntime;
|
|
759
758
|
/**
|