@fluidframework/container-runtime 2.0.0-rc.2.0.3 → 2.0.0-rc.2.0.4
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/api-report/container-runtime.api.md +32 -4
- package/dist/channelCollection.d.ts +7 -3
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +80 -22
- package/dist/channelCollection.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +14 -4
- package/dist/container-runtime-beta.d.ts +6 -0
- package/dist/container-runtime-public.d.ts +6 -0
- package/dist/container-runtime-untrimmed.d.ts +43 -4
- package/dist/containerRuntime.d.ts +6 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +16 -4
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +12 -2
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +2 -0
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -0
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +4 -11
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +45 -29
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +26 -5
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +5 -4
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +14 -2
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +13 -2
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +24 -21
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/index.d.ts +2 -2
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +2 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.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/lib/channelCollection.d.ts +7 -3
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +82 -24
- package/lib/channelCollection.js.map +1 -1
- package/lib/container-runtime-alpha.d.ts +14 -4
- package/lib/container-runtime-beta.d.ts +6 -0
- package/lib/container-runtime-public.d.ts +6 -0
- package/lib/container-runtime-untrimmed.d.ts +43 -4
- package/lib/containerRuntime.d.ts +6 -0
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +15 -3
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +12 -2
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +2 -0
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -0
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +4 -11
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +47 -31
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +26 -5
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +5 -4
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +12 -1
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +13 -2
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +24 -21
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/index.d.ts +2 -2
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.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/test/gc/garbageCollection.spec.js +23 -14
- package/lib/test/gc/garbageCollection.spec.js.map +1 -1
- package/lib/test/gc/gcHelpers.spec.js +69 -1
- package/lib/test/gc/gcHelpers.spec.js.map +1 -1
- package/lib/test/gc/gcTelemetry.spec.js +31 -3
- package/lib/test/gc/gcTelemetry.spec.js.map +1 -1
- package/package.json +16 -16
- package/src/channelCollection.ts +107 -43
- package/src/containerRuntime.ts +17 -23
- package/src/dataStoreContext.ts +14 -2
- package/src/dataStoreContexts.ts +12 -0
- package/src/gc/garbageCollection.ts +63 -41
- package/src/gc/gcDefinitions.ts +21 -9
- package/src/gc/gcHelpers.ts +14 -1
- package/src/gc/gcTelemetry.ts +56 -47
- package/src/gc/index.ts +2 -1
- package/src/index.ts +3 -0
- package/src/packageVersion.ts +1 -1
|
@@ -261,6 +261,9 @@ export interface ContainerRuntimeMessage {
|
|
|
261
261
|
// @alpha (undocumented)
|
|
262
262
|
export const DefaultSummaryConfiguration: ISummaryConfiguration;
|
|
263
263
|
|
|
264
|
+
// @alpha
|
|
265
|
+
export const DeletedResponseHeaderKey = "wasDeleted";
|
|
266
|
+
|
|
264
267
|
// @internal
|
|
265
268
|
export function detectOutboundReferences(envelope: IEnvelope, addedOutboundReference: (fromNodePath: string, toNodePath: string) => void): void;
|
|
266
269
|
|
|
@@ -294,10 +297,10 @@ export type GCFeatureMatrix = {
|
|
|
294
297
|
|
|
295
298
|
// @alpha
|
|
296
299
|
export const GCNodeType: {
|
|
297
|
-
DataStore:
|
|
298
|
-
SubDataStore:
|
|
299
|
-
Blob:
|
|
300
|
-
Other:
|
|
300
|
+
readonly DataStore: "DataStore";
|
|
301
|
+
readonly SubDataStore: "SubDataStore";
|
|
302
|
+
readonly Blob: "Blob";
|
|
303
|
+
readonly Other: "Other";
|
|
301
304
|
};
|
|
302
305
|
|
|
303
306
|
// @alpha (undocumented)
|
|
@@ -459,6 +462,19 @@ export interface IGCMetadata {
|
|
|
459
462
|
readonly tombstoneTimeoutMs?: number;
|
|
460
463
|
}
|
|
461
464
|
|
|
465
|
+
// @internal
|
|
466
|
+
export interface IGCNodeUpdatedProps {
|
|
467
|
+
headerData?: RuntimeHeaderData;
|
|
468
|
+
node: {
|
|
469
|
+
type: (typeof GCNodeType)["DataStore" | "Blob"];
|
|
470
|
+
path: string;
|
|
471
|
+
};
|
|
472
|
+
packagePath?: readonly string[];
|
|
473
|
+
reason: "Loaded" | "Changed";
|
|
474
|
+
request?: IRequest;
|
|
475
|
+
timestampMs?: number;
|
|
476
|
+
}
|
|
477
|
+
|
|
462
478
|
// @alpha (undocumented)
|
|
463
479
|
export interface IGCRuntimeOptions {
|
|
464
480
|
[key: string]: any;
|
|
@@ -763,6 +779,18 @@ export interface RecentlyAddedContainerRuntimeMessageDetails {
|
|
|
763
779
|
compatDetails: IContainerRuntimeMessageCompatDetails;
|
|
764
780
|
}
|
|
765
781
|
|
|
782
|
+
// @internal
|
|
783
|
+
export interface RuntimeHeaderData {
|
|
784
|
+
// (undocumented)
|
|
785
|
+
allowInactive?: boolean;
|
|
786
|
+
// (undocumented)
|
|
787
|
+
allowTombstone?: boolean;
|
|
788
|
+
// (undocumented)
|
|
789
|
+
viaHandle?: boolean;
|
|
790
|
+
// (undocumented)
|
|
791
|
+
wait?: boolean;
|
|
792
|
+
}
|
|
793
|
+
|
|
766
794
|
// @internal
|
|
767
795
|
export enum RuntimeHeaders {
|
|
768
796
|
viaHandle = "viaHandle",
|
|
@@ -9,7 +9,7 @@ import { AttachState } from "@fluidframework/container-definitions";
|
|
|
9
9
|
import { RuntimeHeaderData } from "./containerRuntime.js";
|
|
10
10
|
import { FluidDataStoreContext, LocalFluidDataStoreContext } from "./dataStoreContext.js";
|
|
11
11
|
import { IDataStoreAliasMessage } from "./dataStore.js";
|
|
12
|
-
import { GCNodeType } from "./gc/index.js";
|
|
12
|
+
import { GCNodeType, IGCNodeUpdatedProps } from "./gc/index.js";
|
|
13
13
|
import { IContainerRuntimeMetadata } from "./summary/index.js";
|
|
14
14
|
/**
|
|
15
15
|
* Accepted header keys for requests coming to the runtime.
|
|
@@ -67,7 +67,8 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
67
67
|
private readonly containerRuntimeHandle;
|
|
68
68
|
private readonly pendingAliasMap;
|
|
69
69
|
private readonly contexts;
|
|
70
|
-
|
|
70
|
+
private readonly aliasedDataStores;
|
|
71
|
+
constructor(baseSnapshot: ISnapshotTree | undefined, parentContext: IFluidParentContext, baseLogger: ITelemetryBaseLogger, gcNodeUpdated: (props: IGCNodeUpdatedProps) => void, isDataStoreDeleted: (nodePath: string) => boolean, aliasMap: Map<string, string>, provideEntryPoint: (runtime: ChannelCollection) => Promise<FluidObject>);
|
|
71
72
|
get aliases(): ReadonlyMap<string, string>;
|
|
72
73
|
get pendingAliases(): Map<string, Promise<AliasResult>>;
|
|
73
74
|
waitIfPendingAlias(maybeAlias: string): Promise<AliasResult>;
|
|
@@ -118,7 +119,7 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
118
119
|
applyStashedOp(content: unknown): Promise<unknown>;
|
|
119
120
|
private applyStashedAttachOp;
|
|
120
121
|
process(message: ISequencedDocumentMessage, local: boolean, localMessageMetadata: unknown, addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void): void;
|
|
121
|
-
getDataStore
|
|
122
|
+
private getDataStore;
|
|
122
123
|
/**
|
|
123
124
|
* Returns the data store requested with the given id if available. Otherwise, returns undefined.
|
|
124
125
|
*/
|
|
@@ -127,8 +128,10 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
127
128
|
* Checks if the data store has been deleted by GC. If so, log an error.
|
|
128
129
|
* @param id - The data store's id.
|
|
129
130
|
* @param context - The data store context.
|
|
131
|
+
* @param deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)
|
|
130
132
|
* @param callSite - The function name this is called from.
|
|
131
133
|
* @param requestHeaderData - The request header information to log if the data store is deleted.
|
|
134
|
+
* @param originalRequest - The original request (could be for a child of the DataStore)
|
|
132
135
|
* @returns true if the data store is deleted. Otherwise, returns false.
|
|
133
136
|
*/
|
|
134
137
|
private checkAndLogIfDeleted;
|
|
@@ -171,6 +174,7 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
171
174
|
* @param unusedRoutes - The routes that are unused in all data stores in this Container.
|
|
172
175
|
*/
|
|
173
176
|
updateUnusedRoutes(unusedRoutes: readonly string[]): void;
|
|
177
|
+
private deleteChild;
|
|
174
178
|
/**
|
|
175
179
|
* Delete data stores and its objects that are sweep ready.
|
|
176
180
|
* @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EACN,WAAW,EAIX,SAAS,EACT,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EAGnB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,kCAAkC,EAClC,uBAAuB,EACvB,MAAM,qCAAqC,CAAC;AAyB7C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAIpE,OAAO,
|
|
1
|
+
{"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EACN,WAAW,EAIX,SAAS,EACT,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EAGnB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,kCAAkC,EAClC,uBAAuB,EACvB,MAAM,qCAAqC,CAAC;AAyB7C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAIpE,OAAO,EAEN,iBAAiB,EAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,qBAAqB,EAErB,0BAA0B,EAG1B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,sBAAsB,EAGtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,UAAU,EAEV,mBAAmB,EAEnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,yBAAyB,EAGzB,MAAM,oBAAoB,CAAC;AAI5B;;;GAGG;AACH,oBAAY,cAAc;IACzB,kFAAkF;IAClF,IAAI,SAAS;IACb,0DAA0D;IAC1D,SAAS,cAAc;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D;;;GAGG;AACH,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAS7D;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,mBAAmB,CAgE7E;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACzC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SAAS,MAAM,EAAE;IAmBjE;;;OAGG;YACW,iBAAiB;IAY/B;;OAEG;IACU,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAO9F;;;OAGG;IACI,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAcvD,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAIhC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;CAwD3D;AAED,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,aAAa,GAAG,SAAS,EACnC,QAAQ,CAAC,EAAE,yBAAyB,GAClC,aAAa,GAAG,SAAS,CAsB3B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,QAAQ,EAAE,SAAS,EACnB,sBAAsB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,GACxE,IAAI,CA+BN;AAED,gBAAgB;AAChB,qBAAa,wBAAyB,YAAW,sBAAsB;IAQrE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAPnC,SAAgB,IAAI,8BAA8B;IAE3C,uBAAuB,EAAE,uBAAuB,CAAC;gBAGvD,eAAe,EAAE,kCAAkC,EAElC,iBAAiB,EAAE,CACnC,OAAO,EAAE,sBAAsB,KAC3B,OAAO,CAAC,WAAW,CAAC;IAK1B,IAAW,sBAAsB,SAEhC;IAEY,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,OAAO,GAChB,OAAO,CAAC,sBAAsB,CAAC;CAalC"}
|
|
@@ -169,6 +169,7 @@ class ChannelCollection {
|
|
|
169
169
|
this.contexts = new dataStoreContexts_js_1.DataStoreContexts(baseLogger);
|
|
170
170
|
this.containerRuntimeHandle = new datastore_1.FluidObjectHandle(this.parentContext, "/", this.parentContext.IFluidHandleContext);
|
|
171
171
|
this.entryPoint = new datastore_1.FluidObjectHandle(new core_utils_1.LazyPromise(async () => provideEntryPoint(this)), "", this.parentContext.IFluidHandleContext);
|
|
172
|
+
this.aliasedDataStores = new Set(aliasMap.values());
|
|
172
173
|
// Extract stores stored inside the snapshot
|
|
173
174
|
const fluidDataStores = new Map();
|
|
174
175
|
if (baseSnapshot) {
|
|
@@ -346,6 +347,7 @@ class ChannelCollection {
|
|
|
346
347
|
const handle = new datastore_1.FluidObjectHandle(context, aliasMessage.internalId, this.parentContext.IFluidHandleContext);
|
|
347
348
|
this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
|
|
348
349
|
this.aliasMap.set(aliasMessage.alias, context.id);
|
|
350
|
+
this.aliasedDataStores.add(context.id);
|
|
349
351
|
context.setInMemoryRoot();
|
|
350
352
|
return true;
|
|
351
353
|
}
|
|
@@ -605,14 +607,20 @@ class ChannelCollection {
|
|
|
605
607
|
}
|
|
606
608
|
// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is
|
|
607
609
|
// being used.
|
|
608
|
-
this.gcNodeUpdated(
|
|
610
|
+
this.gcNodeUpdated({
|
|
611
|
+
node: { type: "DataStore", path: `/${envelope.address}` },
|
|
612
|
+
reason: "Changed",
|
|
613
|
+
timestampMs: message.timestamp,
|
|
614
|
+
packagePath: context.isLoaded ? context.packagePath : undefined,
|
|
615
|
+
});
|
|
609
616
|
}
|
|
610
|
-
async getDataStore(id, requestHeaderData) {
|
|
617
|
+
async getDataStore(id, requestHeaderData, originalRequest) {
|
|
611
618
|
const headerData = { ...containerRuntime_js_1.defaultRuntimeHeaderData, ...requestHeaderData };
|
|
612
|
-
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData)) {
|
|
619
|
+
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData, originalRequest)) {
|
|
613
620
|
// The requested data store has been deleted by gc. Create a 404 response exception.
|
|
614
|
-
|
|
615
|
-
|
|
621
|
+
throw (0, runtime_utils_1.responseToException)((0, runtime_utils_1.createResponseError)(404, "DataStore was deleted", originalRequest, {
|
|
622
|
+
[containerRuntime_js_1.DeletedResponseHeaderKey]: true,
|
|
623
|
+
}), originalRequest);
|
|
616
624
|
}
|
|
617
625
|
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
|
|
618
626
|
if (context === undefined) {
|
|
@@ -641,21 +649,52 @@ class ChannelCollection {
|
|
|
641
649
|
* Checks if the data store has been deleted by GC. If so, log an error.
|
|
642
650
|
* @param id - The data store's id.
|
|
643
651
|
* @param context - The data store context.
|
|
652
|
+
* @param deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)
|
|
644
653
|
* @param callSite - The function name this is called from.
|
|
645
654
|
* @param requestHeaderData - The request header information to log if the data store is deleted.
|
|
655
|
+
* @param originalRequest - The original request (could be for a child of the DataStore)
|
|
646
656
|
* @returns true if the data store is deleted. Otherwise, returns false.
|
|
647
657
|
*/
|
|
648
|
-
checkAndLogIfDeleted(id, context, deletedLogSuffix, callSite, requestHeaderData) {
|
|
658
|
+
checkAndLogIfDeleted(id, context, deletedLogSuffix, callSite, requestHeaderData, originalRequest) {
|
|
649
659
|
const dataStoreNodePath = `/${id}`;
|
|
650
660
|
if (!this.isDataStoreDeleted(dataStoreNodePath)) {
|
|
651
661
|
return false;
|
|
652
662
|
}
|
|
663
|
+
const idToLog = originalRequest !== undefined
|
|
664
|
+
? (0, index_js_1.urlToGCNodePath)(originalRequest.url)
|
|
665
|
+
: dataStoreNodePath;
|
|
666
|
+
// Log the package details asynchronously since getInitialSnapshotDetails is async
|
|
667
|
+
const recentelyDeletedContext = this.contexts.getRecentlyDeletedContext(id);
|
|
668
|
+
if (recentelyDeletedContext !== undefined) {
|
|
669
|
+
recentelyDeletedContext
|
|
670
|
+
.getInitialSnapshotDetails()
|
|
671
|
+
.then((details) => {
|
|
672
|
+
return details.pkg.join("/");
|
|
673
|
+
})
|
|
674
|
+
.then((pkg) => ({ pkg, error: undefined }), (error) => ({ pkg: undefined, error }))
|
|
675
|
+
.then(({ pkg, error }) => {
|
|
676
|
+
this.mc.logger.sendTelemetryEvent({
|
|
677
|
+
eventName: `GC_DeletedDataStore_PathInfo`,
|
|
678
|
+
...(0, telemetry_utils_1.tagCodeArtifacts)({
|
|
679
|
+
id: idToLog,
|
|
680
|
+
pkg,
|
|
681
|
+
}),
|
|
682
|
+
callSite,
|
|
683
|
+
}, error);
|
|
684
|
+
})
|
|
685
|
+
.catch(() => { });
|
|
686
|
+
}
|
|
653
687
|
this.mc.logger.sendErrorEvent({
|
|
654
688
|
eventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,
|
|
655
|
-
...(0, telemetry_utils_1.tagCodeArtifacts)({ id }),
|
|
689
|
+
...(0, telemetry_utils_1.tagCodeArtifacts)({ id: idToLog }),
|
|
656
690
|
callSite,
|
|
657
691
|
headers: JSON.stringify(requestHeaderData),
|
|
658
692
|
exists: context !== undefined,
|
|
693
|
+
details: {
|
|
694
|
+
url: originalRequest?.url,
|
|
695
|
+
headers: JSON.stringify(originalRequest?.headers),
|
|
696
|
+
aliased: this.aliasedDataStores.has(id),
|
|
697
|
+
},
|
|
659
698
|
});
|
|
660
699
|
return true;
|
|
661
700
|
}
|
|
@@ -856,13 +895,31 @@ class ChannelCollection {
|
|
|
856
895
|
continue;
|
|
857
896
|
}
|
|
858
897
|
const dataStoreId = pathParts[1];
|
|
859
|
-
(0, core_utils_1.assert)(this.contexts.has(dataStoreId),
|
|
898
|
+
(0, core_utils_1.assert)(this.contexts.has(dataStoreId), "updateUnusedRoutes: No data store with specified id");
|
|
860
899
|
// Delete the contexts of unused data stores.
|
|
861
900
|
this.contexts.delete(dataStoreId);
|
|
862
901
|
// Delete the summarizer node of the unused data stores.
|
|
863
902
|
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
864
903
|
}
|
|
865
904
|
}
|
|
905
|
+
deleteChild(dataStoreId) {
|
|
906
|
+
const dataStoreContext = this.contexts.get(dataStoreId);
|
|
907
|
+
(0, core_utils_1.assert)(dataStoreContext !== undefined, 0x2d7 /* No data store with specified id */);
|
|
908
|
+
if (dataStoreContext.isLoaded) {
|
|
909
|
+
this.mc.logger.sendTelemetryEvent({
|
|
910
|
+
eventName: "GC_DeletingLoadedDataStore",
|
|
911
|
+
...(0, telemetry_utils_1.tagCodeArtifacts)({
|
|
912
|
+
id: dataStoreId,
|
|
913
|
+
pkg: dataStoreContext.packagePath.join("/"),
|
|
914
|
+
}),
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
dataStoreContext.delete();
|
|
918
|
+
// Delete the contexts of sweep ready data stores.
|
|
919
|
+
this.contexts.delete(dataStoreId);
|
|
920
|
+
// Delete the summarizer node of the sweep ready data stores.
|
|
921
|
+
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
922
|
+
}
|
|
866
923
|
/**
|
|
867
924
|
* Delete data stores and its objects that are sweep ready.
|
|
868
925
|
* @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
|
|
@@ -893,11 +950,7 @@ class ChannelCollection {
|
|
|
893
950
|
});
|
|
894
951
|
continue;
|
|
895
952
|
}
|
|
896
|
-
|
|
897
|
-
// Delete the contexts of sweep ready data stores.
|
|
898
|
-
this.contexts.delete(dataStoreId);
|
|
899
|
-
// Delete the summarizer node of the sweep ready data stores.
|
|
900
|
-
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
953
|
+
this.deleteChild(dataStoreId);
|
|
901
954
|
}
|
|
902
955
|
return Array.from(sweepReadyDataStoreRoutes);
|
|
903
956
|
}
|
|
@@ -932,8 +985,9 @@ class ChannelCollection {
|
|
|
932
985
|
*/
|
|
933
986
|
async getOutboundRoutes() {
|
|
934
987
|
const outboundRoutes = [];
|
|
988
|
+
// Getting this information is a performance optimization that reduces network calls for virtualized datastores
|
|
935
989
|
for (const [contextId, context] of this.contexts) {
|
|
936
|
-
const isRootDataStore = await context.isRoot();
|
|
990
|
+
const isRootDataStore = await context.isRoot(this.aliasedDataStores);
|
|
937
991
|
if (isRootDataStore) {
|
|
938
992
|
outboundRoutes.push(`/${contextId}`);
|
|
939
993
|
}
|
|
@@ -986,21 +1040,25 @@ class ChannelCollection {
|
|
|
986
1040
|
if (typeof request.headers?.[exports.AllowInactiveRequestHeaderKey] === "boolean") {
|
|
987
1041
|
headerData.allowInactive = request.headers[exports.AllowInactiveRequestHeaderKey];
|
|
988
1042
|
}
|
|
989
|
-
// We allow Tombstone requests for sub-DataStore objects
|
|
1043
|
+
// We allow Tombstone/Inactive requests for sub-DataStore objects
|
|
990
1044
|
if (requestForChild) {
|
|
991
1045
|
headerData.allowTombstone = true;
|
|
1046
|
+
headerData.allowInactive = true;
|
|
992
1047
|
}
|
|
993
1048
|
await this.waitIfPendingAlias(id);
|
|
994
1049
|
const internalId = this.internalId(id);
|
|
995
|
-
const dataStoreContext = await this.getDataStore(internalId, headerData);
|
|
996
|
-
// Remove query params, leading and trailing slashes from the url. This is done to make sure the format is
|
|
997
|
-
// the same as GC nodes id.
|
|
998
|
-
const urlWithoutQuery = (0, index_js_1.trimLeadingAndTrailingSlashes)(request.url.split("?")[0]);
|
|
1050
|
+
const dataStoreContext = await this.getDataStore(internalId, headerData, request);
|
|
999
1051
|
// Get the initial snapshot details which contain the data store package path.
|
|
1000
1052
|
const details = await dataStoreContext.getInitialSnapshotDetails();
|
|
1001
|
-
//
|
|
1002
|
-
// is
|
|
1003
|
-
this.gcNodeUpdated(
|
|
1053
|
+
// When notifying GC of this node being loaded, we only indicate the DataStore itself, not the full subDataStore url if applicable.
|
|
1054
|
+
// This is in case the url is to a route that Fluid doesn't understand or track for GC (e.g. if suited for a custom request handler)
|
|
1055
|
+
this.gcNodeUpdated({
|
|
1056
|
+
node: { type: "DataStore", path: `/${id}` },
|
|
1057
|
+
reason: "Loaded",
|
|
1058
|
+
packagePath: details.pkg,
|
|
1059
|
+
request,
|
|
1060
|
+
headerData,
|
|
1061
|
+
});
|
|
1004
1062
|
const dataStore = await dataStoreContext.realize();
|
|
1005
1063
|
const subRequest = requestParser.createSubRequest(1);
|
|
1006
1064
|
// We always expect createSubRequest to include a leading slash, but asserting here to protect against
|