Skip to content

Commit

Permalink
[improvement](log)Add log for load report update rows. (#38774)
Browse files Browse the repository at this point in the history
Add log for load report update rows. For debug purpose.
  • Loading branch information
Jibing-Li authored and dataroaring committed Aug 11, 2024
1 parent 86237b4 commit 19dfa2e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions be/src/olap/task/engine_publish_version_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ void EnginePublishVersionTask::_calculate_tbl_num_delta_rows(
auto table_id = tablet->get_table_id();
if (kv.second > 0) {
(*_table_id_to_tablet_id_to_num_delta_rows)[table_id][kv.first] += kv.second;
LOG(INFO) << "report delta rows to fe, table_id=" << table_id << ", tablet=" << kv.first
<< ", num_rows=" << kv.second;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,16 +1242,22 @@ public void replayUpdateRowsRecord(UpdateRowsEvent event) {
OlapTable olapTable = (OlapTable) table;
short replicaNum = olapTable.getTableProperty().getReplicaAllocation().getTotalReplicaNum();
Map<Long, Long> tabletRows = record.getValue();
if (tabletRows == null) {
if (tabletRows == null || tabletRows.isEmpty()) {
LOG.info("Tablet row count map is empty");
continue;
}
long tableUpdateRows = 0;
long rowsForAllReplica = 0;
for (Entry<Long, Long> entry : tabletRows.entrySet()) {
tableUpdateRows += entry.getValue();
rowsForAllReplica += entry.getValue();
if (LOG.isDebugEnabled()) {
LOG.debug("Table id {}, tablet id {}, row count {}",
record.getKey(), entry.getKey(), entry.getValue());
}
}
tableUpdateRows = tableUpdateRows / replicaNum;
LOG.info("Update rows for table {} is {}, replicaNum is {}",
olapTable.getName(), tableUpdateRows, replicaNum);
long tableUpdateRows = rowsForAllReplica / replicaNum;
LOG.info("Update rows for table {} is {}, replicaNum is {}, "
+ "rows for all replica {}, tablets count {}",
olapTable.getName(), tableUpdateRows, replicaNum, rowsForAllReplica, tabletRows.size());
statsStatus.updatedRows.addAndGet(tableUpdateRows);
if (StatisticsUtil.enablePartitionAnalyze()) {
updatePartitionRows(olapTable, tabletRows, statsStatus, replicaNum);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ private void tryFinishOneTxn(TransactionState transactionState, SystemInfoServic
// Merge task tablets update rows to tableToTabletsDelta.
private void calculateTaskUpdateRows(Map<Long, Map<Long, Long>> tableIdToTabletDeltaRows, PublishVersionTask task) {
if (CollectionUtils.isEmpty(task.getErrorTablets())) {
LOG.info("Task backend id {}, update rows info : [{}]",
task.getBackendId(), task.getTableIdToTabletDeltaRows());
for (Entry<Long, Map<Long, Long>> tableEntry : task.getTableIdToTabletDeltaRows().entrySet()) {
if (tableIdToTabletDeltaRows.containsKey(tableEntry.getKey())) {
Map<Long, Long> tabletsDelta = tableIdToTabletDeltaRows.get(tableEntry.getKey());
Expand Down

0 comments on commit 19dfa2e

Please sign in to comment.