You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2024/02/28 05:09:28 UTC

(doris) 22/22: [fix](fe ut) fix TabletRepairAndBalanceTest (#31397)

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 7a42d3b52cb43ac5628ff311ba0d56359a6797e9
Author: yujun <yu...@gmail.com>
AuthorDate: Wed Feb 28 13:03:31 2024 +0800

    [fix](fe ut) fix TabletRepairAndBalanceTest (#31397)
---
 .../apache/doris/clone/TabletRepairAndBalanceTest.java    | 15 ++++++++++-----
 .../org/apache/doris/utframe/MockedBackendFactory.java    |  7 ++++---
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/fe/fe-core/src/test/java/org/apache/doris/clone/TabletRepairAndBalanceTest.java b/fe/fe-core/src/test/java/org/apache/doris/clone/TabletRepairAndBalanceTest.java
index 979943b1609..0417a525b8b 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/clone/TabletRepairAndBalanceTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/clone/TabletRepairAndBalanceTest.java
@@ -106,11 +106,15 @@ public class TabletRepairAndBalanceTest {
         FeConstants.runningUnitTest = true;
         System.out.println(runningDir);
         FeConstants.runningUnitTest = true;
+        Config.tablet_schedule_interval_ms = 100;
         Config.tablet_checker_interval_ms = 100;
         Config.tablet_repair_delay_factor_second = 1;
         Config.colocate_group_relocate_delay_second = 1;
-        Config.schedule_slot_num_per_hdd_path = 1000;
-        Config.schedule_slot_num_per_ssd_path = 1000;
+        Config.schedule_slot_num_per_hdd_path = 10000;
+        Config.schedule_slot_num_per_ssd_path = 10000;
+        Config.schedule_batch_size = 10000;
+        Config.disable_colocate_balance_between_groups = true;
+        Config.max_scheduling_tablets = 10000;
         Config.disable_balance = true;
         // 5 backends:
         // 127.0.0.1
@@ -322,7 +326,7 @@ public class TabletRepairAndBalanceTest {
         stmt = (AlterSystemStmt) UtFrameUtils.parseAndAnalyzeStmt(stmtStr, connectContext);
         DdlExecutor.execute(Env.getCurrentEnv(), stmt);
         Assert.assertEquals(tag2, be.getLocationTag());
-        ExceptionChecker.expectThrows(UserException.class, () -> tbl.checkReplicaAllocation());
+        Thread.sleep(5000);
         checkTableReplicaAllocation(tbl);
         Assert.assertEquals(90, replicaMetaTable.cellSet().size());
 
@@ -384,7 +388,8 @@ public class TabletRepairAndBalanceTest {
         stmt = (AlterSystemStmt) UtFrameUtils.parseAndAnalyzeStmt(stmtStr, connectContext);
         DdlExecutor.execute(Env.getCurrentEnv(), stmt);
         Assert.assertEquals(tag1, be.getLocationTag());
-        ExceptionChecker.expectThrows(UserException.class, () -> tbl.checkReplicaAllocation());
+        Thread.sleep(5000);
+        tbl.checkReplicaAllocation();
 
         checkTableReplicaAllocation(colTbl1);
         checkTableReplicaAllocation(colTbl2);
@@ -594,8 +599,8 @@ public class TabletRepairAndBalanceTest {
                 // it will increase the probability of map to throw NoSuchElementException exception.
                 System.out.println(e.getMessage());
             }
-            Thread.sleep(1000);
             System.out.println("wait table " + tbl.getId() + " to be stable");
+            Thread.sleep(1000);
         }
         ExceptionChecker.expectThrowsNoException(() -> tbl.checkReplicaAllocation());
         System.out.println("table " + tbl.getId() + " is stable");
diff --git a/fe/fe-core/src/test/java/org/apache/doris/utframe/MockedBackendFactory.java b/fe/fe-core/src/test/java/org/apache/doris/utframe/MockedBackendFactory.java
index bd1ae4c69e1..df346f5ed58 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/utframe/MockedBackendFactory.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/utframe/MockedBackendFactory.java
@@ -182,8 +182,8 @@ public class MockedBackendFactory {
                             if (address == null) {
                                 System.out.println("fe addr thread race, please check it");
                             }
-                            System.out.println(
-                                    "get agent task request. type: " + request.getTaskType() + ", signature: "
+                            System.out.println(backend.getHost() + ":" + backend.getHeartbeatPort() + " "
+                                    + "get agent task request. type: " + request.getTaskType() + ", signature: "
                                     + request.getSignature() + ", fe addr: " + address);
                             TFinishTaskRequest finishTaskRequest = new TFinishTaskRequest(tBackend,
                                     request.getTaskType(), request.getSignature(), new TStatus(TStatusCode.OK));
@@ -319,7 +319,8 @@ public class MockedBackendFactory {
         public TAgentResult submitTasks(List<TAgentTaskRequest> tasks) throws TException {
             for (TAgentTaskRequest request : tasks) {
                 taskQueue.add(request);
-                System.out.println("receive agent task request. type: " + request.getTaskType() + ", signature: "
+                System.out.println(backend.getHost() + ":" + backend.getHeartbeatPort() + " "
+                        + "receive agent task request. type: " + request.getTaskType() + ", signature: "
                         + request.getSignature());
             }
             return new TAgentResult(new TStatus(TStatusCode.OK));


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