From 4e3f55de80a018b7221095837608b213e537ba07 Mon Sep 17 00:00:00 2001 From: shuke Date: Thu, 2 Jul 2026 15:01:17 +0800 Subject: [PATCH] [regression-test](variant) Fix schema change wait timeout (#65139) ### What problem does this PR solve? Fixes a flaky Cloud P0 failure in `variant_p0/schema_change/schema_change.groovy`. The case waits for the latest schema-change job before issuing the next ALTER. The old helper could return after timeout without observing `FINISHED`, because `useTime == OpTimeout` still passed `assertTrue(useTime <= OpTimeout)`. Then the case could run `DROP INDEX` while the table was still in `SCHEMA_CHANGE`. Remote logs from a failing run showed: - the case polled `SHOW ALTER TABLE COLUMN` for about 60s without logging `latest alter job finished` - `DROP INDEX` failed about 9s before the schema-change job actually finished - the schema-change RUNNING phase took about 69s in that run ### How is this fixed? - Increase the schema-change wait timeout from 60s to 120s. - Make the helper require an explicit `FINISHED` observation. - Include the last `SHOW ALTER TABLE COLUMN` result in the timeout failure message. ### Check - `git diff --check` No local regression rerun was performed. --- .../variant_p0/schema_change/schema_change.groovy | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/regression-test/suites/variant_p0/schema_change/schema_change.groovy b/regression-test/suites/variant_p0/schema_change/schema_change.groovy index e144d2972d0a9b..5d1cbf7248d971 100644 --- a/regression-test/suites/variant_p0/schema_change/schema_change.groovy +++ b/regression-test/suites/variant_p0/schema_change/schema_change.groovy @@ -28,22 +28,23 @@ suite("regression_test_variant_schema_change", "variant_type"){ DISTRIBUTED BY HASH(k) BUCKETS 4 properties("replication_num" = "1"); """ - def timeout = 60000 + def timeout = 120000 def delta_time = 1000 - def useTime = 0 def wait_for_latest_op_on_table_finish = { tableName, OpTimeout -> - for(int t = delta_time; t <= OpTimeout; t += delta_time){ - def alter_res = sql """SHOW ALTER TABLE COLUMN WHERE TableName = "${tableName}" ORDER BY CreateTime DESC LIMIT 1;""" + boolean finished = false + def alter_res = null + for (int t = delta_time; t <= OpTimeout; t += delta_time) { + alter_res = sql """SHOW ALTER TABLE COLUMN WHERE TableName = "${tableName}" ORDER BY CreateTime DESC LIMIT 1;""" alter_res = alter_res.toString() if(alter_res.contains("FINISHED")) { sleep(3000) // wait change table state to normal logger.info(tableName + " latest alter job finished, detail: " + alter_res) + finished = true break } - useTime = t sleep(delta_time) } - assertTrue(useTime <= OpTimeout, "wait_for_latest_op_on_table_finish timeout") + assertTrue(finished, "wait_for_latest_op_on_table_finish timeout, last alter result: " + alter_res) } // sql "set experimental_enable_nereids_planner = true" @@ -112,4 +113,4 @@ suite("regression_test_variant_schema_change", "variant_type"){ sql """insert into t values (7, '{"a" : 11111.11111}')""" trigger_and_wait_compaction("t", "cumulative", 1800) qt_sql "select * from t order by col0 limit 3" -} \ No newline at end of file +}