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 59b6c9e8736 branch-3.0: [fix](meta) replace partition should not get 
table version in cloud mode #50888 (#51027)
59b6c9e8736 is described below

commit 59b6c9e8736736aadcbc5c7646264f3124cccad5
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue May 20 09:28:28 2025 +0800

    branch-3.0: [fix](meta) replace partition should not get table version in 
cloud mode #50888 (#51027)
    
    Cherry-picked from #50888
    
    Co-authored-by: zhangdong <[email protected]>
---
 .../src/main/java/org/apache/doris/catalog/Env.java       |  14 +++++++++-----
 regression-test/data/mtmv_p0/test_modify_data_mtmv.out    | Bin 0 -> 136 bytes
 .../suites/mtmv_p0/test_modify_data_mtmv.groovy           |  14 +++++++++++++-
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
index 49598e17c26..33d16730cf0 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
@@ -6139,13 +6139,13 @@ public class Env {
         List<Long> replacedPartitionIds = 
olapTable.replaceTempPartitions(db.getId(), partitionNames,
                 tempPartitionNames, isStrictRange,
                 useTempPartitionName, isForceDropOld);
-        long version;
+        long version = 0L;
         long versionTime = System.currentTimeMillis();
+        // In cloud mode, the internal partition deletion logic will update 
the table version,
+        // so here we only need to handle non-cloud mode.
         if (Config.isNotCloudMode()) {
             version = olapTable.getNextVersion();
             olapTable.updateVisibleVersionAndTime(version, versionTime);
-        } else {
-            version = olapTable.getVisibleVersion();
         }
         // Here, we only wait for the EventProcessor to finish processing the 
event,
         // but regardless of the success or failure of the result,
@@ -6182,8 +6182,12 @@ public class Env {
             olapTable.replaceTempPartitions(dbId, 
replaceTempPartitionLog.getPartitions(),
                     replaceTempPartitionLog.getTempPartitions(), 
replaceTempPartitionLog.isStrictRange(),
                     replaceTempPartitionLog.useTempPartitionName(), 
replaceTempPartitionLog.isForce());
-            
olapTable.updateVisibleVersionAndTime(replaceTempPartitionLog.getVersion(),
-                    replaceTempPartitionLog.getVersionTime());
+            // In cloud mode, the internal partition deletion logic will 
update the table version,
+            // so here we only need to handle non-cloud mode.
+            if (Config.isNotCloudMode()) {
+                
olapTable.updateVisibleVersionAndTime(replaceTempPartitionLog.getVersion(),
+                        replaceTempPartitionLog.getVersionTime());
+            }
         } catch (DdlException e) {
             throw new MetaNotFoundException(e);
         } finally {
diff --git a/regression-test/data/mtmv_p0/test_modify_data_mtmv.out 
b/regression-test/data/mtmv_p0/test_modify_data_mtmv.out
new file mode 100644
index 00000000000..020f125165c
Binary files /dev/null and 
b/regression-test/data/mtmv_p0/test_modify_data_mtmv.out differ
diff --git a/regression-test/suites/mtmv_p0/test_modify_data_mtmv.groovy 
b/regression-test/suites/mtmv_p0/test_modify_data_mtmv.groovy
index 421cca44f6c..6f1cc39d41c 100644
--- a/regression-test/suites/mtmv_p0/test_modify_data_mtmv.groovy
+++ b/regression-test/suites/mtmv_p0/test_modify_data_mtmv.groovy
@@ -47,13 +47,25 @@ suite("test_modify_data_mtmv","mtmv") {
         """
 
     sql """
-        insert into ${tableName} values(1,1),(2,2),(3,3);
+        insert into ${tableName} values(1,1);
         """
     sql """
         REFRESH MATERIALIZED VIEW ${mvName} AUTO
         """
     waitingMTMVTaskFinishedByMvName(mvName)
 
+    order_qt_insert """select * from ${mvName};"""
+
+    sql """
+        insert overwrite table ${tableName} values(2,2);
+        """
+    sql """
+        REFRESH MATERIALIZED VIEW ${mvName} AUTO
+        """
+    waitingMTMVTaskFinishedByMvName(mvName)
+
+    order_qt_overwrite """select * from ${mvName};"""
+
     // insert into mtmv
     test {
         sql """insert into ${mvName} values(1,1)"""


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

Reply via email to