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

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


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 6d89c1ba036 branch-3.1: [fix](test) Force meta sync to avoid stale 
meta data on follower fe when mv rewrite #54296 (#54461)
6d89c1ba036 is described below

commit 6d89c1ba036a16bbb27d72499c1651e3fdc09292
Author: seawinde <[email protected]>
AuthorDate: Fri Aug 8 14:02:13 2025 +0800

    branch-3.1: [fix](test) Force meta sync to avoid stale meta data on 
follower fe when mv rewrite #54296 (#54461)
    
    picked from #54296
---
 .../org/apache/doris/regression/suite/Suite.groovy | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
index e7d038a44eb..b8a1fb259ed 100644
--- 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
+++ 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
@@ -2062,6 +2062,7 @@ class Suite implements GroovyInterceptable {
         AS ${mv_sql}
         """
         waitingMVTaskFinishedByMvName(db, table_name, mv_name)
+        sql """sync;"""
     }
 
     def create_async_mv = { db, mv_name, mv_sql ->
@@ -2077,6 +2078,8 @@ class Suite implements GroovyInterceptable {
         def job_name = getJobName(db, mv_name);
         waitingMTMVTaskFinished(job_name)
         sql "analyze table ${db}.${mv_name} with sync;"
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
     }
 
     def create_async_partition_mv = { db, mv_name, mv_sql, partition_col ->
@@ -2093,6 +2096,8 @@ class Suite implements GroovyInterceptable {
         def job_name = getJobName(db, mv_name);
         waitingMTMVTaskFinished(job_name)
         sql "analyze table ${db}.${mv_name} with sync;"
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
     }
 
     // mv not part in rewrite process
@@ -2153,6 +2158,8 @@ class Suite implements GroovyInterceptable {
                                is_partition_statistics_ready = true) {
         logger.info("query_sql = " + query_sql + ", mv_name = " + mv_name + ", 
sync_cbo_rewrite = " +sync_cbo_rewrite
                 + ", is_partition_statistics_ready = " + 
is_partition_statistics_ready)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!is_partition_statistics_ready) {
             // If partition statistics is no ready, degrade to without check 
cbo chosen
             mv_rewrite_success_without_check_chosen(query_sql, mv_name, 
sync_cbo_rewrite)
@@ -2179,6 +2186,8 @@ class Suite implements GroovyInterceptable {
                                    is_partition_statistics_ready = true) {
         logger.info("query_sql = " + query_sql + ", mv_names = " + mv_names + 
", sync_cbo_rewrite = " +sync_cbo_rewrite
                 + ", is_partition_statistics_ready = " + 
is_partition_statistics_ready)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!is_partition_statistics_ready) {
             // If partition statistics is no ready, degrade to without check 
cbo chosen
             mv_rewrite_all_success_without_check_chosen(query_sql, mv_names, 
sync_cbo_rewrite)
@@ -2223,6 +2232,8 @@ class Suite implements GroovyInterceptable {
                                    is_partition_statistics_ready = true) {
         logger.info("query_sql = " + query_sql + ", mv_names = " + mv_names + 
", sync_cbo_rewrite = " +sync_cbo_rewrite
                 + ", is_partition_statistics_ready = " + 
is_partition_statistics_ready)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!is_partition_statistics_ready) {
             // If partition statistics is no ready, degrade to without check 
cbo chosen
             mv_rewrite_any_success_without_check_chosen(query_sql, mv_names, 
sync_cbo_rewrite)
@@ -2264,6 +2275,8 @@ class Suite implements GroovyInterceptable {
     void mv_rewrite_all_success_without_check_chosen(query_sql, mv_names,
                                                         sync_cbo_rewrite = 
enable_sync_mv_cost_based_rewrite()){
         logger.info("query_sql = " + query_sql + ", mv_names = " + mv_names)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!sync_cbo_rewrite) {
             explain {
                 sql("${query_sql}")
@@ -2303,6 +2316,8 @@ class Suite implements GroovyInterceptable {
     void mv_rewrite_any_success_without_check_chosen(query_sql, mv_names,
                                                      sync_cbo_rewrite = 
enable_sync_mv_cost_based_rewrite()) {
         logger.info("query_sql = " + query_sql + ", mv_names = " + mv_names)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!sync_cbo_rewrite) {
             explain {
                 sql("${query_sql}")
@@ -2341,6 +2356,8 @@ class Suite implements GroovyInterceptable {
     void mv_rewrite_success_without_check_chosen(query_sql, mv_name,
                                                  sync_cbo_rewrite = 
enable_sync_mv_cost_based_rewrite()) {
         logger.info("query_sql = " + query_sql + ", mv_name = " + mv_name)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!sync_cbo_rewrite) {
             explain {
                 sql("${query_sql}")
@@ -2363,6 +2380,8 @@ class Suite implements GroovyInterceptable {
     // sync_cbo_rewrite is the bool value which control sync mv is use cbo 
based mv rewrite
     void mv_rewrite_fail(query_sql, mv_name, sync_cbo_rewrite = 
enable_sync_mv_cost_based_rewrite()) {
         logger.info("query_sql = " + query_sql + ", mv_name = " + mv_name)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!sync_cbo_rewrite) {
             explain {
                 sql("${query_sql}")
@@ -2380,6 +2399,8 @@ class Suite implements GroovyInterceptable {
     // sync_cbo_rewrite is the bool value which control sync mv is use cbo 
based mv rewrite
     void mv_rewrite_all_fail(query_sql, mv_names, sync_cbo_rewrite = 
enable_sync_mv_cost_based_rewrite()) {
         logger.info("query_sql = " + query_sql + ", mv_names = " + mv_names)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!sync_cbo_rewrite) {
             explain {
                 sql("${query_sql}")
@@ -2417,6 +2438,8 @@ class Suite implements GroovyInterceptable {
     // sync_cbo_rewrite is the bool value which control sync mv is use cbo 
based mv rewrite
     void mv_rewrite_any_fail (query_sql, mv_names, sync_cbo_rewrite = 
enable_sync_mv_cost_based_rewrite()) {
         logger.info("query_sql = " + query_sql + ", mv_names = " + mv_names)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         if (!sync_cbo_rewrite) {
             explain {
                 sql("${query_sql}")
@@ -2460,6 +2483,8 @@ class Suite implements GroovyInterceptable {
         """
         def job_name = getJobName(db, mv_name);
         waitingMTMVTaskFinished(job_name)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         mv_rewrite_success(query_sql, mv_name, true)
     }
 
@@ -2476,6 +2501,8 @@ class Suite implements GroovyInterceptable {
 
         def job_name = getJobName(db, mv_name);
         waitingMTMVTaskFinished(job_name)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         mv_rewrite_success_without_check_chosen(query_sql, mv_name, true)
     }
 
@@ -2493,6 +2520,8 @@ class Suite implements GroovyInterceptable {
 
         def job_name = getJobName(db, mv_name);
         waitingMTMVTaskFinished(job_name)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
         mv_rewrite_fail(query_sql, mv_name, true)
     }
 
@@ -2508,6 +2537,8 @@ class Suite implements GroovyInterceptable {
 
         def job_name = getJobName(db, mv_name);
         waitingMTMVTaskFinished(job_name)
+        // force meta sync to avoid stale meta data on follower fe
+        sql """sync;"""
     }
 
     def token = context.config.metaServiceToken


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to