@fluidframework/container-runtime 2.5.0-302463 → 2.5.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 +18 -0
- package/api-report/container-runtime.legacy.alpha.api.md +3 -1
- package/container-runtime.test-files.tar +0 -0
- package/dist/blobManager/blobManager.d.ts +3 -3
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +1 -1
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +20 -5
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +185 -129
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +14 -4
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +138 -55
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +15 -3
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +48 -19
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +6 -14
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +5 -6
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +23 -22
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +2 -2
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +3 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +9 -0
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +1 -0
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +2 -0
- package/dist/opLifecycle/remoteMessageProcessor.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.d.ts +11 -0
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +43 -28
- package/dist/summary/documentSchema.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +3 -3
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +1 -1
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +20 -5
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +186 -130
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +14 -4
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +137 -54
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +15 -3
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +48 -19
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -15
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +5 -6
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +23 -22
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +2 -2
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +3 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +9 -0
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +1 -0
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +2 -0
- package/lib/opLifecycle/remoteMessageProcessor.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.d.ts +11 -0
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +43 -28
- package/lib/summary/documentSchema.js.map +1 -1
- package/package.json +23 -19
- package/src/blobManager/blobManager.ts +2 -2
- package/src/channelCollection.ts +234 -176
- package/src/containerRuntime.ts +179 -68
- package/src/dataStoreContext.ts +66 -23
- package/src/dataStoreContexts.ts +7 -20
- package/src/gc/garbageCollection.ts +32 -32
- package/src/gc/gcDefinitions.ts +3 -3
- package/src/opLifecycle/outbox.ts +12 -0
- package/src/opLifecycle/remoteMessageProcessor.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/src/summary/documentSchema.ts +56 -37
|
@@ -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,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EACN,aAAa,EACb,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AAMrD,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EAGX,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"channelCollection.d.ts","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AE,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"}
|
package/lib/channelCollection.js
CHANGED
|
@@ -10,7 +10,7 @@ import { CreateSummarizerNodeSource, channelsTreeName, gcDataBlobKey, } from "@f
|
|
|
10
10
|
import { GCDataBuilder, RequestParser, SummaryTreeBuilder, addBlobToSummary, convertSnapshotTreeToSummaryTree, convertSummaryTreeToITree, create404Response, createResponseError, encodeCompactIdToString, isSerializedHandle, processAttachMessageGCData, responseToException, unpackChildNodesUsedRoutes, } from "@fluidframework/runtime-utils/internal";
|
|
11
11
|
import { DataCorruptionError, DataProcessingError, LoggingError, createChildLogger, createChildMonitoringContext, extractSafePropertiesFromMessage, tagCodeArtifacts, } from "@fluidframework/telemetry-utils/internal";
|
|
12
12
|
import { v4 as uuid } from "uuid";
|
|
13
|
-
import { DeletedResponseHeaderKey } from "./containerRuntime.js";
|
|
13
|
+
import { DeletedResponseHeaderKey, defaultRuntimeHeaderData, } from "./containerRuntime.js";
|
|
14
14
|
import { channelToDataStore, isDataStoreAliasMessage, } from "./dataStore.js";
|
|
15
15
|
import { LocalDetachedFluidDataStoreContext, LocalFluidDataStoreContext, RemoteFluidDataStoreContext, createAttributesBlob, } from "./dataStoreContext.js";
|
|
16
16
|
import { DataStoreContexts } from "./dataStoreContexts.js";
|
|
@@ -35,14 +35,6 @@ export var RuntimeHeaders;
|
|
|
35
35
|
* @alpha
|
|
36
36
|
*/
|
|
37
37
|
export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
|
|
38
|
-
function computeRuntimeHeaderData(config, data) {
|
|
39
|
-
return {
|
|
40
|
-
wait: config.getBoolean("Fluid.ContainerRuntime.WaitHeaderDefault") ?? true,
|
|
41
|
-
viaHandle: false,
|
|
42
|
-
allowTombstone: false,
|
|
43
|
-
...data,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
38
|
/**
|
|
47
39
|
* Creates a shallow wrapper of {@link IFluidParentContext}. The wrapper can then have its methods overwritten as needed
|
|
48
40
|
*/
|
|
@@ -259,87 +251,93 @@ export class ChannelCollection {
|
|
|
259
251
|
makeVisibleAndAttachGraph() {
|
|
260
252
|
this.parentContext.makeLocallyVisible();
|
|
261
253
|
}
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
//
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details
|
|
272
|
-
if (this.shouldSendAttachLog) {
|
|
273
|
-
this.shouldSendAttachLog = false;
|
|
274
|
-
this.mc.logger.sendTelemetryEvent({
|
|
275
|
-
eventName: "dataStoreAttachMessage_sampled",
|
|
276
|
-
...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),
|
|
277
|
-
details: {
|
|
278
|
-
local,
|
|
279
|
-
snapshot: !!attachMessage.snapshot,
|
|
280
|
-
foundGCData,
|
|
281
|
-
},
|
|
282
|
-
...extractSafePropertiesFromMessage(message),
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
// The local object has already been attached
|
|
286
|
-
if (local) {
|
|
287
|
-
assert(this.pendingAttach.has(attachMessage.id), 0x15e /* "Local object does not have matching attach message id" */);
|
|
288
|
-
this.contexts.get(attachMessage.id)?.setAttachState(AttachState.Attached);
|
|
289
|
-
this.pendingAttach.delete(attachMessage.id);
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
// If a non-local operation then go and create the object, otherwise mark it as officially attached.
|
|
293
|
-
if (this.alreadyProcessed(attachMessage.id)) {
|
|
294
|
-
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
295
|
-
const error = new DataCorruptionError(
|
|
296
|
-
// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId
|
|
297
|
-
"Duplicate DataStore created with existing id", {
|
|
298
|
-
...extractSafePropertiesFromMessage(message),
|
|
299
|
-
...tagCodeArtifacts({ dataStoreId: attachMessage.id }),
|
|
254
|
+
processAttachMessages(messageCollection) {
|
|
255
|
+
const { envelope, messagesContent, local } = messageCollection;
|
|
256
|
+
for (const { contents } of messagesContent) {
|
|
257
|
+
const attachMessage = contents;
|
|
258
|
+
// We need to process the GC Data for both local and remote attach messages
|
|
259
|
+
const foundGCData = processAttachMessageGCData(attachMessage.snapshot, (nodeId, toPath) => {
|
|
260
|
+
// nodeId is the relative path under the node being attached. Always starts with "/", but no trailing "/" after an id
|
|
261
|
+
const fromPath = `/${attachMessage.id}${nodeId === "/" ? "" : nodeId}`;
|
|
262
|
+
this.parentContext.addedGCOutboundRoute(fromPath, toPath, envelope.timestamp);
|
|
300
263
|
});
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
264
|
+
// Only log once per container to avoid noise/cost.
|
|
265
|
+
// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details
|
|
266
|
+
if (this.shouldSendAttachLog) {
|
|
267
|
+
this.shouldSendAttachLog = false;
|
|
268
|
+
this.mc.logger.sendTelemetryEvent({
|
|
269
|
+
eventName: "dataStoreAttachMessage_sampled",
|
|
270
|
+
...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),
|
|
271
|
+
details: {
|
|
272
|
+
local,
|
|
273
|
+
snapshot: !!attachMessage.snapshot,
|
|
274
|
+
foundGCData,
|
|
275
|
+
},
|
|
276
|
+
...extractSafePropertiesFromMessage(envelope),
|
|
277
|
+
});
|
|
309
278
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
279
|
+
// The local object has already been attached
|
|
280
|
+
if (local) {
|
|
281
|
+
assert(this.pendingAttach.has(attachMessage.id), 0x15e /* "Local object does not have matching attach message id" */);
|
|
282
|
+
this.contexts.get(attachMessage.id)?.setAttachState(AttachState.Attached);
|
|
283
|
+
this.pendingAttach.delete(attachMessage.id);
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
// If a non-local operation then go and create the object, otherwise mark it as officially attached.
|
|
287
|
+
if (this.alreadyProcessed(attachMessage.id)) {
|
|
288
|
+
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
289
|
+
const error = new DataCorruptionError(
|
|
290
|
+
// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId
|
|
291
|
+
"Duplicate DataStore created with existing id", {
|
|
292
|
+
...extractSafePropertiesFromMessage(envelope),
|
|
293
|
+
...tagCodeArtifacts({ dataStoreId: attachMessage.id }),
|
|
294
|
+
});
|
|
295
|
+
throw error;
|
|
296
|
+
}
|
|
297
|
+
const flatAttachBlobs = new Map();
|
|
298
|
+
let snapshot;
|
|
299
|
+
if (attachMessage.snapshot) {
|
|
300
|
+
snapshot = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);
|
|
301
|
+
if (isInstanceOfISnapshot(this.baseSnapshot)) {
|
|
302
|
+
snapshot = { ...this.baseSnapshot, snapshotTree: snapshot };
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// Include the type of attach message which is the pkg of the store to be
|
|
306
|
+
// used by RemoteFluidDataStoreContext in case it is not in the snapshot.
|
|
307
|
+
const pkg = [attachMessage.type];
|
|
308
|
+
const remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({
|
|
309
|
+
id: attachMessage.id,
|
|
310
|
+
snapshot,
|
|
311
|
+
parentContext: this.wrapContextForInnerChannel(attachMessage.id),
|
|
312
|
+
storage: new StorageServiceWithAttachBlobs(this.parentContext.storage, flatAttachBlobs),
|
|
313
|
+
scope: this.parentContext.scope,
|
|
314
|
+
loadingGroupId: attachMessage.snapshot?.groupId,
|
|
315
|
+
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(attachMessage.id, {
|
|
316
|
+
type: CreateSummarizerNodeSource.FromAttach,
|
|
317
|
+
sequenceNumber: envelope.sequenceNumber,
|
|
318
|
+
snapshot: attachMessage.snapshot ?? {
|
|
319
|
+
entries: [createAttributesBlob(pkg, true /* isRootDataStore */)],
|
|
320
|
+
},
|
|
321
|
+
}),
|
|
322
|
+
pkg,
|
|
337
323
|
});
|
|
324
|
+
this.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);
|
|
338
325
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
326
|
+
}
|
|
327
|
+
processAliasMessages(messageCollection) {
|
|
328
|
+
const { envelope, messagesContent, local } = messageCollection;
|
|
329
|
+
for (const { contents, localOpMetadata } of messagesContent) {
|
|
330
|
+
const aliasMessage = contents;
|
|
331
|
+
if (!isDataStoreAliasMessage(aliasMessage)) {
|
|
332
|
+
throw new DataCorruptionError("malformedDataStoreAliasMessage", {
|
|
333
|
+
...extractSafePropertiesFromMessage(envelope),
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
const resolve = localOpMetadata;
|
|
337
|
+
const aliasResult = this.processAliasMessageCore(aliasMessage.internalId, aliasMessage.alias, envelope.timestamp);
|
|
338
|
+
if (local) {
|
|
339
|
+
resolve(aliasResult);
|
|
340
|
+
}
|
|
343
341
|
}
|
|
344
342
|
}
|
|
345
343
|
processAliasMessageCore(internalId, alias, messageTimestampMs) {
|
|
@@ -586,61 +584,119 @@ export class ChannelCollection {
|
|
|
586
584
|
this.pendingAttach.set(message.id, message);
|
|
587
585
|
}
|
|
588
586
|
}
|
|
589
|
-
|
|
590
|
-
|
|
587
|
+
/**
|
|
588
|
+
* Process messages for this channel collection. The messages here are contiguous messages in a batch.
|
|
589
|
+
* @param messageCollection - The collection of messages to process.
|
|
590
|
+
*/
|
|
591
|
+
processMessages(messageCollection) {
|
|
592
|
+
switch (messageCollection.envelope.type) {
|
|
593
|
+
case ContainerMessageType.FluidDataStoreOp:
|
|
594
|
+
this.processChannelMessages(messageCollection);
|
|
595
|
+
break;
|
|
591
596
|
case ContainerMessageType.Attach:
|
|
592
|
-
this.
|
|
593
|
-
|
|
597
|
+
this.processAttachMessages(messageCollection);
|
|
598
|
+
break;
|
|
594
599
|
case ContainerMessageType.Alias:
|
|
595
|
-
this.
|
|
596
|
-
return;
|
|
597
|
-
case ContainerMessageType.FluidDataStoreOp: {
|
|
598
|
-
const envelope = message.contents;
|
|
599
|
-
const innerContents = envelope.contents;
|
|
600
|
-
const transformed = {
|
|
601
|
-
...message,
|
|
602
|
-
type: innerContents.type,
|
|
603
|
-
contents: innerContents.content,
|
|
604
|
-
};
|
|
605
|
-
this.processChannelOp(envelope.address, transformed, local, localMessageMetadata);
|
|
606
|
-
// Notify GC of any outbound references that were added by this op.
|
|
607
|
-
detectOutboundReferences(envelope.address, transformed.contents, (fromPath, toPath) => this.parentContext.addedGCOutboundRoute(fromPath, toPath, message.timestamp));
|
|
600
|
+
this.processAliasMessages(messageCollection);
|
|
608
601
|
break;
|
|
609
|
-
}
|
|
610
602
|
default:
|
|
611
603
|
assert(false, 0x8e9 /* unreached */);
|
|
612
604
|
}
|
|
613
605
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
606
|
+
/**
|
|
607
|
+
* This is still here for back-compat purposes because channel collection implements
|
|
608
|
+
* IFluidDataStoreChannel. Once it is removed from the interface, this method can be removed.
|
|
609
|
+
* Container runtime calls `processMessages` instead.
|
|
610
|
+
*/
|
|
611
|
+
process(message, local, localOpMetadata) {
|
|
612
|
+
this.processMessages({
|
|
613
|
+
envelope: message,
|
|
614
|
+
messagesContent: [
|
|
615
|
+
{
|
|
616
|
+
contents: message.contents,
|
|
617
|
+
localOpMetadata,
|
|
618
|
+
clientSequenceNumber: message.clientSequenceNumber,
|
|
619
|
+
},
|
|
620
|
+
],
|
|
621
|
+
local,
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Process channel messages. The messages here are contiguous channel type messages in a batch. Bunch
|
|
626
|
+
* of contiguous messages for a data store should be sent to it together.
|
|
627
|
+
* @param messageCollection - The collection of messages to process.
|
|
628
|
+
*/
|
|
629
|
+
processChannelMessages(messageCollection) {
|
|
630
|
+
const { messagesContent, local } = messageCollection;
|
|
631
|
+
let currentMessageState;
|
|
632
|
+
let currentMessagesContent = [];
|
|
633
|
+
// Helper that sends the current bunch of messages to the data store. It validates that the data stores exists.
|
|
634
|
+
const sendBunchedMessages = () => {
|
|
635
|
+
// Current message state will be undefined for the first message in the list.
|
|
636
|
+
if (currentMessageState === undefined) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
const currentContext = this.contexts.get(currentMessageState.address);
|
|
640
|
+
assert(!!currentContext, 0xa66 /* Context not found */);
|
|
641
|
+
currentContext.processMessages({
|
|
642
|
+
envelope: { ...messageCollection.envelope, type: currentMessageState.type },
|
|
643
|
+
messagesContent: currentMessagesContent,
|
|
624
644
|
local,
|
|
625
|
-
messageDetails: JSON.stringify({
|
|
626
|
-
type: message.type,
|
|
627
|
-
contentType: typeof message.contents,
|
|
628
|
-
}),
|
|
629
|
-
...tagCodeArtifacts({ address }),
|
|
630
645
|
});
|
|
646
|
+
currentMessagesContent = [];
|
|
647
|
+
};
|
|
648
|
+
/**
|
|
649
|
+
* Bunch contiguous messages for the same data store and send them together.
|
|
650
|
+
* This is an optimization mainly for DDSes, where it can process a bunch of ops together. DDSes
|
|
651
|
+
* like merge tree or shared tree can process ops more efficiently when they are bunched together.
|
|
652
|
+
*/
|
|
653
|
+
for (const { contents, ...restOfMessagesContent } of messagesContent) {
|
|
654
|
+
const contentsEnvelope = contents;
|
|
655
|
+
const address = contentsEnvelope.address;
|
|
656
|
+
const context = this.contexts.get(address);
|
|
657
|
+
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
658
|
+
// corruption in case a deleted data store accidentally submitted an op.
|
|
659
|
+
if (this.checkAndLogIfDeleted(address, context, "Changed", "processFluidDataStoreOp")) {
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
if (context === undefined) {
|
|
663
|
+
// Former assert 0x162
|
|
664
|
+
throw DataProcessingError.create("No context for op", "processFluidDataStoreOp", messageCollection.envelope, {
|
|
665
|
+
local,
|
|
666
|
+
messageDetails: JSON.stringify({
|
|
667
|
+
type: messageCollection.envelope.type,
|
|
668
|
+
contentType: typeof contents,
|
|
669
|
+
}),
|
|
670
|
+
...tagCodeArtifacts({ address }),
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
const { type: contextType, content: contextContents } = contentsEnvelope.contents;
|
|
674
|
+
// If the address or type of the message changes while processing the message, send the current bunch.
|
|
675
|
+
if (currentMessageState?.address !== address ||
|
|
676
|
+
currentMessageState?.type !== contextType) {
|
|
677
|
+
sendBunchedMessages();
|
|
678
|
+
}
|
|
679
|
+
currentMessagesContent.push({
|
|
680
|
+
contents: contextContents,
|
|
681
|
+
...restOfMessagesContent,
|
|
682
|
+
});
|
|
683
|
+
currentMessageState = { address, type: contextType };
|
|
684
|
+
// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is
|
|
685
|
+
// being used.
|
|
686
|
+
this.gcNodeUpdated({
|
|
687
|
+
node: { type: "DataStore", path: `/${address}` },
|
|
688
|
+
reason: "Changed",
|
|
689
|
+
timestampMs: messageCollection.envelope.timestamp,
|
|
690
|
+
packagePath: context.isLoaded ? context.packagePath : undefined,
|
|
691
|
+
});
|
|
692
|
+
detectOutboundReferences(address, contextContents, (fromPath, toPath) => this.parentContext.addedGCOutboundRoute(fromPath, toPath, messageCollection.envelope.timestamp));
|
|
631
693
|
}
|
|
632
|
-
|
|
633
|
-
//
|
|
634
|
-
|
|
635
|
-
this.gcNodeUpdated({
|
|
636
|
-
node: { type: "DataStore", path: `/${address}` },
|
|
637
|
-
reason: "Changed",
|
|
638
|
-
timestampMs: message.timestamp,
|
|
639
|
-
packagePath: context.isLoaded ? context.packagePath : undefined,
|
|
640
|
-
});
|
|
694
|
+
// Process the last bunch of messages, if any. Note that there may not be any messages in case all of them are
|
|
695
|
+
// ignored because the data store is deleted.
|
|
696
|
+
sendBunchedMessages();
|
|
641
697
|
}
|
|
642
698
|
async getDataStore(id, requestHeaderData, originalRequest) {
|
|
643
|
-
const headerData =
|
|
699
|
+
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
|
|
644
700
|
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStore", requestHeaderData, originalRequest)) {
|
|
645
701
|
// The requested data store has been deleted by gc. Create a 404 response exception.
|
|
646
702
|
throw responseToException(createResponseError(404, "DataStore was deleted", originalRequest, {
|
|
@@ -663,7 +719,7 @@ export class ChannelCollection {
|
|
|
663
719
|
if (this.checkAndLogIfDeleted(id, this.contexts.get(id), "Requested", "getDataStoreIfAvailable", requestHeaderData)) {
|
|
664
720
|
return undefined;
|
|
665
721
|
}
|
|
666
|
-
const headerData =
|
|
722
|
+
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
|
|
667
723
|
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
|
|
668
724
|
if (context === undefined) {
|
|
669
725
|
return undefined;
|