@fluidframework/container-runtime 2.0.0-rc.3.0.1 → 2.0.0-rc.3.0.10
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 +30 -12
- package/dist/channelCollection.d.ts +5 -3
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +88 -29
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +6 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +55 -48
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +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/legacy.d.ts +1 -0
- package/dist/metadata.d.ts +2 -2
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +4 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +0 -10
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +0 -4
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +7 -38
- package/dist/opLifecycle/outbox.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/summary/documentSchema.js +1 -1
- package/dist/summary/documentSchema.js.map +1 -1
- package/lib/channelCollection.d.ts +5 -3
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +90 -31
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +6 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +54 -47
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +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/legacy.d.ts +1 -0
- package/lib/metadata.d.ts +2 -2
- package/lib/metadata.d.ts.map +1 -1
- package/lib/metadata.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +4 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +0 -10
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +0 -4
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -38
- package/lib/opLifecycle/outbox.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/summary/documentSchema.js +1 -1
- package/lib/summary/documentSchema.js.map +1 -1
- package/package.json +20 -20
- package/src/channelCollection.ts +108 -49
- package/src/containerRuntime.ts +66 -80
- 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 +2 -0
- package/src/metadata.ts +2 -2
- package/src/opLifecycle/README.md +4 -4
- package/src/opLifecycle/batchManager.ts +5 -14
- package/src/opLifecycle/outbox.ts +7 -53
- package/src/packageVersion.ts +1 -1
- package/src/summary/documentSchema.ts +1 -1
- package/dist/public.d.ts +0 -12
- package/lib/public.d.ts +0 -12
|
@@ -30,7 +30,8 @@ import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
|
30
30
|
import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions/internal';
|
|
31
31
|
import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions/internal';
|
|
32
32
|
import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions/internal';
|
|
33
|
-
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions
|
|
33
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
34
|
+
import { IFluidDataStoreFactory as IFluidDataStoreFactory_2 } from '@fluidframework/runtime-definitions/internal';
|
|
34
35
|
import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
35
36
|
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
36
37
|
import { IFluidHandleContext } from '@fluidframework/core-interfaces';
|
|
@@ -50,7 +51,8 @@ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions'
|
|
|
50
51
|
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
51
52
|
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
52
53
|
import { ISummarizeResult } from '@fluidframework/runtime-definitions/internal';
|
|
53
|
-
import { ISummarizerNodeWithGC } from '@fluidframework/runtime-definitions
|
|
54
|
+
import { ISummarizerNodeWithGC } from '@fluidframework/runtime-definitions';
|
|
55
|
+
import { ISummarizerNodeWithGC as ISummarizerNodeWithGC_2 } from '@fluidframework/runtime-definitions/internal';
|
|
54
56
|
import { ISummaryAck } from '@fluidframework/protocol-definitions';
|
|
55
57
|
import { ISummaryContent } from '@fluidframework/protocol-definitions';
|
|
56
58
|
import { ISummaryNack } from '@fluidframework/protocol-definitions';
|
|
@@ -77,7 +79,7 @@ export const AllowTombstoneRequestHeaderKey = "allowTombstone";
|
|
|
77
79
|
|
|
78
80
|
// @internal
|
|
79
81
|
export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
80
|
-
constructor(baseSnapshot: ISnapshotTree | undefined, parentContext: IFluidParentContext, baseLogger: ITelemetryBaseLogger, gcNodeUpdated: (
|
|
82
|
+
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>);
|
|
81
83
|
// (undocumented)
|
|
82
84
|
get aliases(): ReadonlyMap<string, string>;
|
|
83
85
|
// (undocumented)
|
|
@@ -112,8 +114,6 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
112
114
|
// (undocumented)
|
|
113
115
|
readonly entryPoint: IFluidHandle<FluidObject>;
|
|
114
116
|
getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
115
|
-
// (undocumented)
|
|
116
|
-
getDataStore(id: string, requestHeaderData: RuntimeHeaderData): Promise<IFluidDataStoreContextInternal>;
|
|
117
117
|
getDataStoreIfAvailable(id: string, requestHeaderData: RuntimeHeaderData): Promise<IFluidDataStoreContextInternal | undefined>;
|
|
118
118
|
getDataStorePackagePath(nodePath: string): Promise<readonly string[] | undefined>;
|
|
119
119
|
getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
|
|
@@ -163,7 +163,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
// @internal (undocumented)
|
|
166
|
-
export class ChannelCollectionFactory<T extends ChannelCollection = ChannelCollection> implements
|
|
166
|
+
export class ChannelCollectionFactory<T extends ChannelCollection = ChannelCollection> implements IFluidDataStoreFactory_2 {
|
|
167
167
|
constructor(registryEntries: NamedFluidDataStoreRegistryEntries, provideEntryPoint: (runtime: IFluidDataStoreChannel) => Promise<FluidObject>, ctor: (...args: ConstructorParameters<typeof ChannelCollection>) => T);
|
|
168
168
|
// (undocumented)
|
|
169
169
|
get IFluidDataStoreFactory(): this;
|
|
@@ -386,6 +386,8 @@ export class DataStoreContexts implements Iterable<[string, FluidDataStoreContex
|
|
|
386
386
|
// (undocumented)
|
|
387
387
|
get(id: string): FluidDataStoreContext | undefined;
|
|
388
388
|
getBoundOrRemoted(id: string, wait: boolean): Promise<FluidDataStoreContext | undefined>;
|
|
389
|
+
// (undocumented)
|
|
390
|
+
getRecentlyDeletedContext(id: string): FluidDataStoreContext | undefined;
|
|
389
391
|
getUnbound(id: string): LocalFluidDataStoreContext | undefined;
|
|
390
392
|
// (undocumented)
|
|
391
393
|
has(id: string): boolean;
|
|
@@ -400,6 +402,9 @@ export class DataStoreContexts implements Iterable<[string, FluidDataStoreContex
|
|
|
400
402
|
// @alpha (undocumented)
|
|
401
403
|
export const DefaultSummaryConfiguration: ISummaryConfiguration;
|
|
402
404
|
|
|
405
|
+
// @alpha
|
|
406
|
+
export const DeletedResponseHeaderKey = "wasDeleted";
|
|
407
|
+
|
|
403
408
|
// @internal
|
|
404
409
|
export function detectOutboundReferences(address: string, contents: unknown, addedOutboundReference: (fromNodePath: string, toNodePath: string) => void): void;
|
|
405
410
|
|
|
@@ -495,7 +500,7 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
495
500
|
// @deprecated (undocumented)
|
|
496
501
|
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
497
502
|
// (undocumented)
|
|
498
|
-
getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam): (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>) =>
|
|
503
|
+
getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam): (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>) => ISummarizerNodeWithGC_2;
|
|
499
504
|
getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
|
|
500
505
|
// (undocumented)
|
|
501
506
|
abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
@@ -564,7 +569,7 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
564
569
|
submitSignal(type: string, content: unknown, targetClientId?: string): void;
|
|
565
570
|
summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummarizeResult>;
|
|
566
571
|
// (undocumented)
|
|
567
|
-
protected readonly summarizerNode:
|
|
572
|
+
protected readonly summarizerNode: ISummarizerNodeWithGC_2;
|
|
568
573
|
// (undocumented)
|
|
569
574
|
get tombstoned(): boolean;
|
|
570
575
|
updateUsedRoutes(usedRoutes: string[]): void;
|
|
@@ -591,10 +596,10 @@ export type GCFeatureMatrix = {
|
|
|
591
596
|
|
|
592
597
|
// @alpha
|
|
593
598
|
export const GCNodeType: {
|
|
594
|
-
DataStore:
|
|
595
|
-
SubDataStore:
|
|
596
|
-
Blob:
|
|
597
|
-
Other:
|
|
599
|
+
readonly DataStore: "DataStore";
|
|
600
|
+
readonly SubDataStore: "SubDataStore";
|
|
601
|
+
readonly Blob: "Blob";
|
|
602
|
+
readonly Other: "Other";
|
|
598
603
|
};
|
|
599
604
|
|
|
600
605
|
// @alpha (undocumented)
|
|
@@ -832,6 +837,19 @@ export interface IGCMetadata {
|
|
|
832
837
|
readonly tombstoneTimeoutMs?: number;
|
|
833
838
|
}
|
|
834
839
|
|
|
840
|
+
// @internal
|
|
841
|
+
export interface IGCNodeUpdatedProps {
|
|
842
|
+
headerData?: RuntimeHeaderData;
|
|
843
|
+
node: {
|
|
844
|
+
type: (typeof GCNodeType)["DataStore" | "Blob"];
|
|
845
|
+
path: string;
|
|
846
|
+
};
|
|
847
|
+
packagePath?: readonly string[];
|
|
848
|
+
reason: "Loaded" | "Changed";
|
|
849
|
+
request?: IRequest;
|
|
850
|
+
timestampMs?: number;
|
|
851
|
+
}
|
|
852
|
+
|
|
835
853
|
// @alpha (undocumented)
|
|
836
854
|
export interface IGCRuntimeOptions {
|
|
837
855
|
[key: string]: any;
|
|
@@ -11,7 +11,7 @@ import { MonitoringContext } from "@fluidframework/telemetry-utils/internal";
|
|
|
11
11
|
import { RuntimeHeaderData } from "./containerRuntime.js";
|
|
12
12
|
import { IFluidDataStoreContextInternal, ILocalDetachedFluidDataStoreContextProps, LocalFluidDataStoreContext } from "./dataStoreContext.js";
|
|
13
13
|
import { DataStoreContexts } from "./dataStoreContexts.js";
|
|
14
|
-
import { GCNodeType } from "./gc/index.js";
|
|
14
|
+
import { GCNodeType, IGCNodeUpdatedProps } from "./gc/index.js";
|
|
15
15
|
import { IContainerRuntimeMetadata } from "./summary/index.js";
|
|
16
16
|
/**
|
|
17
17
|
* Accepted header keys for requests coming to the runtime.
|
|
@@ -70,7 +70,7 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
70
70
|
private readonly pendingAliasMap;
|
|
71
71
|
protected readonly contexts: DataStoreContexts;
|
|
72
72
|
private readonly aliasedDataStores;
|
|
73
|
-
constructor(baseSnapshot: ISnapshotTree | undefined, parentContext: IFluidParentContext, baseLogger: ITelemetryBaseLogger, gcNodeUpdated: (
|
|
73
|
+
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>);
|
|
74
74
|
get aliases(): ReadonlyMap<string, string>;
|
|
75
75
|
get pendingAliases(): Map<string, Promise<AliasResult>>;
|
|
76
76
|
waitIfPendingAlias(maybeAlias: string): Promise<AliasResult>;
|
|
@@ -126,7 +126,7 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
126
126
|
private applyStashedAttachOp;
|
|
127
127
|
process(message: ISequencedDocumentMessage, local: boolean, localMessageMetadata: unknown, addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void): void;
|
|
128
128
|
protected processChannelOp(address: string, message: ISequencedDocumentMessage, local: boolean, localMessageMetadata: unknown): void;
|
|
129
|
-
getDataStore
|
|
129
|
+
private getDataStore;
|
|
130
130
|
/**
|
|
131
131
|
* Returns the data store requested with the given id if available. Otherwise, returns undefined.
|
|
132
132
|
*/
|
|
@@ -135,8 +135,10 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
135
135
|
* Checks if the data store has been deleted by GC. If so, log an error.
|
|
136
136
|
* @param id - The data store's id.
|
|
137
137
|
* @param context - The data store context.
|
|
138
|
+
* @param deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)
|
|
138
139
|
* @param callSite - The function name this is called from.
|
|
139
140
|
* @param requestHeaderData - The request header information to log if the data store is deleted.
|
|
141
|
+
* @param originalRequest - The original request (could be for a child of the DataStore)
|
|
140
142
|
* @returns true if the data store is deleted. Otherwise, returns false.
|
|
141
143
|
*/
|
|
142
144
|
private checkAndLogIfDeleted;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EACN,WAAW,EACX,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EACN,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,WAAW,EAGX,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EAGnB,kCAAkC,EAElC,MAAM,8CAA8C,CAAC;AAetD,OAAO,EAIN,iBAAiB,E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AwB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,OAAO,EACjB,sBAAsB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,GACxE,IAAI,CA+BN;AAED,gBAAgB;AAChB,qBAAa,wBAAwB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,CACpF,YAAW,sBAAsB;IAShC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAVtB,SAAgB,IAAI,8BAA8B;IAE3C,uBAAuB,EAAE,uBAAuB,CAAC;gBAGvD,eAAe,EAAE,kCAAkC,EAElC,iBAAiB,EAAE,CACnC,OAAO,EAAE,sBAAsB,KAC3B,OAAO,CAAC,WAAW,CAAC,EACR,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,iBAAiB,CAAC,KAAK,CAAC;IAKvF,IAAW,sBAAsB,SAEhC;IAEY,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,OAAO,GAChB,OAAO,CAAC,sBAAsB,CAAC;CAalC"}
|
|
@@ -12,6 +12,7 @@ const internal_3 = require("@fluidframework/driver-utils/internal");
|
|
|
12
12
|
const internal_4 = require("@fluidframework/runtime-definitions/internal");
|
|
13
13
|
const internal_5 = require("@fluidframework/runtime-utils/internal");
|
|
14
14
|
const internal_6 = require("@fluidframework/telemetry-utils/internal");
|
|
15
|
+
const uuid_1 = require("uuid");
|
|
15
16
|
const containerRuntime_js_1 = require("./containerRuntime.js");
|
|
16
17
|
const dataStore_js_1 = require("./dataStore.js");
|
|
17
18
|
const dataStoreContext_js_1 = require("./dataStoreContext.js");
|
|
@@ -382,8 +383,8 @@ class ChannelCollection {
|
|
|
382
383
|
* If the container is detached, this data store will be part of the summary that makes the container attached.
|
|
383
384
|
*/
|
|
384
385
|
if (this.parentContext.attachState !== container_definitions_1.AttachState.Detached) {
|
|
385
|
-
localContext.setAttachState(container_definitions_1.AttachState.Attaching);
|
|
386
386
|
this.submitAttachChannelOp(localContext);
|
|
387
|
+
localContext.setAttachState(container_definitions_1.AttachState.Attaching);
|
|
387
388
|
}
|
|
388
389
|
this.contexts.bind(id);
|
|
389
390
|
}
|
|
@@ -410,20 +411,28 @@ class ChannelCollection {
|
|
|
410
411
|
* Please note that above mentioned functions have the implementation they have (allowing #2) due to #1.
|
|
411
412
|
*/
|
|
412
413
|
createDataStoreId() {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (this.
|
|
419
|
-
//
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
414
|
+
/**
|
|
415
|
+
* There is currently a bug where certain data store ids such as "[" are getting converted to ASCII characters
|
|
416
|
+
* in the snapshot.
|
|
417
|
+
* So, return short ids only if explicitly enabled via feature flags. Else, return uuid();
|
|
418
|
+
*/
|
|
419
|
+
if (this.mc.config.getBoolean("Fluid.Runtime.UseShortIds") === true) {
|
|
420
|
+
// We use three non-overlapping namespaces:
|
|
421
|
+
// - detached state: even numbers
|
|
422
|
+
// - attached state: odd numbers
|
|
423
|
+
// - uuids
|
|
424
|
+
// In first two cases we will encode result as strings in more compact form.
|
|
425
|
+
if (this.parentContext.attachState === container_definitions_1.AttachState.Detached) {
|
|
426
|
+
// container is detached, only one client observes content, no way to hit collisions with other clients.
|
|
427
|
+
return (0, internal_5.encodeCompactIdToString)(2 * this.contexts.size);
|
|
428
|
+
}
|
|
429
|
+
const id = this.parentContext.containerRuntime.generateDocumentUniqueId();
|
|
430
|
+
if (typeof id === "number") {
|
|
431
|
+
return (0, internal_5.encodeCompactIdToString)(2 * id + 1);
|
|
432
|
+
}
|
|
433
|
+
return id;
|
|
425
434
|
}
|
|
426
|
-
return
|
|
435
|
+
return (0, uuid_1.v4)();
|
|
427
436
|
}
|
|
428
437
|
createDetachedDataStore(pkg, loadingGroupId) {
|
|
429
438
|
return this.createContext(this.createDataStoreId(), pkg, dataStoreContext_js_1.LocalDetachedFluidDataStoreContext, undefined, // props
|
|
@@ -609,14 +618,20 @@ class ChannelCollection {
|
|
|
609
618
|
context.process(message, local, localMessageMetadata);
|
|
610
619
|
// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is
|
|
611
620
|
// being used.
|
|
612
|
-
this.gcNodeUpdated(
|
|
621
|
+
this.gcNodeUpdated({
|
|
622
|
+
node: { type: "DataStore", path: `/${address}` },
|
|
623
|
+
reason: "Changed",
|
|
624
|
+
timestampMs: message.timestamp,
|
|
625
|
+
packagePath: context.isLoaded ? context.packagePath : undefined,
|
|
626
|
+
});
|
|
613
627
|
}
|
|
614
|
-
async getDataStore(id, requestHeaderData) {
|
|
628
|
+
async getDataStore(id, requestHeaderData, originalRequest) {
|
|
615
629
|
const headerData = { ...containerRuntime_js_1.defaultRuntimeHeaderData, ...requestHeaderData };
|
|
616
|
-
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData)) {
|
|
630
|
+
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData, originalRequest)) {
|
|
617
631
|
// The requested data store has been deleted by gc. Create a 404 response exception.
|
|
618
|
-
|
|
619
|
-
|
|
632
|
+
throw (0, internal_5.responseToException)((0, internal_5.createResponseError)(404, "DataStore was deleted", originalRequest, {
|
|
633
|
+
[containerRuntime_js_1.DeletedResponseHeaderKey]: true,
|
|
634
|
+
}), originalRequest);
|
|
620
635
|
}
|
|
621
636
|
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
|
|
622
637
|
if (context === undefined) {
|
|
@@ -645,21 +660,52 @@ class ChannelCollection {
|
|
|
645
660
|
* Checks if the data store has been deleted by GC. If so, log an error.
|
|
646
661
|
* @param id - The data store's id.
|
|
647
662
|
* @param context - The data store context.
|
|
663
|
+
* @param deletedLogSuffix - Whether it was Changed or Requested (will go into the eventName)
|
|
648
664
|
* @param callSite - The function name this is called from.
|
|
649
665
|
* @param requestHeaderData - The request header information to log if the data store is deleted.
|
|
666
|
+
* @param originalRequest - The original request (could be for a child of the DataStore)
|
|
650
667
|
* @returns true if the data store is deleted. Otherwise, returns false.
|
|
651
668
|
*/
|
|
652
|
-
checkAndLogIfDeleted(id, context, deletedLogSuffix, callSite, requestHeaderData) {
|
|
669
|
+
checkAndLogIfDeleted(id, context, deletedLogSuffix, callSite, requestHeaderData, originalRequest) {
|
|
653
670
|
const dataStoreNodePath = `/${id}`;
|
|
654
671
|
if (!this.isDataStoreDeleted(dataStoreNodePath)) {
|
|
655
672
|
return false;
|
|
656
673
|
}
|
|
674
|
+
const idToLog = originalRequest !== undefined
|
|
675
|
+
? (0, index_js_1.urlToGCNodePath)(originalRequest.url)
|
|
676
|
+
: dataStoreNodePath;
|
|
677
|
+
// Log the package details asynchronously since getInitialSnapshotDetails is async
|
|
678
|
+
const recentelyDeletedContext = this.contexts.getRecentlyDeletedContext(id);
|
|
679
|
+
if (recentelyDeletedContext !== undefined) {
|
|
680
|
+
recentelyDeletedContext
|
|
681
|
+
.getInitialSnapshotDetails()
|
|
682
|
+
.then((details) => {
|
|
683
|
+
return details.pkg.join("/");
|
|
684
|
+
})
|
|
685
|
+
.then((pkg) => ({ pkg, error: undefined }), (error) => ({ pkg: undefined, error }))
|
|
686
|
+
.then(({ pkg, error }) => {
|
|
687
|
+
this.mc.logger.sendTelemetryEvent({
|
|
688
|
+
eventName: `GC_DeletedDataStore_PathInfo`,
|
|
689
|
+
...(0, internal_6.tagCodeArtifacts)({
|
|
690
|
+
id: idToLog,
|
|
691
|
+
pkg,
|
|
692
|
+
}),
|
|
693
|
+
callSite,
|
|
694
|
+
}, error);
|
|
695
|
+
})
|
|
696
|
+
.catch(() => { });
|
|
697
|
+
}
|
|
657
698
|
this.mc.logger.sendErrorEvent({
|
|
658
699
|
eventName: `GC_Deleted_DataStore_${deletedLogSuffix}`,
|
|
659
|
-
...(0, internal_6.tagCodeArtifacts)({ id }),
|
|
700
|
+
...(0, internal_6.tagCodeArtifacts)({ id: idToLog }),
|
|
660
701
|
callSite,
|
|
661
702
|
headers: JSON.stringify(requestHeaderData),
|
|
662
703
|
exists: context !== undefined,
|
|
704
|
+
details: {
|
|
705
|
+
url: originalRequest?.url,
|
|
706
|
+
headers: JSON.stringify(originalRequest?.headers),
|
|
707
|
+
aliased: this.aliasedDataStores.has(id),
|
|
708
|
+
},
|
|
663
709
|
});
|
|
664
710
|
return true;
|
|
665
711
|
}
|
|
@@ -849,6 +895,15 @@ class ChannelCollection {
|
|
|
849
895
|
deleteChild(dataStoreId) {
|
|
850
896
|
const dataStoreContext = this.contexts.get(dataStoreId);
|
|
851
897
|
(0, internal_1.assert)(dataStoreContext !== undefined, 0x2d7 /* No data store with specified id */);
|
|
898
|
+
if (dataStoreContext.isLoaded) {
|
|
899
|
+
this.mc.logger.sendTelemetryEvent({
|
|
900
|
+
eventName: "GC_DeletingLoadedDataStore",
|
|
901
|
+
...(0, internal_6.tagCodeArtifacts)({
|
|
902
|
+
id: dataStoreId,
|
|
903
|
+
pkg: dataStoreContext.packagePath.join("/"),
|
|
904
|
+
}),
|
|
905
|
+
});
|
|
906
|
+
}
|
|
852
907
|
dataStoreContext.delete();
|
|
853
908
|
// Delete the contexts of unused data stores.
|
|
854
909
|
this.contexts.delete(dataStoreId);
|
|
@@ -975,21 +1030,25 @@ class ChannelCollection {
|
|
|
975
1030
|
if (typeof request.headers?.[exports.AllowInactiveRequestHeaderKey] === "boolean") {
|
|
976
1031
|
headerData.allowInactive = request.headers[exports.AllowInactiveRequestHeaderKey];
|
|
977
1032
|
}
|
|
978
|
-
// We allow Tombstone requests for sub-DataStore objects
|
|
1033
|
+
// We allow Tombstone/Inactive requests for sub-DataStore objects
|
|
979
1034
|
if (requestForChild) {
|
|
980
1035
|
headerData.allowTombstone = true;
|
|
1036
|
+
headerData.allowInactive = true;
|
|
981
1037
|
}
|
|
982
1038
|
await this.waitIfPendingAlias(id);
|
|
983
1039
|
const internalId = this.internalId(id);
|
|
984
|
-
const dataStoreContext = await this.getDataStore(internalId, headerData);
|
|
985
|
-
// Remove query params, leading and trailing slashes from the url. This is done to make sure the format is
|
|
986
|
-
// the same as GC nodes id.
|
|
987
|
-
const urlWithoutQuery = (0, index_js_1.trimLeadingAndTrailingSlashes)(request.url.split("?")[0]);
|
|
1040
|
+
const dataStoreContext = await this.getDataStore(internalId, headerData, request);
|
|
988
1041
|
// Get the initial snapshot details which contain the data store package path.
|
|
989
1042
|
const details = await dataStoreContext.getInitialSnapshotDetails();
|
|
990
|
-
//
|
|
991
|
-
// is
|
|
992
|
-
this.gcNodeUpdated(
|
|
1043
|
+
// When notifying GC of this node being loaded, we only indicate the DataStore itself, not the full subDataStore url if applicable.
|
|
1044
|
+
// 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)
|
|
1045
|
+
this.gcNodeUpdated({
|
|
1046
|
+
node: { type: "DataStore", path: `/${id}` },
|
|
1047
|
+
reason: "Loaded",
|
|
1048
|
+
packagePath: details.pkg,
|
|
1049
|
+
request,
|
|
1050
|
+
headerData,
|
|
1051
|
+
});
|
|
993
1052
|
const dataStore = await dataStoreContext.realize();
|
|
994
1053
|
const subRequest = requestParser.createSubRequest(1);
|
|
995
1054
|
// We always expect createSubRequest to include a leading slash, but asserting here to protect against
|