yujun777 commented on code in PR #28079: URL: https://github.com/apache/doris/pull/28079#discussion_r1427635336
########## fe/fe-core/src/main/java/org/apache/doris/transaction/PublishVersionDaemon.java: ########## @@ -132,27 +133,45 @@ private void publishVersion() { Map<Long, Long> tableIdToTotalDeltaNumRows = Maps.newHashMap(); // try to finish the transaction, if failed just retry in next loop for (TransactionState transactionState : readyTransactionStates) { - Stream<PublishVersionTask> publishVersionTaskStream = transactionState - .getPublishVersionTasks() - .values() - .stream() - .peek(task -> { - if (task.isFinished() && CollectionUtils.isEmpty(task.getErrorTablets())) { - Map<Long, Long> tableIdToDeltaNumRows = - task.getTableIdToDeltaNumRows(); - tableIdToDeltaNumRows.forEach((tableId, numRows) -> { - tableIdToTotalDeltaNumRows - .computeIfPresent(tableId, (id, orgNumRows) -> orgNumRows + numRows); - tableIdToTotalDeltaNumRows.putIfAbsent(tableId, numRows); - }); - } - }); - boolean hasBackendAliveAndUnfinishedTask = publishVersionTaskStream - .anyMatch(task -> !task.isFinished() && infoService.checkBackendAlive(task.getBackendId())); + AtomicReference<Long> finishNum = new AtomicReference<>(0L); Review Comment: no need define finishNum here ? because finishNum = total task num - unfinish be num -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org