@fluidframework/container-runtime 2.0.0-internal.2.3.1 → 2.0.0-internal.2.4.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/dist/blobManager.d.ts +3 -1
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +35 -2
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +33 -29
- package/dist/containerRuntime.js.map +1 -1
- package/dist/garbageCollection.d.ts +17 -9
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +101 -41
- package/dist/garbageCollection.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/summarizer.js.map +1 -1
- package/lib/blobManager.d.ts +3 -1
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +35 -2
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +33 -29
- package/lib/containerRuntime.js.map +1 -1
- package/lib/garbageCollection.d.ts +17 -9
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +102 -42
- package/lib/garbageCollection.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/summarizer.js.map +1 -1
- package/package.json +20 -19
- package/src/blobManager.ts +41 -2
- package/src/containerRuntime.ts +67 -47
- package/src/garbageCollection.ts +109 -42
- package/src/packageVersion.ts +1 -1
- package/src/summarizer.ts +1 -1
package/lib/containerRuntime.js
CHANGED
|
@@ -295,7 +295,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
295
295
|
if (!this.disposed) {
|
|
296
296
|
this.submit(ContainerMessageType.BlobAttach, undefined, undefined, { localId, blobId });
|
|
297
297
|
}
|
|
298
|
-
}, (blobPath) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"), (fromPath, toPath) => this.garbageCollector.addedOutboundReference(fromPath, toPath), this, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pendingAttachmentBlobs);
|
|
298
|
+
}, (blobPath) => this.garbageCollector.nodeUpdated(blobPath, "Loaded"), (fromPath, toPath) => this.garbageCollector.addedOutboundReference(fromPath, toPath), this, pendingRuntimeState === null || pendingRuntimeState === void 0 ? void 0 : pendingRuntimeState.pendingAttachmentBlobs, () => this.getCurrentReferenceTimestampMs());
|
|
299
299
|
this.scheduleManager = new ScheduleManager(context.deltaManager, this, () => this.clientId, ChildLogger.create(this.logger, "ScheduleManager"));
|
|
300
300
|
this.pendingStateManager = new PendingStateManager({
|
|
301
301
|
applyStashedOp: this.applyStashedOp.bind(this),
|
|
@@ -469,7 +469,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
469
469
|
logger.sendErrorEvent({ eventName: "SequenceNumberMismatch" }, error);
|
|
470
470
|
}
|
|
471
471
|
else {
|
|
472
|
-
// Call both close and dispose as
|
|
472
|
+
// Call both close and dispose as closeFn implementation will no longer dispose runtime in future
|
|
473
473
|
context.closeFn(error);
|
|
474
474
|
(_d = context.disposeFn) === null || _d === void 0 ? void 0 : _d.call(context, error);
|
|
475
475
|
}
|
|
@@ -1755,14 +1755,12 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1755
1755
|
// The call to fetch the snapshot is very expensive and not always needed.
|
|
1756
1756
|
// It should only be done by the summarizerNode, if required.
|
|
1757
1757
|
// When fetching from storage we will always get the latest version and do not use the ackHandle.
|
|
1758
|
-
const
|
|
1758
|
+
const fetchLatestSnapshot = async () => {
|
|
1759
1759
|
const fetchResult = await this.fetchLatestSnapshotFromStorage(summaryLogger, {
|
|
1760
|
-
eventName: "
|
|
1760
|
+
eventName: "RefreshLatestSummaryAckFetch",
|
|
1761
1761
|
ackHandle,
|
|
1762
|
-
summaryRefSeq,
|
|
1763
|
-
|
|
1764
|
-
});
|
|
1765
|
-
const latestSnapshotRefSeq = await seqFromTree(fetchResult.snapshotTree, readAndParseBlob);
|
|
1762
|
+
targetSequenceNumber: summaryRefSeq,
|
|
1763
|
+
}, readAndParseBlob);
|
|
1766
1764
|
/**
|
|
1767
1765
|
* If the fetched snapshot is older than the one for which the ack was received, close the container.
|
|
1768
1766
|
* This should never happen because an ack should be sent after the latest summary is updated in the server.
|
|
@@ -1773,29 +1771,26 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1773
1771
|
* such cases, the file will be rolled back along with the ack and we will eventually reach a consistent
|
|
1774
1772
|
* state.
|
|
1775
1773
|
*/
|
|
1776
|
-
if (latestSnapshotRefSeq < summaryRefSeq) {
|
|
1774
|
+
if (fetchResult.latestSnapshotRefSeq < summaryRefSeq) {
|
|
1777
1775
|
const error = DataProcessingError.create("Fetched snapshot is older than the received ack", "RefreshLatestSummaryAck", undefined /* sequencedMessage */, {
|
|
1778
1776
|
ackHandle,
|
|
1779
1777
|
summaryRefSeq,
|
|
1780
|
-
latestSnapshotRefSeq,
|
|
1778
|
+
latestSnapshotRefSeq: fetchResult.latestSnapshotRefSeq,
|
|
1781
1779
|
});
|
|
1782
1780
|
this.closeFn(error);
|
|
1783
1781
|
throw error;
|
|
1784
1782
|
}
|
|
1785
|
-
summaryLogger.sendTelemetryEvent({
|
|
1786
|
-
eventName: "LatestSummaryRetrieved",
|
|
1787
|
-
ackHandle,
|
|
1788
|
-
lastSequenceNumber: latestSnapshotRefSeq,
|
|
1789
|
-
targetSequenceNumber: summaryRefSeq,
|
|
1790
|
-
});
|
|
1791
1783
|
// In case we had to retrieve the latest snapshot and it is different than summaryRefSeq,
|
|
1792
1784
|
// wait for the delta manager to catch up before refreshing the latest Summary.
|
|
1793
|
-
await this.waitForDeltaManagerToCatchup(latestSnapshotRefSeq, summaryLogger);
|
|
1794
|
-
return
|
|
1785
|
+
await this.waitForDeltaManagerToCatchup(fetchResult.latestSnapshotRefSeq, summaryLogger);
|
|
1786
|
+
return {
|
|
1787
|
+
snapshotTree: fetchResult.snapshotTree,
|
|
1788
|
+
snapshotRefSeq: fetchResult.latestSnapshotRefSeq,
|
|
1789
|
+
};
|
|
1795
1790
|
};
|
|
1796
|
-
const result = await this.summarizerNode.refreshLatestSummary(proposalHandle, summaryRefSeq,
|
|
1791
|
+
const result = await this.summarizerNode.refreshLatestSummary(proposalHandle, summaryRefSeq, fetchLatestSnapshot, readAndParseBlob, summaryLogger);
|
|
1797
1792
|
// Notify the garbage collector so it can update its latest summary state.
|
|
1798
|
-
await this.garbageCollector.refreshLatestSummary(
|
|
1793
|
+
await this.garbageCollector.refreshLatestSummary(proposalHandle, result, readAndParseBlob);
|
|
1799
1794
|
}
|
|
1800
1795
|
/**
|
|
1801
1796
|
* Fetches the latest snapshot from storage and uses it to refresh SummarizerNode's
|
|
@@ -1804,18 +1799,20 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1804
1799
|
* @returns downloaded snapshot's reference sequence number
|
|
1805
1800
|
*/
|
|
1806
1801
|
async refreshLatestSummaryAckFromServer(summaryLogger) {
|
|
1807
|
-
const { snapshotTree, versionId } = await this.fetchLatestSnapshotFromStorage(summaryLogger, {
|
|
1808
|
-
eventName: "RefreshLatestSummaryGetSnapshot",
|
|
1809
|
-
fetchLatest: true,
|
|
1810
|
-
});
|
|
1811
1802
|
const readAndParseBlob = async (id) => readAndParse(this.storage, id);
|
|
1812
|
-
const latestSnapshotRefSeq = await
|
|
1813
|
-
|
|
1803
|
+
const { snapshotTree, versionId, latestSnapshotRefSeq } = await this.fetchLatestSnapshotFromStorage(summaryLogger, {
|
|
1804
|
+
eventName: "RefreshLatestSummaryFromServerFetch",
|
|
1805
|
+
}, readAndParseBlob);
|
|
1806
|
+
const fetchLatestSnapshot = {
|
|
1807
|
+
snapshotTree,
|
|
1808
|
+
snapshotRefSeq: latestSnapshotRefSeq,
|
|
1809
|
+
};
|
|
1810
|
+
const result = await this.summarizerNode.refreshLatestSummary(undefined /* proposalHandle */, latestSnapshotRefSeq, async () => fetchLatestSnapshot, readAndParseBlob, summaryLogger);
|
|
1814
1811
|
// Notify the garbage collector so it can update its latest summary state.
|
|
1815
|
-
await this.garbageCollector.refreshLatestSummary(
|
|
1812
|
+
await this.garbageCollector.refreshLatestSummary(undefined /* proposalHandle */, result, readAndParseBlob);
|
|
1816
1813
|
return { latestSnapshotRefSeq, latestSnapshotVersionId: versionId };
|
|
1817
1814
|
}
|
|
1818
|
-
async fetchLatestSnapshotFromStorage(logger, event) {
|
|
1815
|
+
async fetchLatestSnapshotFromStorage(logger, event, readAndParseBlob) {
|
|
1819
1816
|
return PerformanceEvent.timedExecAsync(logger, event, async (perfEvent) => {
|
|
1820
1817
|
const stats = {};
|
|
1821
1818
|
const trace = Trace.start();
|
|
@@ -1825,8 +1822,15 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1825
1822
|
const maybeSnapshot = await this.storage.getSnapshotTree(versions[0]);
|
|
1826
1823
|
assert(!!maybeSnapshot, 0x138 /* "Failed to get snapshot from storage" */);
|
|
1827
1824
|
stats.getSnapshotDuration = trace.trace().duration;
|
|
1825
|
+
const latestSnapshotRefSeq = await seqFromTree(maybeSnapshot, readAndParseBlob);
|
|
1826
|
+
stats.snapshotRefSeq = latestSnapshotRefSeq;
|
|
1827
|
+
stats.snapshotVersion = versions[0].id;
|
|
1828
1828
|
perfEvent.end(stats);
|
|
1829
|
-
return {
|
|
1829
|
+
return {
|
|
1830
|
+
snapshotTree: maybeSnapshot,
|
|
1831
|
+
versionId: versions[0].id,
|
|
1832
|
+
latestSnapshotRefSeq,
|
|
1833
|
+
};
|
|
1830
1834
|
});
|
|
1831
1835
|
}
|
|
1832
1836
|
notifyAttaching(snapshot) {
|