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

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


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 410da0bad35 branch-4.0: [optimize](regression-case) Reduce the 
too_many_versions_detection case's run time #60043 (#60201)
410da0bad35 is described below

commit 410da0bad35970c619e12421d577a1b47fbcc3b0
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Jan 24 13:05:48 2026 +0800

    branch-4.0: [optimize](regression-case) Reduce the 
too_many_versions_detection case's run time #60043 (#60201)
    
    Cherry-picked from #60043
    
    Co-authored-by: Refrain <[email protected]>
---
 .../insert/test_too_many_versions_detection.groovy | 81 ++++++++++++++++------
 1 file changed, 60 insertions(+), 21 deletions(-)

diff --git 
a/regression-test/suites/load/insert/test_too_many_versions_detection.groovy 
b/regression-test/suites/load/insert/test_too_many_versions_detection.groovy
index 51acec36958..07fafec24e0 100644
--- a/regression-test/suites/load/insert/test_too_many_versions_detection.groovy
+++ b/regression-test/suites/load/insert/test_too_many_versions_detection.groovy
@@ -16,29 +16,68 @@
 // under the License.
 import java.sql.SQLException
 
-suite("too_many_versions_detection") {
-    sql """ DROP TABLE IF EXISTS t """
-
-    sql """
-        create table t(a int)
-        DUPLICATE KEY(a)
-        DISTRIBUTED BY HASH(a)
-        BUCKETS 10 PROPERTIES("replication_num" = "1", 
"disable_auto_compaction" = "true");
-    """
-
-    for (int i = 1; i <= 2000; i++) {
-        sql """ INSERT INTO t VALUES (${i}) """
+suite("too_many_versions_detection", "nonConcurrent") {
+    def backendId_to_backendIP = [:]
+    def backendId_to_backendHttpPort = [:]
+    getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort);
+    
+    def set_be_config = { key, value ->
+        for (String backend_id: backendId_to_backendIP.keySet()) {
+            def (code, out, err) = 
update_be_config(backendId_to_backendIP.get(backend_id), 
backendId_to_backendHttpPort.get(backend_id), key, value)
+            logger.info("update config: code=" + code + ", out=" + out + ", 
err=" + err)
+        }
     }
 
-    try {
-        sql """ INSERT INTO t VALUES (2001) """
-        assertTrue(false, "Expected TOO_MANY_VERSION error but none occurred")
-    } catch (SQLException e) {
-        logger.info("Exception caught: ${e.getMessage()}")
-        def expectedError = "failed to init rowset builder. version count: 
2001, exceed limit: 2000, tablet:"
-        assertTrue(e.getMessage().contains(expectedError),
-            "Expected TOO_MANY_VERSION error with message containing 
'${expectedError}', but got: ${e.getMessage()}")
+    def get_be_param = { paramName ->
+        def paramValue = ""
+        for (String id in backendId_to_backendIP.keySet()) {
+            def beIp = backendId_to_backendIP.get(id)
+            def bePort = backendId_to_backendHttpPort.get(id)
+            def (code, out, err) = curl("GET", 
String.format("http://%s:%s/api/show_config?conf_item=%s";, beIp, bePort, 
paramName))
+            logger.info("get config: code=" + code + ", out=" + out + ", err=" 
+ err)
+            assertTrue(code == 0)
+            assertTrue(out.contains(paramName))
+            def resultList = parseJson(out)[0]
+            assertTrue(resultList.size() == 4)
+            paramValue = resultList[2]
+            break // only need to get from one BE
+        }
+        return paramValue
     }
 
-    sql """ DROP TABLE IF EXISTS t """
+    // Read and save original config value
+    def originalMaxTabletVersionNum = get_be_param("max_tablet_version_num")
+    logger.info("Original max_tablet_version_num: 
${originalMaxTabletVersionNum}")
+    
+    try {
+        set_be_config("max_tablet_version_num", "200")
+
+        sql """ DROP TABLE IF EXISTS t """
+
+        sql """
+            create table t(a int)
+            DUPLICATE KEY(a)
+            DISTRIBUTED BY HASH(a)
+            BUCKETS 10 PROPERTIES("replication_num" = "1", 
"disable_auto_compaction" = "true");
+        """
+
+        for (int i = 1; i <= 200; i++) {
+            sql """ INSERT INTO t VALUES (${i}) """
+        }
+
+        try {
+            sql """ INSERT INTO t VALUES (201) """
+            assertTrue(false, "Expected TOO_MANY_VERSION error but none 
occurred")
+        } catch (SQLException e) {
+            logger.info("Exception caught: ${e.getMessage()}")
+            def expectedError = "failed to init rowset builder. version count: 
201, exceed limit: 200, tablet:"
+            assertTrue(e.getMessage().contains(expectedError),
+                "Expected TOO_MANY_VERSION error with message containing 
'${expectedError}', but got: ${e.getMessage()}")
+        }
+
+        sql """ DROP TABLE IF EXISTS t """
+    } finally {
+        // Restore original config
+        set_be_config("max_tablet_version_num", originalMaxTabletVersionNum)
+    }
 }
\ No newline at end of file


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

Reply via email to