@fluidframework/container-runtime 2.33.2 → 2.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/api-report/container-runtime.legacy.alpha.api.md +4 -0
- package/container-runtime.test-files.tar +0 -0
- package/dist/blobManager/blobManager.d.ts +31 -8
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +90 -17
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +26 -10
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +42 -11
- package/dist/channelCollection.js.map +1 -1
- package/dist/compatUtils.d.ts +19 -10
- package/dist/compatUtils.d.ts.map +1 -1
- package/dist/compatUtils.js +39 -32
- package/dist/compatUtils.js.map +1 -1
- package/dist/containerRuntime.d.ts +29 -13
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +139 -149
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +15 -16
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +37 -19
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -9
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -0
- package/dist/opLifecycle/index.d.ts +1 -1
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +20 -7
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +16 -20
- package/dist/opLifecycle/outbox.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/pendingStateManager.d.ts +22 -8
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +11 -16
- package/dist/pendingStateManager.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +31 -8
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +91 -18
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +26 -10
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +43 -12
- package/lib/channelCollection.js.map +1 -1
- package/lib/compatUtils.d.ts +19 -10
- package/lib/compatUtils.d.ts.map +1 -1
- package/lib/compatUtils.js +36 -29
- package/lib/compatUtils.js.map +1 -1
- package/lib/containerRuntime.d.ts +29 -13
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +60 -70
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +15 -16
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +38 -20
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/index.d.ts +1 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -0
- package/lib/opLifecycle/index.d.ts +1 -1
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +20 -7
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +16 -20
- package/lib/opLifecycle/outbox.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/pendingStateManager.d.ts +22 -8
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +11 -16
- package/lib/pendingStateManager.js.map +1 -1
- package/package.json +18 -18
- package/src/blobManager/blobManager.ts +141 -33
- package/src/channelCollection.ts +77 -19
- package/src/compatUtils.ts +53 -30
- package/src/containerRuntime.ts +102 -81
- package/src/dataStoreContext.ts +48 -38
- package/src/index.ts +1 -13
- package/src/opLifecycle/index.ts +1 -0
- package/src/opLifecycle/outbox.ts +42 -33
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +37 -20
|
@@ -10,12 +10,10 @@ import { type IFluidHandleContext, type IFluidHandleInternal, type ITelemetryBas
|
|
|
10
10
|
import { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
|
|
11
11
|
import { IDocumentStorageService, type ISnapshot, IDocumentMessage, ISnapshotTree, ITreeEntry, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
12
12
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
13
|
-
import { ISummaryTreeWithStats, ITelemetryContext, IGarbageCollectionData, CreateChildSummarizerNodeFn, CreateChildSummarizerNodeParam, IContainerRuntimeBase, IDataStore, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreRegistry,
|
|
13
|
+
import { ISummaryTreeWithStats, ITelemetryContext, IGarbageCollectionData, CreateChildSummarizerNodeFn, CreateChildSummarizerNodeParam, IContainerRuntimeBase, IDataStore, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IGarbageCollectionDetailsBase, IProvideFluidDataStoreFactory, ISummarizeResult, ISummarizerNodeWithGC, SummarizeInternalFn, IInboundSignalMessage, type IRuntimeMessageCollection, type IFluidDataStoreFactory, type IFluidParentContext } from "@fluidframework/runtime-definitions/internal";
|
|
14
14
|
import { MonitoringContext } from "@fluidframework/telemetry-utils/internal";
|
|
15
|
+
import type { IFluidParentContextPrivate } from "./channelCollection.js";
|
|
15
16
|
export declare function createAttributesBlob(pkg: readonly string[], isRootDataStore: boolean): ITreeEntry;
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
17
|
export interface ISnapshotDetails {
|
|
20
18
|
pkg: readonly string[];
|
|
21
19
|
isRootDataStore: boolean;
|
|
@@ -26,7 +24,6 @@ export interface ISnapshotDetails {
|
|
|
26
24
|
* This is interface that every context should implement.
|
|
27
25
|
* This interface is used for context's parent - ChannelCollection.
|
|
28
26
|
* It should not be exposed to any other users of context.
|
|
29
|
-
* @internal
|
|
30
27
|
*/
|
|
31
28
|
export interface IFluidDataStoreContextInternal extends IFluidDataStoreContext {
|
|
32
29
|
getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
@@ -37,11 +34,10 @@ export interface IFluidDataStoreContextInternal extends IFluidDataStoreContext {
|
|
|
37
34
|
}
|
|
38
35
|
/**
|
|
39
36
|
* Properties necessary for creating a FluidDataStoreContext
|
|
40
|
-
* @internal
|
|
41
37
|
*/
|
|
42
38
|
export interface IFluidDataStoreContextProps {
|
|
43
39
|
readonly id: string;
|
|
44
|
-
readonly parentContext:
|
|
40
|
+
readonly parentContext: IFluidParentContextPrivate;
|
|
45
41
|
readonly storage: IDocumentStorageService;
|
|
46
42
|
readonly scope: FluidObject;
|
|
47
43
|
readonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;
|
|
@@ -50,7 +46,6 @@ export interface IFluidDataStoreContextProps {
|
|
|
50
46
|
}
|
|
51
47
|
/**
|
|
52
48
|
* Properties necessary for creating a local FluidDataStoreContext
|
|
53
|
-
* @internal
|
|
54
49
|
*/
|
|
55
50
|
export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
56
51
|
readonly pkg: Readonly<string[]> | undefined;
|
|
@@ -59,27 +54,23 @@ export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContext
|
|
|
59
54
|
}
|
|
60
55
|
/**
|
|
61
56
|
* Properties necessary for creating a local FluidDataStoreContext
|
|
62
|
-
* @internal
|
|
63
57
|
*/
|
|
64
58
|
export interface ILocalDetachedFluidDataStoreContextProps extends ILocalFluidDataStoreContextProps {
|
|
65
59
|
readonly channelToDataStoreFn: (channel: IFluidDataStoreChannel) => IDataStore;
|
|
66
60
|
}
|
|
67
61
|
/**
|
|
68
62
|
* Properties necessary for creating a remote FluidDataStoreContext
|
|
69
|
-
* @internal
|
|
70
63
|
*/
|
|
71
64
|
export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
72
65
|
readonly snapshot: ISnapshotTree | ISnapshot | undefined;
|
|
73
66
|
}
|
|
74
67
|
/**
|
|
75
|
-
* @internal
|
|
76
68
|
*/
|
|
77
69
|
export interface IFluidDataStoreContextEvents extends IEvent {
|
|
78
70
|
(event: "attaching" | "attached", listener: () => void): any;
|
|
79
71
|
}
|
|
80
72
|
/**
|
|
81
73
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
82
|
-
* @internal
|
|
83
74
|
*/
|
|
84
75
|
export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidDataStoreContextEvents> implements IFluidDataStoreContextInternal, IFluidParentContext, IDisposable {
|
|
85
76
|
private readonly existing;
|
|
@@ -92,6 +83,7 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
92
83
|
get baseLogger(): ITelemetryBaseLogger;
|
|
93
84
|
private readonly _contextDeltaManagerProxy;
|
|
94
85
|
get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
86
|
+
private isStagingMode;
|
|
95
87
|
isReadOnly: () => boolean;
|
|
96
88
|
get connected(): boolean;
|
|
97
89
|
get IFluidHandleContext(): IFluidHandleContext;
|
|
@@ -198,7 +190,14 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
198
190
|
* its new client ID when we are connecting or connected.
|
|
199
191
|
*/
|
|
200
192
|
setConnectionState(connected: boolean, clientId?: string): void;
|
|
201
|
-
notifyReadOnlyState(
|
|
193
|
+
notifyReadOnlyState(): void;
|
|
194
|
+
/**
|
|
195
|
+
* Updates the readonly state of the data store based on the staging mode.
|
|
196
|
+
*
|
|
197
|
+
* @param staging - A boolean indicating whether the container is in staging mode.
|
|
198
|
+
* If true, the data store is set to readonly unless explicitly allowed by its policies.
|
|
199
|
+
*/
|
|
200
|
+
notifyStagingMode(staging: boolean): void;
|
|
202
201
|
/**
|
|
203
202
|
* Process messages for this data store. The messages here are contiguous messages for this data store in a batch.
|
|
204
203
|
* @param messageCollection - The collection of messages to process.
|
|
@@ -291,16 +290,16 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
291
290
|
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
292
291
|
*/
|
|
293
292
|
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
294
|
-
reSubmit(type: string, contents: unknown, localOpMetadata: unknown): void;
|
|
293
|
+
reSubmit(type: string, contents: unknown, localOpMetadata: unknown, squash: boolean): void;
|
|
295
294
|
rollback(type: string, contents: unknown, localOpMetadata: unknown): void;
|
|
296
295
|
applyStashedOp(contents: unknown): Promise<unknown>;
|
|
297
296
|
private verifyNotClosed;
|
|
298
297
|
/**
|
|
299
|
-
*
|
|
298
|
+
* Readonly client, including summarizer, should not have local changes. These changes can become part of the summary and can break
|
|
300
299
|
* eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
|
|
301
300
|
* other clients that are up-to-date till seq# 100 may not have them yet.
|
|
302
301
|
*/
|
|
303
|
-
protected
|
|
302
|
+
protected identifyLocalChangeIfReadonly(eventName: string, type?: string): void;
|
|
304
303
|
getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam): (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>) => ISummarizerNodeWithGC;
|
|
305
304
|
deleteChildSummarizerNode(id: string): void;
|
|
306
305
|
uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandleInternal<ArrayBufferLike>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE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;;;;OAMG;IACI,MAAM,IAAI,IAAI;CAQrB;AAED;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,8BAA8B;gBACjE,KAAK,EAAE,gCAAgC;CAGnD;AAED;;;;;GAKG;AACH,qBAAa,kCACZ,SAAQ,8BACR,YAAW,8BAA8B;gBAE7B,KAAK,EAAE,wCAAwC;IAK3D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAkD;IAE1E,aAAa,CACzB,QAAQ,EAAE,6BAA6B,EACvC,gBAAgB,EAAE,sBAAsB,GACtC,OAAO,CAAC,UAAU,CAAC;IAiCtB;;;;;;;;;;OAUG;IACI,wBAAwB,CAAC,OAAO,EAAE,sBAAsB,GAAG,UAAU;IAO/D,yBAAyB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAQnE"}
|
package/dist/dataStoreContext.js
CHANGED
|
@@ -64,19 +64,18 @@ class ContextDeltaManagerProxy extends deltaManagerProxies_js_1.BaseDeltaManager
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
* Called by the owning datastore context to
|
|
68
|
-
*
|
|
67
|
+
* Called by the owning datastore context to emit the readonly
|
|
68
|
+
* event on the delta manger that is projected down to the datastore
|
|
69
69
|
* runtime. This state may not align with that of the true delta
|
|
70
70
|
* manager if the context wishes to control the read only state
|
|
71
71
|
* differently than the delta manager itself.
|
|
72
72
|
*/
|
|
73
|
-
|
|
74
|
-
this.emit("readonly",
|
|
73
|
+
emitReadonly() {
|
|
74
|
+
this.emit("readonly", this.isReadOnly());
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
79
|
-
* @internal
|
|
80
79
|
*/
|
|
81
80
|
class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
|
|
82
81
|
get packagePath() {
|
|
@@ -177,7 +176,9 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
|
|
|
177
176
|
this.existing = existing;
|
|
178
177
|
this.isLocalDataStore = isLocalDataStore;
|
|
179
178
|
this.makeLocallyVisibleFn = makeLocallyVisibleFn;
|
|
180
|
-
this.
|
|
179
|
+
this.isStagingMode = false;
|
|
180
|
+
this.isReadOnly = () => (this.isStagingMode && this.channel?.policies?.readonlyInStagingMode !== false) ||
|
|
181
|
+
this.parentContext.isReadOnly();
|
|
181
182
|
this._disposed = false;
|
|
182
183
|
/**
|
|
183
184
|
* A Tombstoned object has been unreferenced long enough that GC knows it won't be referenced again.
|
|
@@ -376,10 +377,26 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
|
|
|
376
377
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
377
378
|
this.channel.setConnectionState(connected, clientId);
|
|
378
379
|
}
|
|
379
|
-
notifyReadOnlyState(
|
|
380
|
+
notifyReadOnlyState() {
|
|
380
381
|
this.verifyNotClosed("notifyReadOnlyState", false /* checkTombstone */);
|
|
381
|
-
|
|
382
|
-
this.
|
|
382
|
+
// These two calls achieve the same purpose, and are both needed for a time for back compat
|
|
383
|
+
this.channel?.notifyReadOnlyState?.(this.isReadOnly());
|
|
384
|
+
this._contextDeltaManagerProxy.emitReadonly();
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Updates the readonly state of the data store based on the staging mode.
|
|
388
|
+
*
|
|
389
|
+
* @param staging - A boolean indicating whether the container is in staging mode.
|
|
390
|
+
* If true, the data store is set to readonly unless explicitly allowed by its policies.
|
|
391
|
+
*/
|
|
392
|
+
notifyStagingMode(staging) {
|
|
393
|
+
// If the `readonlyInStagingMode` policy is not explicitly set to `false`,
|
|
394
|
+
// the data store is treated as readonly in staging mode.
|
|
395
|
+
const oldReadOnlyState = this.isReadOnly();
|
|
396
|
+
this.isStagingMode = staging;
|
|
397
|
+
if (this.isReadOnly() !== oldReadOnlyState) {
|
|
398
|
+
this.notifyReadOnlyState();
|
|
399
|
+
}
|
|
383
400
|
}
|
|
384
401
|
/**
|
|
385
402
|
* Process messages for this data store. The messages here are contiguous messages for this data store in a batch.
|
|
@@ -516,8 +533,8 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
|
|
|
516
533
|
submitMessage(type, content, localOpMetadata) {
|
|
517
534
|
this.verifyNotClosed("submitMessage");
|
|
518
535
|
(0, internal_2.assert)(!!this.channel, 0x146 /* "Channel must exist when submitting message" */);
|
|
519
|
-
//
|
|
520
|
-
this.
|
|
536
|
+
// Readonly clients should not submit messages.
|
|
537
|
+
this.identifyLocalChangeIfReadonly("DataStoreMessageWhileReadonly", type);
|
|
521
538
|
this.parentContext.submitMessage(type, content, localOpMetadata);
|
|
522
539
|
}
|
|
523
540
|
/**
|
|
@@ -621,9 +638,9 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
|
|
|
621
638
|
async getBaseGCDetails() {
|
|
622
639
|
return {};
|
|
623
640
|
}
|
|
624
|
-
reSubmit(type, contents, localOpMetadata) {
|
|
641
|
+
reSubmit(type, contents, localOpMetadata, squash) {
|
|
625
642
|
(0, internal_2.assert)(!!this.channel, 0x14b /* "Channel must exist when resubmitting ops" */);
|
|
626
|
-
this.channel.reSubmit(type, contents, localOpMetadata);
|
|
643
|
+
this.channel.reSubmit(type, contents, localOpMetadata, squash);
|
|
627
644
|
}
|
|
628
645
|
rollback(type, contents, localOpMetadata) {
|
|
629
646
|
if (!this.channel) {
|
|
@@ -665,16 +682,15 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
|
|
|
665
682
|
}
|
|
666
683
|
}
|
|
667
684
|
/**
|
|
668
|
-
*
|
|
685
|
+
* Readonly client, including summarizer, should not have local changes. These changes can become part of the summary and can break
|
|
669
686
|
* eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
|
|
670
687
|
* other clients that are up-to-date till seq# 100 may not have them yet.
|
|
671
688
|
*/
|
|
672
|
-
|
|
673
|
-
if (this.
|
|
674
|
-
this.localChangesTelemetryCount <= 0) {
|
|
689
|
+
identifyLocalChangeIfReadonly(eventName, type) {
|
|
690
|
+
if (!this.isReadOnly() || this.localChangesTelemetryCount <= 0) {
|
|
675
691
|
return;
|
|
676
692
|
}
|
|
677
|
-
// Log a telemetry if there are local changes in
|
|
693
|
+
// Log a telemetry if there are local changes in readonly. This will give us data on how often
|
|
678
694
|
// this is happening and which data stores do this. The eventual goal is to disallow local changes
|
|
679
695
|
// in the summarizer and the data will help us plan this.
|
|
680
696
|
this.mc.logger.sendTelemetryEvent({
|
|
@@ -682,6 +698,8 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
|
|
|
682
698
|
type,
|
|
683
699
|
isSummaryInProgress: this.summarizerNode.isSummaryInProgress?.(),
|
|
684
700
|
stack: (0, internal_6.generateStack)(30),
|
|
701
|
+
readonly: this.isReadOnly(),
|
|
702
|
+
isStagingMode: this.isStagingMode,
|
|
685
703
|
});
|
|
686
704
|
this.localChangesTelemetryCount--;
|
|
687
705
|
}
|
|
@@ -848,7 +866,7 @@ class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
848
866
|
};
|
|
849
867
|
});
|
|
850
868
|
// Summarizer client should not create local data stores.
|
|
851
|
-
this.
|
|
869
|
+
this.identifyLocalChangeIfReadonly("DataStoreCreatedWhileReadonly");
|
|
852
870
|
this.snapshotTree = props.snapshotTree;
|
|
853
871
|
}
|
|
854
872
|
setAttachState(attachState) {
|