From aee0358054a31cceddb90b366251c431b845c4a5 Mon Sep 17 00:00:00 2001 From: Oleg Mazurov <23125269+OlegMazurov@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:45:39 -0800 Subject: [PATCH] perf: enable compaction during reconnects (#17129) Signed-off-by: Oleg Mazurov --- .../src/main/java/com/swirlds/merkledb/MerkleDb.java | 2 +- .../swirlds/virtualmap/internal/merkle/VirtualRootNode.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/platform-sdk/swirlds-merkledb/src/main/java/com/swirlds/merkledb/MerkleDb.java b/platform-sdk/swirlds-merkledb/src/main/java/com/swirlds/merkledb/MerkleDb.java index 3b0b2119199c..c55f121a09ca 100644 --- a/platform-sdk/swirlds-merkledb/src/main/java/com/swirlds/merkledb/MerkleDb.java +++ b/platform-sdk/swirlds-merkledb/src/main/java/com/swirlds/merkledb/MerkleDb.java @@ -398,7 +398,7 @@ public MerkleDbDataSource copyDataSource( final String label = dataSource.getTableName(); final int tableId = getNextTableId(); importDataSource(dataSource, tableId, !makeCopyPrimary, makeCopyPrimary); // import to itself == copy - return getDataSource(tableId, label, false, offlineUse); + return getDataSource(tableId, label, makeCopyPrimary, offlineUse); } private void importDataSource( diff --git a/platform-sdk/swirlds-virtualmap/src/main/java/com/swirlds/virtualmap/internal/merkle/VirtualRootNode.java b/platform-sdk/swirlds-virtualmap/src/main/java/com/swirlds/virtualmap/internal/merkle/VirtualRootNode.java index 060a182fafdd..94ec0d1c38ca 100644 --- a/platform-sdk/swirlds-virtualmap/src/main/java/com/swirlds/virtualmap/internal/merkle/VirtualRootNode.java +++ b/platform-sdk/swirlds-virtualmap/src/main/java/com/swirlds/virtualmap/internal/merkle/VirtualRootNode.java @@ -1704,9 +1704,6 @@ public void endLearnerReconnect() { originalMap = null; logger.info(RECONNECT.getMarker(), "call postInit()"); postInit(fullyReconnectedState); - // Start up data source compaction now - logger.info(RECONNECT.getMarker(), "call dataSource.enableBackgroundCompaction()"); - dataSource.enableBackgroundCompaction(); } catch (ExecutionException e) { final var message = "VirtualMap@" + getRoute() + " failed to get hash during learner reconnect"; throw new MerkleSynchronizationException(message, e);