@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
package/dist/containerRuntime.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ContainerRuntime = exports.loadContainerRuntime = exports.getSingleUseLegacyLogCallback = exports.makeLegacySendBatchFn = exports.getDeviceSpec = exports.agentSchedulerId = exports.isUnpackedRuntimeMessage = exports.defaultPendingOpsRetryDelayMs = exports.defaultPendingOpsWaitTimeoutMs = exports.disabledCompressionConfig = exports.CompressionAlgorithms = exports.InactiveResponseHeaderKey = exports.TombstoneResponseHeaderKey = exports.DeletedResponseHeaderKey = exports.DefaultSummaryConfiguration = void 0;
|
|
7
|
+
exports.ContainerRuntime = exports.loadContainerRuntime = exports.getSingleUseLegacyLogCallback = exports.makeLegacySendBatchFn = exports.getDeviceSpec = exports.agentSchedulerId = exports.isUnpackedRuntimeMessage = exports.defaultPendingOpsRetryDelayMs = exports.defaultPendingOpsWaitTimeoutMs = exports.disabledCompressionConfig = exports.CompressionAlgorithms = exports.defaultRuntimeHeaderData = exports.InactiveResponseHeaderKey = exports.TombstoneResponseHeaderKey = exports.DeletedResponseHeaderKey = exports.DefaultSummaryConfiguration = void 0;
|
|
8
8
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
9
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
10
10
|
const internal_1 = require("@fluidframework/container-definitions/internal");
|
|
@@ -90,6 +90,12 @@ exports.TombstoneResponseHeaderKey = "isTombstoned";
|
|
|
90
90
|
* to this was experimental and is no longer supported.
|
|
91
91
|
*/
|
|
92
92
|
exports.InactiveResponseHeaderKey = "isInactive";
|
|
93
|
+
/** Default values for Runtime Headers */
|
|
94
|
+
exports.defaultRuntimeHeaderData = {
|
|
95
|
+
wait: true,
|
|
96
|
+
viaHandle: false,
|
|
97
|
+
allowTombstone: false,
|
|
98
|
+
};
|
|
93
99
|
/**
|
|
94
100
|
* Available compression algorithms for op compression.
|
|
95
101
|
* @legacy
|
|
@@ -1587,7 +1593,9 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1587
1593
|
: inboundResult.type === "batchStartingMessage"
|
|
1588
1594
|
? { batchStart: true, batchEnd: false }
|
|
1589
1595
|
: { batchStart: false, batchEnd: inboundResult.batchEnd === true };
|
|
1590
|
-
this.processInboundMessages(messagesWithPendingState, locationInBatch, local, savedOp, runtimeBatch
|
|
1596
|
+
this.processInboundMessages(messagesWithPendingState, locationInBatch, local, savedOp, runtimeBatch, inboundResult.type === "fullBatch"
|
|
1597
|
+
? inboundResult.groupedBatch
|
|
1598
|
+
: false /* groupedBatch */);
|
|
1591
1599
|
}
|
|
1592
1600
|
else {
|
|
1593
1601
|
if (!runtimeBatch) {
|
|
@@ -1600,7 +1608,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1600
1608
|
}
|
|
1601
1609
|
}
|
|
1602
1610
|
this.processInboundMessages([{ message: messageCopy, localOpMetadata: undefined }], { batchStart: true, batchEnd: true }, // Single message
|
|
1603
|
-
local, savedOp, runtimeBatch);
|
|
1611
|
+
local, savedOp, runtimeBatch, false /* groupedBatch */);
|
|
1604
1612
|
}
|
|
1605
1613
|
if (local) {
|
|
1606
1614
|
// If we have processed a local op, this means that the container is
|
|
@@ -1611,35 +1619,93 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1611
1619
|
}
|
|
1612
1620
|
/**
|
|
1613
1621
|
* Processes inbound message(s). It calls schedule manager according to the messages' location in the batch.
|
|
1614
|
-
* @param
|
|
1622
|
+
* @param messagesWithMetadata - messages to process along with their metadata.
|
|
1615
1623
|
* @param locationInBatch - Are we processing the start and/or end of a batch?
|
|
1616
1624
|
* @param local - true if the messages were originally generated by the client receiving it.
|
|
1617
1625
|
* @param savedOp - true if the message is a replayed saved op.
|
|
1618
1626
|
* @param runtimeBatch - true if these are runtime messages.
|
|
1627
|
+
* @param groupedBatch - true if these messages are part of a grouped op batch.
|
|
1619
1628
|
*/
|
|
1620
|
-
processInboundMessages(
|
|
1629
|
+
processInboundMessages(messagesWithMetadata, locationInBatch, local, savedOp, runtimeBatch, groupedBatch) {
|
|
1621
1630
|
if (locationInBatch.batchStart) {
|
|
1622
|
-
const firstMessage =
|
|
1631
|
+
const firstMessage = messagesWithMetadata[0]?.message;
|
|
1623
1632
|
(0, internal_2.assert)(firstMessage !== undefined, 0xa31 /* Batch must have at least one message */);
|
|
1624
1633
|
this.scheduleManager.batchBegin(firstMessage);
|
|
1625
1634
|
}
|
|
1626
1635
|
let error;
|
|
1627
1636
|
try {
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
this.validateAndProcessRuntimeMessage({
|
|
1632
|
-
message: message,
|
|
1633
|
-
local,
|
|
1634
|
-
savedOp,
|
|
1635
|
-
localOpMetadata,
|
|
1636
|
-
});
|
|
1637
|
-
}
|
|
1638
|
-
else {
|
|
1637
|
+
if (!runtimeBatch) {
|
|
1638
|
+
messagesWithMetadata.forEach(({ message }) => {
|
|
1639
|
+
this.ensureNoDataModelChanges(() => {
|
|
1639
1640
|
this.observeNonRuntimeMessage(message);
|
|
1640
|
-
}
|
|
1641
|
+
});
|
|
1641
1642
|
});
|
|
1642
|
-
|
|
1643
|
+
return;
|
|
1644
|
+
}
|
|
1645
|
+
// Helper that updates a message's minimum sequence number to the minimum sequence number that container
|
|
1646
|
+
// runtime is tracking and sets _processedClientSequenceNumber. It returns the updated message.
|
|
1647
|
+
const updateSequenceNumbers = (message) => {
|
|
1648
|
+
// Set the minimum sequence number to the containerRuntime's understanding of minimum sequence number.
|
|
1649
|
+
message.minimumSequenceNumber =
|
|
1650
|
+
this.useDeltaManagerOpsProxy &&
|
|
1651
|
+
this.deltaManager.minimumSequenceNumber < message.minimumSequenceNumber
|
|
1652
|
+
? this.deltaManager.minimumSequenceNumber
|
|
1653
|
+
: message.minimumSequenceNumber;
|
|
1654
|
+
this._processedClientSequenceNumber = message.clientSequenceNumber;
|
|
1655
|
+
return message;
|
|
1656
|
+
};
|
|
1657
|
+
// Non-grouped batch messages are processed one at a time.
|
|
1658
|
+
if (!groupedBatch) {
|
|
1659
|
+
for (const { message, localOpMetadata } of messagesWithMetadata) {
|
|
1660
|
+
updateSequenceNumbers(message);
|
|
1661
|
+
this.ensureNoDataModelChanges(() => {
|
|
1662
|
+
this.validateAndProcessRuntimeMessages(message, [
|
|
1663
|
+
{
|
|
1664
|
+
contents: message.contents,
|
|
1665
|
+
localOpMetadata,
|
|
1666
|
+
clientSequenceNumber: message.clientSequenceNumber,
|
|
1667
|
+
},
|
|
1668
|
+
], local, savedOp);
|
|
1669
|
+
this.emit("op", message, true /* runtimeMessage */);
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1672
|
+
return;
|
|
1673
|
+
}
|
|
1674
|
+
let bunchedMessagesContent = [];
|
|
1675
|
+
let previousMessage;
|
|
1676
|
+
// Helper that processes the previous bunch of messages.
|
|
1677
|
+
const sendBunchedMessages = () => {
|
|
1678
|
+
(0, internal_2.assert)(previousMessage !== undefined, 0xa67 /* previous message must exist */);
|
|
1679
|
+
this.ensureNoDataModelChanges(() => {
|
|
1680
|
+
this.validateAndProcessRuntimeMessages(
|
|
1681
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1682
|
+
previousMessage, bunchedMessagesContent, local, savedOp);
|
|
1683
|
+
});
|
|
1684
|
+
bunchedMessagesContent = [];
|
|
1685
|
+
};
|
|
1686
|
+
/**
|
|
1687
|
+
* For grouped batch messages, bunch contiguous messages of the same type and process them together.
|
|
1688
|
+
* This is an optimization mainly for DDSes, where it can process a bunch of ops together. DDSes
|
|
1689
|
+
* like merge tree or shared tree can process ops more efficiently when they are bunched together.
|
|
1690
|
+
*/
|
|
1691
|
+
for (const { message, localOpMetadata } of messagesWithMetadata) {
|
|
1692
|
+
const currentMessage = updateSequenceNumbers(message);
|
|
1693
|
+
if (previousMessage && previousMessage.type !== currentMessage.type) {
|
|
1694
|
+
sendBunchedMessages();
|
|
1695
|
+
}
|
|
1696
|
+
previousMessage = currentMessage;
|
|
1697
|
+
bunchedMessagesContent.push({
|
|
1698
|
+
contents: message.contents,
|
|
1699
|
+
localOpMetadata,
|
|
1700
|
+
clientSequenceNumber: message.clientSequenceNumber,
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
// Process the last bunch of messages.
|
|
1704
|
+
sendBunchedMessages();
|
|
1705
|
+
// Send the "op" events for the messages now that the ops have been processed.
|
|
1706
|
+
for (const { message } of messagesWithMetadata) {
|
|
1707
|
+
this.emit("op", message, true /* runtimeMessage */);
|
|
1708
|
+
}
|
|
1643
1709
|
}
|
|
1644
1710
|
catch (e) {
|
|
1645
1711
|
error = e;
|
|
@@ -1647,7 +1713,7 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1647
1713
|
}
|
|
1648
1714
|
finally {
|
|
1649
1715
|
if (locationInBatch.batchEnd) {
|
|
1650
|
-
const lastMessage =
|
|
1716
|
+
const lastMessage = messagesWithMetadata[messagesWithMetadata.length - 1]?.message;
|
|
1651
1717
|
(0, internal_2.assert)(lastMessage !== undefined, 0xa32 /* Batch must have at least one message */);
|
|
1652
1718
|
this.scheduleManager.batchEnd(error, lastMessage);
|
|
1653
1719
|
}
|
|
@@ -1671,62 +1737,50 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1671
1737
|
this.emit("op", message, false /* runtimeMessage */);
|
|
1672
1738
|
}
|
|
1673
1739
|
/**
|
|
1674
|
-
*
|
|
1675
|
-
*
|
|
1740
|
+
* Process runtime messages. The messages here are contiguous messages in a batch.
|
|
1741
|
+
* Assuming the messages in the given bunch are also a TypedContainerRuntimeMessage, checks its type and dispatch
|
|
1742
|
+
* the messages to the appropriate handler in the runtime.
|
|
1676
1743
|
* Throws a DataProcessingError if the message looks like but doesn't conform to a known TypedContainerRuntimeMessage type.
|
|
1744
|
+
* @param message - The core message with common properties for all the messages.
|
|
1745
|
+
* @param messageContents - The contents, local metadata and clientSequenceNumbers of the messages.
|
|
1746
|
+
* @param local - true if the messages were originally generated by the client receiving it.
|
|
1747
|
+
* @param savedOp - true if the message is a replayed saved op.
|
|
1748
|
+
*
|
|
1677
1749
|
*/
|
|
1678
|
-
|
|
1679
|
-
const { local, message, savedOp, localOpMetadata } = messageWithContext;
|
|
1680
|
-
// Set the minimum sequence number to the containerRuntime's understanding of minimum sequence number.
|
|
1681
|
-
if (this.useDeltaManagerOpsProxy &&
|
|
1682
|
-
this.deltaManager.minimumSequenceNumber < message.minimumSequenceNumber) {
|
|
1683
|
-
message.minimumSequenceNumber = this.deltaManager.minimumSequenceNumber;
|
|
1684
|
-
}
|
|
1685
|
-
this._processedClientSequenceNumber = message.clientSequenceNumber;
|
|
1750
|
+
validateAndProcessRuntimeMessages(message, messagesContent, local, savedOp) {
|
|
1686
1751
|
// If there are no more pending messages after processing a local message,
|
|
1687
1752
|
// the document is no longer dirty.
|
|
1688
1753
|
if (!this.hasPendingMessages()) {
|
|
1689
1754
|
this.updateDocumentDirtyState(false);
|
|
1690
1755
|
}
|
|
1756
|
+
// Get the contents without the localOpMetadata because not all message types know about localOpMetadata.
|
|
1757
|
+
const contents = messagesContent.map((c) => c.contents);
|
|
1691
1758
|
switch (message.type) {
|
|
1759
|
+
case messageTypes_js_1.ContainerMessageType.FluidDataStoreOp:
|
|
1692
1760
|
case messageTypes_js_1.ContainerMessageType.Attach:
|
|
1693
1761
|
case messageTypes_js_1.ContainerMessageType.Alias:
|
|
1694
|
-
|
|
1695
|
-
|
|
1762
|
+
// Remove the metadata from the message before sending it to the channel collection. The metadata
|
|
1763
|
+
// is added by the container runtime and is not part of the message that the channel collection and
|
|
1764
|
+
// layers below it expect.
|
|
1765
|
+
this.channelCollection.processMessages({ envelope: message, messagesContent, local });
|
|
1696
1766
|
break;
|
|
1697
1767
|
case messageTypes_js_1.ContainerMessageType.BlobAttach:
|
|
1698
|
-
this.blobManager.
|
|
1768
|
+
this.blobManager.processBlobAttachMessage(message, local);
|
|
1699
1769
|
break;
|
|
1700
1770
|
case messageTypes_js_1.ContainerMessageType.IdAllocation:
|
|
1701
|
-
|
|
1702
|
-
// stashed ops flow. The compressor is stashed with these ops already processed.
|
|
1703
|
-
// That said, in idCompressorMode === "delayed", we might not serialize ID compressor, and
|
|
1704
|
-
// thus we need to process all the ops.
|
|
1705
|
-
if (!(this.skipSavedCompressorOps && savedOp === true)) {
|
|
1706
|
-
const range = message.contents;
|
|
1707
|
-
// Some other client turned on the id compressor. If we have not turned it on,
|
|
1708
|
-
// put it in a pending queue and delay finalization.
|
|
1709
|
-
if (this._idCompressor === undefined) {
|
|
1710
|
-
(0, internal_2.assert)(this.idCompressorMode !== undefined, 0x93c /* id compressor should be enabled */);
|
|
1711
|
-
this.pendingIdCompressorOps.push(range);
|
|
1712
|
-
}
|
|
1713
|
-
else {
|
|
1714
|
-
(0, internal_2.assert)(this.pendingIdCompressorOps.length === 0, 0x979 /* there should be no pending ops! */);
|
|
1715
|
-
this._idCompressor.finalizeCreationRange(range);
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1771
|
+
this.processIdCompressorMessages(contents, savedOp);
|
|
1718
1772
|
break;
|
|
1719
1773
|
case messageTypes_js_1.ContainerMessageType.GC:
|
|
1720
|
-
this.garbageCollector.
|
|
1774
|
+
this.garbageCollector.processMessages(contents, message.timestamp, local);
|
|
1721
1775
|
break;
|
|
1722
1776
|
case messageTypes_js_1.ContainerMessageType.ChunkedOp:
|
|
1723
|
-
// From observability POV, we should not
|
|
1777
|
+
// From observability POV, we should not expose the rest of the system (including "op" events on object) to these messages.
|
|
1724
1778
|
// Also resetReconnectCount() would be wrong - see comment that was there before this change was made.
|
|
1725
1779
|
(0, internal_2.assert)(false, 0x93d /* should not even get here */);
|
|
1726
1780
|
case messageTypes_js_1.ContainerMessageType.Rejoin:
|
|
1727
1781
|
break;
|
|
1728
1782
|
case messageTypes_js_1.ContainerMessageType.DocumentSchemaChange:
|
|
1729
|
-
this.documentsSchemaController.
|
|
1783
|
+
this.documentsSchemaController.processDocumentSchemaMessages(contents, local, message.sequenceNumber);
|
|
1730
1784
|
break;
|
|
1731
1785
|
default: {
|
|
1732
1786
|
const error = getUnknownMessageTypeError(message.type, "validateAndProcessRuntimeMessage" /* codePath */, message);
|
|
@@ -1734,7 +1788,26 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
1734
1788
|
throw error;
|
|
1735
1789
|
}
|
|
1736
1790
|
}
|
|
1737
|
-
|
|
1791
|
+
}
|
|
1792
|
+
processIdCompressorMessages(messageContents, savedOp) {
|
|
1793
|
+
for (const range of messageContents) {
|
|
1794
|
+
// Don't re-finalize the range if we're processing a "savedOp" in
|
|
1795
|
+
// stashed ops flow. The compressor is stashed with these ops already processed.
|
|
1796
|
+
// That said, in idCompressorMode === "delayed", we might not serialize ID compressor, and
|
|
1797
|
+
// thus we need to process all the ops.
|
|
1798
|
+
if (!(this.skipSavedCompressorOps && savedOp === true)) {
|
|
1799
|
+
// Some other client turned on the id compressor. If we have not turned it on,
|
|
1800
|
+
// put it in a pending queue and delay finalization.
|
|
1801
|
+
if (this._idCompressor === undefined) {
|
|
1802
|
+
(0, internal_2.assert)(this.idCompressorMode !== undefined, 0x93c /* id compressor should be enabled */);
|
|
1803
|
+
this.pendingIdCompressorOps.push(range);
|
|
1804
|
+
}
|
|
1805
|
+
else {
|
|
1806
|
+
(0, internal_2.assert)(this.pendingIdCompressorOps.length === 0, 0x979 /* there should be no pending ops! */);
|
|
1807
|
+
this._idCompressor.finalizeCreationRange(range);
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1738
1811
|
}
|
|
1739
1812
|
/**
|
|
1740
1813
|
* Emits the Signal event and update the perf signal data.
|
|
@@ -2310,7 +2383,17 @@ class ContainerRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
2310
2383
|
},
|
|
2311
2384
|
},
|
|
2312
2385
|
});
|
|
2313
|
-
|
|
2386
|
+
// legacy: assert 0x3d1
|
|
2387
|
+
if (!this.outbox.isEmpty) {
|
|
2388
|
+
throw internal_7.DataProcessingError.create("Can't trigger summary in the middle of a batch", "submitSummary", undefined, {
|
|
2389
|
+
summaryNumber,
|
|
2390
|
+
pendingMessages: this.pendingMessagesCount,
|
|
2391
|
+
outboxLength: this.outbox.messageCount,
|
|
2392
|
+
mainBatchLength: this.outbox.mainBatchMessageCount,
|
|
2393
|
+
blobAttachBatchLength: this.outbox.blobAttachBatchMessageCount,
|
|
2394
|
+
idAllocationBatchLength: this.outbox.idAllocationBatchMessageCount,
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2314
2397
|
// If the container is dirty, i.e., there are pending unacked ops, the summary will not be eventual consistent
|
|
2315
2398
|
// and it may even be incorrect. So, wait for the container to be saved with a timeout. If the container is not
|
|
2316
2399
|
// saved within the timeout, check if it should be failed or can continue.
|