Skip to content

Commit

Permalink
[fix](statistics) use replication_num as replica num (apache#25325)
Browse files Browse the repository at this point in the history
  • Loading branch information
TangSiyang2001 authored Oct 13, 2023
1 parent 3e83fb8 commit 6bb0c91
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1799,15 +1799,18 @@ private boolean updateCatalogAfterVisible(TransactionState transactionState, Dat
}
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;
}
Expand Down

0 comments on commit 6bb0c91

Please sign in to comment.