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

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

commit 0d6ab3c68c1acc17892f0042b9ebab2bf0b46f45
Author: yujun <yu.jun.re...@gmail.com>
AuthorDate: Thu Jan 11 20:40:08 2024 +0800

    [chore](regression test) check disk is good (#29740)
---
 .../org/apache/doris/master/ReportHandler.java     |  7 ++++--
 .../storage_medium_p0/test_disk_health.groovy      | 27 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java 
b/fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java
index 2c8dc80affb..7d9d9ac825c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java
@@ -563,9 +563,12 @@ public class ReportHandler extends Daemon {
             LOG.warn("backend doesn't exist. id: " + backendId);
             return;
         }
+        List<String> badDisks = backendDisks.values().stream().filter(disk -> 
!disk.isUsed())
+                .map(disk -> "path=" + disk.getRootPath() + ", path hash=" + 
disk.getPathHash())
+                .collect(Collectors.toList());
         backend.updateDisks(backendDisks);
-        LOG.info("finished to handle disk report from backend {}, cost: {} ms",
-                backendId, (System.currentTimeMillis() - start));
+        LOG.info("finished to handle disk report from backend: {}, disk size: 
{}, bad disk: {}, cost: {} ms",
+                backendId, backendDisks.size(), badDisks, 
(System.currentTimeMillis() - start));
     }
 
     private static void cpuReport(long backendId, int cpuCores, int 
pipelineExecutorSize) {
diff --git a/regression-test/suites/storage_medium_p0/test_disk_health.groovy 
b/regression-test/suites/storage_medium_p0/test_disk_health.groovy
new file mode 100644
index 00000000000..70e76b2bd96
--- /dev/null
+++ b/regression-test/suites/storage_medium_p0/test_disk_health.groovy
@@ -0,0 +1,27 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite('test_disk_health', 'p0,p1,p2') {
+    def backends = sql_return_maparray "SHOW PROC '/backends'"
+    backends.each { be ->
+        def disks = sql_return_maparray "SHOW PROC '/backends/${be.BackendId}'"
+        assertTrue(disks.size() > 0, "backend ${be.Host} no disks".toString())
+        disks.each { disk ->
+            assertEquals('ONLINE', disk.State, "backend ${be.Host} disk 
${disk.RootPath} is bad")
+        }
+    }
+}


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

Reply via email to