This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 11a942ae548 [fix](group commit) Fix group commit error log when 
decommission (#39899)
11a942ae548 is described below

commit 11a942ae548c13d27a08d3d3af48a79f100e1a65
Author: meiyi <myime...@gmail.com>
AuthorDate: Tue Aug 27 09:39:10 2024 +0800

    [fix](group commit) Fix group commit error log when decommission (#39899)
    
    Decommission backend will check the group commit wal num is 0.
    But there is a small bug of log:
    ```
    boolean hasWal = checkWal(backend);  // the hasWal should be empty wal
    
    hasWal ? "; and has unfinished WALs" : "" // so if log print 'and has 
unfinished WALs', the wal is 0 actually
    ```
---
 .../src/main/java/org/apache/doris/alter/SystemHandler.java    | 10 +++-------
 .../main/java/org/apache/doris/load/GroupCommitManager.java    |  6 +++---
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/alter/SystemHandler.java 
b/fe/fe-core/src/main/java/org/apache/doris/alter/SystemHandler.java
index e0909088f8d..28b3684ed04 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/alter/SystemHandler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/alter/SystemHandler.java
@@ -95,8 +95,8 @@ public class SystemHandler extends AlterHandler {
             }
 
             List<Long> backendTabletIds = 
invertedIndex.getTabletIdsByBackendId(beId);
-            boolean hasWal = checkWal(backend);
-            if (Config.drop_backend_after_decommission && checkTablets(beId, 
backendTabletIds) && hasWal) {
+            long walNum = 
Env.getCurrentEnv().getGroupCommitManager().getAllWalQueueSize(backend);
+            if (Config.drop_backend_after_decommission && checkTablets(beId, 
backendTabletIds) && walNum == 0) {
                 try {
                     systemInfoService.dropBackend(beId);
                     LOG.info("no available tablet on decommission backend {}, 
drop it", beId);
@@ -109,7 +109,7 @@ public class SystemHandler extends AlterHandler {
 
             LOG.info("backend {} lefts {} replicas to decommission: {}{}", 
beId, backendTabletIds.size(),
                     backendTabletIds.subList(0, Math.min(10, 
backendTabletIds.size())),
-                    hasWal ? "; and has unfinished WALs" : "");
+                    walNum > 0 ? "; and has " + walNum + " unfinished WALs" : 
"");
         }
     }
 
@@ -210,10 +210,6 @@ public class SystemHandler extends AlterHandler {
         return false;
     }
 
-    private boolean checkWal(Backend backend) {
-        return 
Env.getCurrentEnv().getGroupCommitManager().getAllWalQueueSize(backend) == 0;
-    }
-
     private List<Backend> checkDecommission(DecommissionBackendClause 
decommissionBackendClause)
             throws DdlException {
         if (decommissionBackendClause.getHostInfos().isEmpty()) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java 
b/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
index 1009c4257b8..e4dd77e3e20 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/GroupCommitManager.java
@@ -106,7 +106,7 @@ public class GroupCommitManager {
     /**
      * Check the wal before the endTransactionId is finished or not.
      */
-    public boolean isPreviousWalFinished(long tableId, List<Long> aliveBeIds) {
+    private boolean isPreviousWalFinished(long tableId, List<Long> aliveBeIds) 
{
         boolean empty = true;
         for (int i = 0; i < aliveBeIds.size(); i++) {
             Backend backend = 
Env.getCurrentSystemInfo().getBackend(aliveBeIds.get(i));
@@ -137,7 +137,7 @@ public class GroupCommitManager {
         return size;
     }
 
-    public long getWalQueueSize(Backend backend, PGetWalQueueSizeRequest 
request) {
+    private long getWalQueueSize(Backend backend, PGetWalQueueSizeRequest 
request) {
         PGetWalQueueSizeResponse response = null;
         long expireTime = System.currentTimeMillis() + 
Config.check_wal_queue_timeout_threshold;
         long size = 0;
@@ -376,7 +376,7 @@ public class GroupCommitManager {
         }
     }
 
-    public void updateLoadDataInternal(long tableId, long receiveData) {
+    private void updateLoadDataInternal(long tableId, long receiveData) {
         if (tableToPressureMap.containsKey(tableId)) {
             tableToPressureMap.get(tableId).add(receiveData);
             LOG.info("Update load data for table{}, receiveData {}, 
tablePressureMap {}", tableId, receiveData,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to