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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 3e74625d789 Fix analyze mv from follower case bug. (#31523) (#31691)
3e74625d789 is described below

commit 3e74625d789a6dd983e2206effb7823c12859776
Author: Jibing-Li <64681310+jibing...@users.noreply.github.com>
AuthorDate: Sat Mar 2 22:52:44 2024 +0800

    Fix analyze mv from follower case bug. (#31523) (#31691)
---
 .../suites/statistics/test_analyze_mv.groovy       | 41 ++++++++++++++--------
 1 file changed, 27 insertions(+), 14 deletions(-)

diff --git a/regression-test/suites/statistics/test_analyze_mv.groovy 
b/regression-test/suites/statistics/test_analyze_mv.groovy
index 884ae2c5f50..f7fdd7beda6 100644
--- a/regression-test/suites/statistics/test_analyze_mv.groovy
+++ b/regression-test/suites/statistics/test_analyze_mv.groovy
@@ -34,22 +34,35 @@ suite("test_analyze_mv") {
         }
     }
 
-    def wait_row_count_reported = { ->
-        while(true) {
-            Thread.sleep(5000)
-            boolean reported = true;
-            def result = sql """SHOW DATA;"""
-            logger.info("result " + result)
-            for (int i = 0; i < result.size(); i++) {
-                if (result[i][1] == "0.000 ") {
-                    reported = false;
-                    break;
-                }
+    def wait_row_count_reported = { db, table, expected ->
+        def result = sql """show frontends;"""
+        logger.info("show frontends result origin: " + result)
+        def host
+        def port
+        for (int i = 0; i < result.size(); i++) {
+            if (result[i][7] == "true") {
+                host = result[i][1]
+                port = result[i][4]
             }
-            if (reported) {
-                break;
+        }
+        def tokens = context.config.jdbcUrl.split('/')
+        def url=tokens[0] + "//" + host + ":" + port
+        logger.info("Master url is " + url)
+        connect(user = context.config.jdbcUser, password = 
context.config.jdbcPassword, url) {
+            sql """use ${db}"""
+            result = sql """show frontends;"""
+            logger.info("show frontends result master: " + result)
+            for (int i = 0; i < 120; i++) {
+                Thread.sleep(5000)
+                result = sql """SHOW DATA FROM ${table};"""
+                logger.info("result " + result)
+                if (result[3][4] == expected) {
+                    return;
+                }
             }
+            throw new Exception("Row count report timeout.")
         }
+
     }
 
     def wait_analyze_finish = { table ->
@@ -402,12 +415,12 @@ suite("test_analyze_mv") {
     assertEquals("4001", result_sample[0][8])
     assertEquals("FULL", result_sample[0][9])
 
-    wait_row_count_reported()
     sql """drop stats mvTestDup"""
     result_sample = sql """show column stats mvTestDup"""
     assertEquals(0, result_sample.size())
 
     // Test sample
+    wait_row_count_reported("test_analyze_mv", "mvTestDup", "6")
     sql """analyze table mvTestDup with sample rows 4000000"""
     wait_analyze_finish("mvTestDup")
     result_sample = sql """SHOW ANALYZE mvTestDup;"""


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

Reply via email to