@fluidframework/container-runtime 2.1.0-276326 → 2.1.0-276985
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/README.md +5 -5
- package/container-runtime.test-files.tar +0 -0
- package/dist/{blobManager.d.ts → blobManager/blobManager.d.ts} +9 -29
- package/dist/blobManager/blobManager.d.ts.map +1 -0
- package/dist/{blobManager.js → blobManager/blobManager.js} +23 -83
- package/dist/blobManager/blobManager.js.map +1 -0
- package/dist/blobManager/blobManagerSnapSum.d.ts +30 -0
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -0
- package/dist/blobManager/blobManagerSnapSum.js +82 -0
- package/dist/blobManager/blobManagerSnapSum.js.map +1 -0
- package/dist/blobManager/index.d.ts +7 -0
- package/dist/blobManager/index.d.ts.map +1 -0
- package/dist/blobManager/index.js +16 -0
- package/dist/blobManager/index.js.map +1 -0
- package/dist/containerRuntime.d.ts +1 -5
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +68 -75
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +1 -0
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +7 -2
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/gc/garbageCollection.js +2 -2
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +17 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +43 -5
- package/dist/opLifecycle/remoteMessageProcessor.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 +3 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +16 -1
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/index.d.ts +1 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +1 -2
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +0 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +3 -3
- package/dist/summary/summaryFormat.js.map +1 -1
- package/lib/{blobManager.d.ts → blobManager/blobManager.d.ts} +9 -29
- package/lib/blobManager/blobManager.d.ts.map +1 -0
- package/lib/{blobManager.js → blobManager/blobManager.js} +21 -83
- package/lib/blobManager/blobManager.js.map +1 -0
- package/lib/blobManager/blobManagerSnapSum.d.ts +30 -0
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -0
- package/lib/blobManager/blobManagerSnapSum.js +75 -0
- package/lib/blobManager/blobManagerSnapSum.js.map +1 -0
- package/lib/blobManager/index.d.ts +7 -0
- package/lib/blobManager/index.d.ts.map +1 -0
- package/lib/blobManager/index.js +7 -0
- package/lib/blobManager/index.js.map +1 -0
- package/lib/containerRuntime.d.ts +1 -5
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +17 -24
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +1 -0
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +7 -2
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/gc/garbageCollection.js +2 -2
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +17 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +41 -3
- package/lib/opLifecycle/remoteMessageProcessor.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 +3 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +17 -2
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/index.d.ts +1 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +0 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/package.json +21 -21
- package/src/{blobManager.ts → blobManager/blobManager.ts} +38 -123
- package/src/blobManager/blobManagerSnapSum.ts +133 -0
- package/src/blobManager/index.ts +19 -0
- package/src/containerRuntime.ts +34 -37
- package/src/dataStoreContext.ts +8 -2
- package/src/gc/garbageCollection.ts +2 -2
- package/src/index.ts +1 -1
- package/src/opLifecycle/remoteMessageProcessor.ts +63 -6
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +18 -0
- package/src/summary/index.ts +0 -1
- package/src/summary/summaryFormat.ts +1 -1
- package/dist/blobManager.d.ts.map +0 -1
- package/dist/blobManager.js.map +0 -1
- package/lib/blobManager.d.ts.map +0 -1
- package/lib/blobManager.js.map +0 -1
package/lib/containerRuntime.js
CHANGED
|
@@ -16,7 +16,7 @@ import { DataCorruptionError, DataProcessingError, GenericError, LoggingError, P
|
|
|
16
16
|
TaggedLoggerAdapter, UsageError, createChildLogger, createChildMonitoringContext, createSampledLogger, loggerToMonitoringContext, raiseConnectedEvent, wrapError, tagCodeArtifacts, } from "@fluidframework/telemetry-utils/internal";
|
|
17
17
|
import { v4 as uuid } from "uuid";
|
|
18
18
|
import { BindBatchTracker } from "./batchTracker.js";
|
|
19
|
-
import { BlobManager } from "./blobManager.js";
|
|
19
|
+
import { BlobManager, blobManagerBasePath, blobsTreeName, isBlobPath, loadBlobManagerLoadInfo, } from "./blobManager/index.js";
|
|
20
20
|
import { ChannelCollection, getSummaryForDatastores, wrapContext, } from "./channelCollection.js";
|
|
21
21
|
import { ReportOpPerfTelemetry } from "./connectionTelemetry.js";
|
|
22
22
|
import { ContainerFluidHandleContext } from "./containerHandleContext.js";
|
|
@@ -29,7 +29,7 @@ import { OpCompressor, OpDecompressor, OpGroupingManager, OpSplitter, Outbox, Re
|
|
|
29
29
|
import { pkgVersion } from "./packageVersion.js";
|
|
30
30
|
import { PendingStateManager, } from "./pendingStateManager.js";
|
|
31
31
|
import { ScheduleManager } from "./scheduleManager.js";
|
|
32
|
-
import { DocumentsSchemaController, OrderedClientCollection, OrderedClientElection, RetriableSummaryError, RunWhileConnectedCoordinator, Summarizer, SummarizerClientElection, SummaryCollection, SummaryManager, aliasBlobName,
|
|
32
|
+
import { DocumentsSchemaController, OrderedClientCollection, OrderedClientElection, RetriableSummaryError, RunWhileConnectedCoordinator, Summarizer, SummarizerClientElection, SummaryCollection, SummaryManager, aliasBlobName, chunksBlobName, createRootSummarizerNodeWithGC, electedSummarizerBlobName, extractSummaryMetadataMessage, idCompressorBlobName, metadataBlobName, rootHasIsolatedChannels, summarizerClientType, wrapSummaryInChannelsTree, } from "./summary/index.js";
|
|
33
33
|
import { Throttler, formExponentialFn } from "./throttler.js";
|
|
34
34
|
/**
|
|
35
35
|
* Utility to implement compat behaviors given an unknown message type
|
|
@@ -277,12 +277,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
277
277
|
tryFetchBlob(idCompressorBlobName),
|
|
278
278
|
]);
|
|
279
279
|
// read snapshot blobs needed for BlobManager to load
|
|
280
|
-
const blobManagerSnapshot = await
|
|
281
|
-
// IContainerContext storage api return type still has undefined in 0.39 package version.
|
|
282
|
-
// So once we release 0.40 container-defn package we can remove this check.
|
|
283
|
-
assert(context.storage !== undefined, 0x256 /* "storage undefined in attached container" */);
|
|
284
|
-
return readAndParse(context.storage, id);
|
|
285
|
-
});
|
|
280
|
+
const blobManagerSnapshot = await loadBlobManagerLoadInfo(context);
|
|
286
281
|
const messageAtLastSummary = lastMessageFromMetadata(metadata);
|
|
287
282
|
// Verify summary runtime sequence number matches protocol sequence number.
|
|
288
283
|
const runtimeSequenceNumber = messageAtLastSummary?.sequenceNumber;
|
|
@@ -1162,7 +1157,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1162
1157
|
// eslint-disable-next-line @typescript-eslint/return-await -- Adding an await here causes test failures
|
|
1163
1158
|
return this.resolveHandle(requestParser.createSubRequest(1));
|
|
1164
1159
|
}
|
|
1165
|
-
if (id ===
|
|
1160
|
+
if (id === blobManagerBasePath && requestParser.isLeaf(2)) {
|
|
1166
1161
|
const blob = await this.blobManager.getBlob(requestParser.pathParts[1]);
|
|
1167
1162
|
return blob
|
|
1168
1163
|
? {
|
|
@@ -1476,7 +1471,13 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1476
1471
|
// but will not modify the contents object (likely it will replace it on the message).
|
|
1477
1472
|
const messageCopy = { ...messageArg };
|
|
1478
1473
|
const savedOp = messageCopy.metadata?.savedOp;
|
|
1479
|
-
|
|
1474
|
+
const processResult = this.remoteMessageProcessor.process(messageCopy);
|
|
1475
|
+
if (processResult === undefined) {
|
|
1476
|
+
// This means the incoming message is an incomplete part of a message or batch
|
|
1477
|
+
// and we need to process more messages before the rest of the system can understand it.
|
|
1478
|
+
return;
|
|
1479
|
+
}
|
|
1480
|
+
for (const message of processResult.messages) {
|
|
1480
1481
|
const msg = modernRuntimeMessage
|
|
1481
1482
|
? {
|
|
1482
1483
|
// Cast it since we expect it to be this based on modernRuntimeMessage computation above.
|
|
@@ -1486,12 +1487,14 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1486
1487
|
message: message,
|
|
1487
1488
|
local,
|
|
1488
1489
|
modernRuntimeMessage,
|
|
1490
|
+
batchStartCsn: processResult.batchStartCsn,
|
|
1489
1491
|
}
|
|
1490
1492
|
: // Unrecognized message will be ignored.
|
|
1491
1493
|
{
|
|
1492
1494
|
message,
|
|
1493
1495
|
local,
|
|
1494
1496
|
modernRuntimeMessage,
|
|
1497
|
+
batchStartCsn: processResult.batchStartCsn,
|
|
1495
1498
|
};
|
|
1496
1499
|
msg.savedOp = savedOp;
|
|
1497
1500
|
// ensure that we observe any re-entrancy, and if needed, rebase ops
|
|
@@ -1523,7 +1526,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1523
1526
|
assert(message.type !== ContainerMessageType.ChunkedOp, 0x93b /* we should never get here with chunked ops */);
|
|
1524
1527
|
let localOpMetadata;
|
|
1525
1528
|
if (local && messageWithContext.modernRuntimeMessage) {
|
|
1526
|
-
localOpMetadata = this.pendingStateManager.processPendingLocalMessage(messageWithContext.message);
|
|
1529
|
+
localOpMetadata = this.pendingStateManager.processPendingLocalMessage(messageWithContext.message, messageWithContext.batchStartCsn);
|
|
1527
1530
|
}
|
|
1528
1531
|
// If there are no more pending messages after processing a local message,
|
|
1529
1532
|
// the document is no longer dirty.
|
|
@@ -2007,7 +2010,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2007
2010
|
* blob manager.
|
|
2008
2011
|
*/
|
|
2009
2012
|
getNodeType(nodePath) {
|
|
2010
|
-
if (
|
|
2013
|
+
if (isBlobPath(nodePath)) {
|
|
2011
2014
|
return GCNodeType.Blob;
|
|
2012
2015
|
}
|
|
2013
2016
|
return this.channelCollection.getGCNodeType(nodePath) ?? GCNodeType.Other;
|
|
@@ -2024,7 +2027,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2024
2027
|
}
|
|
2025
2028
|
switch (this.getNodeType(nodePath)) {
|
|
2026
2029
|
case GCNodeType.Blob:
|
|
2027
|
-
return [
|
|
2030
|
+
return [blobManagerBasePath];
|
|
2028
2031
|
case GCNodeType.DataStore:
|
|
2029
2032
|
case GCNodeType.SubDataStore:
|
|
2030
2033
|
return this.channelCollection.getDataStorePackagePath(nodePath);
|
|
@@ -2032,16 +2035,6 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2032
2035
|
assert(false, 0x2de /* "Package path requested for unsupported node type." */);
|
|
2033
2036
|
}
|
|
2034
2037
|
}
|
|
2035
|
-
/**
|
|
2036
|
-
* Returns whether a given path is for attachment blobs that are in the format - "/BlobManager.basePath/...".
|
|
2037
|
-
*/
|
|
2038
|
-
isBlobPath(path) {
|
|
2039
|
-
const pathParts = path.split("/");
|
|
2040
|
-
if (pathParts.length < 2 || pathParts[1] !== BlobManager.basePath) {
|
|
2041
|
-
return false;
|
|
2042
|
-
}
|
|
2043
|
-
return true;
|
|
2044
|
-
}
|
|
2045
2038
|
/**
|
|
2046
2039
|
* From a given list of routes, separate and return routes that belong to blob manager and data stores.
|
|
2047
2040
|
* @param routes - A list of routes that can belong to data stores or blob manager.
|
|
@@ -2052,7 +2045,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2052
2045
|
const blobManagerRoutes = [];
|
|
2053
2046
|
const dataStoreRoutes = [];
|
|
2054
2047
|
for (const route of routes) {
|
|
2055
|
-
if (
|
|
2048
|
+
if (isBlobPath(route)) {
|
|
2056
2049
|
blobManagerRoutes.push(route);
|
|
2057
2050
|
}
|
|
2058
2051
|
else {
|