[fix](statistics) use replication_num as replica num (#25325)

This commit is contained in:
Siyang Tang
2023-10-13 20:14:25 +08:00
committed by GitHub
parent 3e83fb8729
commit 6bb0c918eb

View File

@ -1799,15 +1799,18 @@ public class DatabaseTransactionMgr {
}
AnalysisManager analysisManager = Env.getCurrentEnv().getAnalysisManager();
Map<Long, Long> tableIdToTotalNumDeltaRows = transactionState.getTableIdToTotalNumDeltaRows();
LOG.debug("table id to loaded rows:{}", tableIdToTotalNumDeltaRows);
Map<Long, Long> 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;
}