From 6bb0c918eb7aaf10d8d38b2f60e982f3a9744ba6 Mon Sep 17 00:00:00 2001 From: Siyang Tang <82279870+TangSiyang2001@users.noreply.github.com> Date: Fri, 13 Oct 2023 20:14:25 +0800 Subject: [PATCH] [fix](statistics) use replication_num as replica num (#25325) --- .../apache/doris/transaction/DatabaseTransactionMgr.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java index 4c03f4947047ac..0fc355260eae91 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java @@ -1799,15 +1799,18 @@ private boolean updateCatalogAfterVisible(TransactionState transactionState, Dat } AnalysisManager analysisManager = Env.getCurrentEnv().getAnalysisManager(); Map tableIdToTotalNumDeltaRows = transactionState.getTableIdToTotalNumDeltaRows(); - LOG.debug("table id to loaded rows:{}", tableIdToTotalNumDeltaRows); Map tableIdToNumDeltaRows = Maps.newHashMap(); tableIdToTotalNumDeltaRows .forEach((tableId, numRows) -> { OlapTable table = (OlapTable) db.getTableNullable(tableId); if (table != null) { - tableIdToNumDeltaRows.put(tableId, numRows / table.getReplicaCount()); + short replicaNum = table.getTableProperty() + .getReplicaAllocation() + .getTotalReplicaNum(); + tableIdToNumDeltaRows.put(tableId, numRows / replicaNum); } }); + LOG.debug("table id to loaded rows:{}", tableIdToNumDeltaRows); tableIdToNumDeltaRows.forEach(analysisManager::updateUpdatedRows); return true; }