@fluidframework/container-runtime 2.0.0-internal.7.1.1 → 2.0.0-internal.7.2.1
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 +4 -0
- package/api-extractor.json +1 -13
- package/api-report/container-runtime.api.md +72 -9
- package/dist/blobManager.d.ts +3 -3
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +41 -49
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +65 -19
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +52 -29
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +2 -2
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +8 -2
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +14 -3
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +3 -0
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +3 -0
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerProxyBase.d.ts +1 -1
- package/dist/deltaManagerProxyBase.d.ts.map +1 -1
- package/dist/deltaManagerProxyBase.js +2 -2
- package/dist/deltaManagerProxyBase.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 +4 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
- package/dist/gc/gcSummaryDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +4 -4
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/id-compressor/utilities.d.ts +3 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -1
- package/dist/id-compressor/utilities.js +3 -0
- package/dist/id-compressor/utilities.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +4 -1
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +3 -0
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +3 -0
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.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/summary/orderedClientElection.d.ts +4 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +1 -0
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +1 -0
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +94 -10
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +16 -0
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +1 -0
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +10 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/lib/blobManager.d.ts +3 -3
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +42 -50
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +65 -19
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +52 -29
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +2 -2
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +8 -2
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +14 -3
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +3 -0
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +3 -0
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerProxyBase.d.ts +1 -1
- package/lib/deltaManagerProxyBase.d.ts.map +1 -1
- package/lib/deltaManagerProxyBase.js +2 -2
- package/lib/deltaManagerProxyBase.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 +4 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +4 -4
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/id-compressor/utilities.d.ts +3 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -1
- package/lib/id-compressor/utilities.js +3 -0
- package/lib/id-compressor/utilities.js.map +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +4 -1
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +3 -0
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +3 -0
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.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/summary/orderedClientElection.d.ts +4 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +1 -0
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +1 -0
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +94 -10
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +16 -0
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +1 -0
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +10 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/package.json +19 -20
- package/src/blobManager.ts +58 -59
- package/src/containerRuntime.ts +79 -39
- package/src/dataStore.ts +2 -2
- package/src/dataStoreContext.ts +14 -3
- package/src/dataStoreRegistry.ts +3 -0
- package/src/deltaManagerProxyBase.ts +2 -2
- package/src/gc/gcDefinitions.ts +27 -5
- package/src/gc/gcSummaryDefinitions.ts +1 -1
- package/src/gc/gcTelemetry.ts +5 -4
- package/src/id-compressor/utilities.ts +3 -0
- package/src/index.ts +13 -1
- package/src/messageTypes.ts +4 -1
- package/src/opLifecycle/definitions.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/src/summary/orderedClientElection.ts +4 -1
- package/src/summary/runWhileConnectedCoordinator.ts +5 -1
- package/src/summary/summarizer.ts +1 -0
- package/src/summary/summarizerTypes.ts +95 -11
- package/src/summary/summaryCollection.ts +18 -1
- package/src/summary/summaryFormat.ts +11 -1
- package/dist/container-runtime-alpha.d.ts +0 -1554
- package/dist/container-runtime-beta.d.ts +0 -1554
- package/dist/container-runtime-public.d.ts +0 -1554
- package/dist/container-runtime.d.ts +0 -1611
- package/src/gc/gcEarlyAdoption.md +0 -145
package/CHANGELOG.md
CHANGED
package/api-extractor.json
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "@fluidframework/build-common/api-extractor-base.json"
|
|
4
|
-
|
|
5
|
-
// TODO: Fix violations and remove these rule overrides
|
|
6
|
-
"messages": {
|
|
7
|
-
"extractorMessageReporting": {
|
|
8
|
-
"ae-missing-release-tag": {
|
|
9
|
-
"logLevel": "none"
|
|
10
|
-
},
|
|
11
|
-
"ae-forgotten-export": {
|
|
12
|
-
"logLevel": "none"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-base.json"
|
|
16
4
|
}
|
|
@@ -28,6 +28,7 @@ import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
|
28
28
|
import { IFluidHandleContext } from '@fluidframework/core-interfaces';
|
|
29
29
|
import { IFluidRouter } from '@fluidframework/core-interfaces';
|
|
30
30
|
import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
|
|
31
|
+
import { IGetPendingLocalStateProps } from '@fluidframework/container-definitions';
|
|
31
32
|
import { IIdCompressor } from '@fluidframework/runtime-definitions';
|
|
32
33
|
import { IIdCompressorCore } from '@fluidframework/runtime-definitions';
|
|
33
34
|
import { ILoader } from '@fluidframework/container-definitions';
|
|
@@ -154,9 +155,7 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents
|
|
|
154
155
|
getGCNodePackagePath(nodePath: string): Promise<readonly string[] | undefined>;
|
|
155
156
|
getNodeType(nodePath: string): GCNodeType;
|
|
156
157
|
// (undocumented)
|
|
157
|
-
getPendingLocalState(props?:
|
|
158
|
-
notifyImminentClosure: boolean;
|
|
159
|
-
}): Promise<unknown>;
|
|
158
|
+
getPendingLocalState(props?: IGetPendingLocalStateProps): Promise<unknown>;
|
|
160
159
|
// (undocumented)
|
|
161
160
|
getQuorum(): IQuorumClients;
|
|
162
161
|
// @deprecated
|
|
@@ -212,9 +211,8 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents
|
|
|
212
211
|
submitDataStoreAliasOp(contents: any, localOpMetadata: unknown): void;
|
|
213
212
|
// (undocumented)
|
|
214
213
|
submitDataStoreOp(id: string, contents: any, localOpMetadata?: unknown): void;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
submitSignal(type: string, content: any): void;
|
|
214
|
+
submitDataStoreSignal(address: string, type: string, content: any, targetClientId?: string): void;
|
|
215
|
+
submitSignal(type: string, content: any, targetClientId?: string): void;
|
|
218
216
|
submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
|
|
219
217
|
summarize(options: {
|
|
220
218
|
fullTree?: boolean;
|
|
@@ -265,6 +263,26 @@ export class FluidDataStoreRegistry implements IFluidDataStoreRegistry {
|
|
|
265
263
|
get IFluidDataStoreRegistry(): this;
|
|
266
264
|
}
|
|
267
265
|
|
|
266
|
+
// @public (undocumented)
|
|
267
|
+
export interface GCFeatureMatrix {
|
|
268
|
+
sweepGeneration?: number;
|
|
269
|
+
tombstoneGeneration?: number;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// @public
|
|
273
|
+
export const GCNodeType: {
|
|
274
|
+
DataStore: string;
|
|
275
|
+
SubDataStore: string;
|
|
276
|
+
Blob: string;
|
|
277
|
+
Other: string;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// @public (undocumented)
|
|
281
|
+
export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
|
|
282
|
+
|
|
283
|
+
// @public (undocumented)
|
|
284
|
+
export type GCVersion = number;
|
|
285
|
+
|
|
268
286
|
// @public
|
|
269
287
|
export function generateStableId(): StableId;
|
|
270
288
|
|
|
@@ -294,6 +312,14 @@ export interface IBaseSummarizeResult {
|
|
|
294
312
|
readonly stage: "base";
|
|
295
313
|
}
|
|
296
314
|
|
|
315
|
+
// @public
|
|
316
|
+
export interface IBlobManagerLoadInfo {
|
|
317
|
+
// (undocumented)
|
|
318
|
+
ids?: string[];
|
|
319
|
+
// (undocumented)
|
|
320
|
+
redirectTable?: [string, string][];
|
|
321
|
+
}
|
|
322
|
+
|
|
297
323
|
// @public (undocumented)
|
|
298
324
|
export interface IBroadcastSummaryResult {
|
|
299
325
|
// (undocumented)
|
|
@@ -302,7 +328,7 @@ export interface IBroadcastSummaryResult {
|
|
|
302
328
|
readonly summarizeOp: ISummaryOpMessage;
|
|
303
329
|
}
|
|
304
330
|
|
|
305
|
-
// @public
|
|
331
|
+
// @public
|
|
306
332
|
export interface ICancellableSummarizerController extends ISummaryCancellationToken {
|
|
307
333
|
// (undocumented)
|
|
308
334
|
stop(reason: SummarizerStopReason): void;
|
|
@@ -361,6 +387,17 @@ export interface IContainerRuntimeMessageCompatDetails {
|
|
|
361
387
|
behavior: CompatModeBehavior;
|
|
362
388
|
}
|
|
363
389
|
|
|
390
|
+
// @public (undocumented)
|
|
391
|
+
export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {
|
|
392
|
+
readonly disableIsolatedChannels?: true;
|
|
393
|
+
readonly idCompressorEnabled?: boolean;
|
|
394
|
+
readonly message: ISummaryMetadataMessage | undefined;
|
|
395
|
+
// (undocumented)
|
|
396
|
+
readonly summaryFormatVersion: 1;
|
|
397
|
+
readonly summaryNumber?: number;
|
|
398
|
+
readonly telemetryDocumentId?: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
364
401
|
// @public
|
|
365
402
|
export interface IContainerRuntimeOptions {
|
|
366
403
|
readonly chunkSizeInBytes?: number;
|
|
@@ -377,12 +414,28 @@ export interface IContainerRuntimeOptions {
|
|
|
377
414
|
readonly summaryOptions?: ISummaryRuntimeOptions;
|
|
378
415
|
}
|
|
379
416
|
|
|
417
|
+
// @public (undocumented)
|
|
418
|
+
export interface ICreateContainerMetadata {
|
|
419
|
+
createContainerRuntimeVersion?: string;
|
|
420
|
+
createContainerTimestamp?: number;
|
|
421
|
+
}
|
|
422
|
+
|
|
380
423
|
// @public
|
|
381
424
|
export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
|
|
382
425
|
readonly afterSequenceNumber?: number;
|
|
383
426
|
readonly override?: boolean;
|
|
384
427
|
}
|
|
385
428
|
|
|
429
|
+
// @public (undocumented)
|
|
430
|
+
export interface IGCMetadata {
|
|
431
|
+
readonly gcFeature?: GCVersion;
|
|
432
|
+
readonly gcFeatureMatrix?: GCFeatureMatrix;
|
|
433
|
+
readonly sessionExpiryTimeoutMs?: number;
|
|
434
|
+
// @deprecated
|
|
435
|
+
readonly sweepEnabled?: boolean;
|
|
436
|
+
readonly sweepTimeoutMs?: number;
|
|
437
|
+
}
|
|
438
|
+
|
|
386
439
|
// @public (undocumented)
|
|
387
440
|
export interface IGCRuntimeOptions {
|
|
388
441
|
[key: string]: any;
|
|
@@ -455,6 +508,13 @@ export interface IRetriableFailureResult {
|
|
|
455
508
|
readonly retryAfterSeconds?: number;
|
|
456
509
|
}
|
|
457
510
|
|
|
511
|
+
// @public
|
|
512
|
+
export interface ISerializedElection {
|
|
513
|
+
readonly electedClientId: string | undefined;
|
|
514
|
+
readonly electedParentId: string | undefined;
|
|
515
|
+
readonly electionSequenceNumber: number;
|
|
516
|
+
}
|
|
517
|
+
|
|
458
518
|
// @public @deprecated (undocumented)
|
|
459
519
|
export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean;
|
|
460
520
|
|
|
@@ -579,7 +639,7 @@ export interface ISummaryBaseConfiguration {
|
|
|
579
639
|
maxOpsSinceLastSummary: number;
|
|
580
640
|
}
|
|
581
641
|
|
|
582
|
-
// @public
|
|
642
|
+
// @public
|
|
583
643
|
export type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
|
|
584
644
|
|
|
585
645
|
// @public (undocumented)
|
|
@@ -617,6 +677,9 @@ export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfigurati
|
|
|
617
677
|
state: "enabled";
|
|
618
678
|
}
|
|
619
679
|
|
|
680
|
+
// @public
|
|
681
|
+
export type ISummaryMetadataMessage = Pick<ISequencedDocumentMessage, "clientId" | "clientSequenceNumber" | "minimumSequenceNumber" | "referenceSequenceNumber" | "sequenceNumber" | "timestamp" | "type">;
|
|
682
|
+
|
|
620
683
|
// @public
|
|
621
684
|
export interface ISummaryNackMessage extends ISequencedDocumentMessage {
|
|
622
685
|
// (undocumented)
|
|
@@ -786,7 +849,7 @@ export class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEve
|
|
|
786
849
|
// @public
|
|
787
850
|
export type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
|
|
788
851
|
|
|
789
|
-
// @
|
|
852
|
+
// @internal
|
|
790
853
|
export function TEST_requestSummarizer(loader: ILoader, url: string): Promise<ISummarizer>;
|
|
791
854
|
|
|
792
855
|
// @public
|
package/dist/blobManager.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare class BlobHandle implements IFluidHandle<ArrayBufferLike> {
|
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Information from a snapshot needed to load BlobManager
|
|
34
|
+
* @public
|
|
34
35
|
*/
|
|
35
36
|
export interface IBlobManagerLoadInfo {
|
|
36
37
|
ids?: string[];
|
|
@@ -78,13 +79,13 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
78
79
|
* because we know that the server will not delete the blob corresponding to that storage ID.
|
|
79
80
|
*/
|
|
80
81
|
private readonly opsInFlight;
|
|
81
|
-
private readonly retryThrottler;
|
|
82
82
|
/**
|
|
83
83
|
* This stores IDs of tombstoned blobs.
|
|
84
84
|
* Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.
|
|
85
85
|
*/
|
|
86
86
|
private readonly tombstonedBlobs;
|
|
87
87
|
private readonly sendBlobAttachOp;
|
|
88
|
+
private stopAttaching;
|
|
88
89
|
constructor(routeContext: IFluidHandleContext, snapshot: IBlobManagerLoadInfo, getStorage: () => IDocumentStorageService,
|
|
89
90
|
/**
|
|
90
91
|
* Submit a BlobAttach op. When a blob is uploaded, there is a short grace period before which the blob is
|
|
@@ -123,7 +124,6 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
123
124
|
private deletePendingBlobMaybe;
|
|
124
125
|
private deletePendingBlob;
|
|
125
126
|
private onUploadResolve;
|
|
126
|
-
private onUploadReject;
|
|
127
127
|
/**
|
|
128
128
|
* Resubmit a BlobAttach op. Used to add storage IDs to ops that were
|
|
129
129
|
* submitted to runtime while disconnected.
|
|
@@ -186,6 +186,6 @@ export declare class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
|
|
|
186
186
|
*/
|
|
187
187
|
private verifyBlobNotDeleted;
|
|
188
188
|
setRedirectTable(table: Map<string, string>): void;
|
|
189
|
-
attachAndGetPendingBlobs(): Promise<IPendingBlobs | undefined>;
|
|
189
|
+
attachAndGetPendingBlobs(stopBlobAttachingSignal?: AbortSignal): Promise<IPendingBlobs | undefined>;
|
|
190
190
|
}
|
|
191
191
|
//# sourceMappingURL=blobManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobManager.d.ts","sourceRoot":"","sources":["../src/blobManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAEN,yBAAyB,EACzB,aAAa,EACb,MAAM,sCAAsC,CAAC;AAQ9C,OAAO,EAAkC,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjG,OAAO,EACN,iBAAiB,EACjB,uBAAuB,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AO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO;IAuD7E;;;;;OAKG;WACiB,IAAI,CACvB,SAAS,EAAE,aAAa,GAAG,SAAS,EACpC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GACvD,OAAO,CAAC,oBAAoB,CAAC;IAehC;;OAEG;IACH,OAAO,CAAC,IAAI;IAgBL,SAAS,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,GAAG,qBAAqB;IA2B7E;;;;;OAKG;IACI,SAAS,CAAC,MAAM,GAAE,OAAe,GAAG,sBAAsB;IAejE;;;OAGG;IACI,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAIvD;;;;;OAKG;IACI,qBAAqB,CAAC,oBAAoB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAUtE;;;;;;;;;;OAUG;IACH,OAAO,CAAC,4BAA4B;IAwCpC;;;;OAIG;IACI,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,EAAE;IAsBxD;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAqBrB,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAoBrC,wBAAwB,CACpC,uBAAuB,CAAC,EAAE,WAAW,GACnC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAqErC"}
|
package/dist/blobManager.js
CHANGED
|
@@ -11,8 +11,8 @@ const core_utils_1 = require("@fluidframework/core-utils");
|
|
|
11
11
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
12
12
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
13
13
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
14
|
+
const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
14
15
|
const gc_1 = require("./gc");
|
|
15
|
-
const throttler_1 = require("./throttler");
|
|
16
16
|
/**
|
|
17
17
|
* This class represents blob (long string)
|
|
18
18
|
* This object is used only when creating (writing) new blob and serialization purposes.
|
|
@@ -46,22 +46,6 @@ class BlobHandle {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
exports.BlobHandle = BlobHandle;
|
|
49
|
-
class CancellableThrottler {
|
|
50
|
-
constructor(throttler) {
|
|
51
|
-
this.throttler = throttler;
|
|
52
|
-
this.cancelP = new core_utils_1.Deferred();
|
|
53
|
-
}
|
|
54
|
-
async getDelay() {
|
|
55
|
-
return Promise.race([
|
|
56
|
-
this.cancelP.promise,
|
|
57
|
-
new Promise((resolve) => setTimeout(resolve, this.throttler.getDelay())),
|
|
58
|
-
]);
|
|
59
|
-
}
|
|
60
|
-
cancel() {
|
|
61
|
-
this.cancelP.resolve();
|
|
62
|
-
this.cancelP = new core_utils_1.Deferred();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
49
|
class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
66
50
|
constructor(routeContext, snapshot, getStorage,
|
|
67
51
|
/**
|
|
@@ -98,15 +82,12 @@ class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
|
98
82
|
* because we know that the server will not delete the blob corresponding to that storage ID.
|
|
99
83
|
*/
|
|
100
84
|
this.opsInFlight = new Map();
|
|
101
|
-
this.retryThrottler = new CancellableThrottler(new throttler_1.Throttler(60 * 1000, // 60 sec delay window
|
|
102
|
-
30 * 1000, // 30 sec max delay
|
|
103
|
-
// throttling function increases exponentially (0ms, 40ms, 80ms, 160ms, etc)
|
|
104
|
-
(0, throttler_1.formExponentialFn)({ coefficient: 20, initialDelay: 0 })));
|
|
105
85
|
/**
|
|
106
86
|
* This stores IDs of tombstoned blobs.
|
|
107
87
|
* Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.
|
|
108
88
|
*/
|
|
109
89
|
this.tombstonedBlobs = new Set();
|
|
90
|
+
this.stopAttaching = false;
|
|
110
91
|
this.mc = (0, telemetry_utils_1.createChildMonitoringContext)({
|
|
111
92
|
logger: this.runtime.logger,
|
|
112
93
|
namespace: "BlobManager",
|
|
@@ -198,7 +179,6 @@ class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
|
198
179
|
* Upload blobs added while offline. This must be completed before connecting and resubmitting ops.
|
|
199
180
|
*/
|
|
200
181
|
async processStashedChanges() {
|
|
201
|
-
this.retryThrottler.cancel();
|
|
202
182
|
const pendingUploads = Array.from(this.pendingBlobs.values())
|
|
203
183
|
.filter((e) => e.pendingStashed === true)
|
|
204
184
|
.map(async (e) => e.uploadP);
|
|
@@ -306,7 +286,27 @@ class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
|
306
286
|
});
|
|
307
287
|
}
|
|
308
288
|
async uploadBlob(localId, blob) {
|
|
309
|
-
return
|
|
289
|
+
return (0, driver_utils_1.runWithRetry)(async () => {
|
|
290
|
+
try {
|
|
291
|
+
return await this.getStorage().createBlob(blob);
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
const entry = this.pendingBlobs.get(localId);
|
|
295
|
+
(0, core_utils_1.assert)(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);
|
|
296
|
+
if (entry.opsent && !(0, driver_utils_1.canRetryOnError)(error)) {
|
|
297
|
+
throw (0, telemetry_utils_1.wrapError)(error, () => new telemetry_utils_1.LoggingError(`uploadBlob error`, { canRetry: true }));
|
|
298
|
+
}
|
|
299
|
+
throw error;
|
|
300
|
+
}
|
|
301
|
+
}, "createBlob", this.mc.logger, {
|
|
302
|
+
cancel: this.pendingBlobs.get(localId)?.abortSignal,
|
|
303
|
+
}).then((response) => this.onUploadResolve(localId, response), (error) => {
|
|
304
|
+
// it will only reject if we haven't sent an op
|
|
305
|
+
// and is a non-retriable error. It will only reject
|
|
306
|
+
// the promise but not throw any error outside.
|
|
307
|
+
this.pendingBlobs.get(localId)?.handleP.reject(error);
|
|
308
|
+
this.deletePendingBlob(localId);
|
|
309
|
+
});
|
|
310
310
|
}
|
|
311
311
|
/**
|
|
312
312
|
* Set up a mapping in the redirect table from fromId to toId. Also, notify the runtime that a reference is added
|
|
@@ -331,7 +331,7 @@ class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
|
331
331
|
onUploadResolve(localId, response) {
|
|
332
332
|
const entry = this.pendingBlobs.get(localId);
|
|
333
333
|
(0, core_utils_1.assert)(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);
|
|
334
|
-
if (entry.abortSignal?.aborted === true && !entry.opsent) {
|
|
334
|
+
if ((entry.abortSignal?.aborted === true && !entry.opsent) || this.stopAttaching) {
|
|
335
335
|
this.deletePendingBlob(localId);
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
@@ -363,25 +363,6 @@ class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
|
363
363
|
}
|
|
364
364
|
return response;
|
|
365
365
|
}
|
|
366
|
-
async onUploadReject(localId, error) {
|
|
367
|
-
const entry = this.pendingBlobs.get(localId);
|
|
368
|
-
(0, core_utils_1.assert)(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);
|
|
369
|
-
if (entry.abortSignal?.aborted === true && !entry.opsent) {
|
|
370
|
-
this.deletePendingBlob(localId);
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
if (!this.runtime.connected) {
|
|
374
|
-
// we are probably not connected to storage but start another upload request in case we are
|
|
375
|
-
entry.uploadP = this.retryThrottler
|
|
376
|
-
.getDelay()
|
|
377
|
-
.then(async () => this.uploadBlob(localId, entry.blob));
|
|
378
|
-
return entry.uploadP;
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
this.deletePendingBlob(localId);
|
|
382
|
-
entry.handleP.reject(error);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
366
|
/**
|
|
386
367
|
* Resubmit a BlobAttach op. Used to add storage IDs to ops that were
|
|
387
368
|
* submitted to runtime while disconnected.
|
|
@@ -641,7 +622,7 @@ class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
|
641
622
|
this.setRedirection(storageId, storageId);
|
|
642
623
|
}
|
|
643
624
|
}
|
|
644
|
-
async attachAndGetPendingBlobs() {
|
|
625
|
+
async attachAndGetPendingBlobs(stopBlobAttachingSignal) {
|
|
645
626
|
return telemetry_utils_1.PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: "GetPendingBlobs" }, async () => {
|
|
646
627
|
if (this.pendingBlobs.size === 0) {
|
|
647
628
|
return;
|
|
@@ -653,11 +634,12 @@ class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
|
653
634
|
for (const [id, entry] of this.pendingBlobs) {
|
|
654
635
|
if (!localBlobs.has(entry)) {
|
|
655
636
|
localBlobs.add(entry);
|
|
656
|
-
if (!entry.opsent) {
|
|
657
|
-
this.sendBlobAttachOp(id, entry.storageId);
|
|
658
|
-
}
|
|
659
637
|
entry.handleP.resolve(this.getBlobHandle(id));
|
|
660
|
-
attachBlobsP.push(new Promise((resolve) => {
|
|
638
|
+
attachBlobsP.push(new Promise((resolve, reject) => {
|
|
639
|
+
stopBlobAttachingSignal?.addEventListener("abort", () => {
|
|
640
|
+
this.stopAttaching = true;
|
|
641
|
+
reject(new Error("Operation aborted"));
|
|
642
|
+
}, { once: true });
|
|
661
643
|
const onBlobAttached = (attachedEntry) => {
|
|
662
644
|
if (attachedEntry === entry) {
|
|
663
645
|
this.off("blobAttached", onBlobAttached);
|
|
@@ -673,10 +655,20 @@ class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
|
673
655
|
}));
|
|
674
656
|
}
|
|
675
657
|
}
|
|
676
|
-
await Promise.
|
|
658
|
+
await Promise.allSettled(attachBlobsP).catch(() => { });
|
|
677
659
|
}
|
|
678
660
|
for (const [id, entry] of this.pendingBlobs) {
|
|
661
|
+
if (stopBlobAttachingSignal?.aborted && !entry.attached) {
|
|
662
|
+
this.mc.logger.sendTelemetryEvent({
|
|
663
|
+
eventName: "UnableToStashBlob",
|
|
664
|
+
id,
|
|
665
|
+
});
|
|
666
|
+
continue;
|
|
667
|
+
}
|
|
679
668
|
(0, core_utils_1.assert)(entry.attached === true, 0x790 /* stashed blob should be attached */);
|
|
669
|
+
if (!entry.opsent) {
|
|
670
|
+
this.sendBlobAttachOp(id, entry.storageId);
|
|
671
|
+
}
|
|
680
672
|
blobs[id] = {
|
|
681
673
|
blob: (0, client_utils_1.bufferToString)(entry.blob, "base64"),
|
|
682
674
|
storageId: entry.storageId,
|