github-actions[bot] commented on code in PR #68125: URL: https://github.com/apache/doris/pull/68125#discussion_r4226792672
########## regression-test/suites/inverted_index_p0/test_build_index_read_time_hidden_column.groovy: ########## @@ -0,0 +1,126 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("test_build_index_read_time_hidden_column", "nonConcurrent") { + // BUILD INDEX rebuilds the indexes of existing rowsets through IndexBuilder in local mode only. + if (isCloudMode()) { + return + } + + def timeout = 60000 + def delta_time = 1000 + def alter_res = "null" + def useTime = 0 + + def wait_for_latest_op_on_table_finish = { table_name, OpTimeout -> + for (int t = delta_time; t <= OpTimeout; t += delta_time) { + alter_res = sql """SHOW ALTER TABLE COLUMN WHERE TableName = "${table_name}" 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(table_name + " latest alter job finished, detail: " + alter_res) + break + } + useTime = t + sleep(delta_time) + } + assertTrue(useTime <= OpTimeout, "wait_for_latest_op_on_table_finish timeout") + } + + def wait_for_build_index_on_partition_finish = { table_name, OpTimeout -> + for (int t = delta_time; t <= OpTimeout; t += delta_time) { + alter_res = sql """SHOW BUILD INDEX WHERE TableName = "${table_name}";""" + def expected_finished_num = alter_res.size() + def finished_num = 0 + for (int i = 0; i < expected_finished_num; i++) { + logger.info(table_name + " build index job state: " + alter_res[i][7] + i) + if (alter_res[i][7] == "FINISHED") { + ++finished_num + } + } + if (finished_num == expected_finished_num) { Review Comment: [P2] Require the online index job to finish in this regression. An empty `SHOW BUILD INDEX` result makes `finished_num == expected_finished_num` true at once, and after a timeout `useTime <= OpTimeout` remains true even if every job is still running. Since the result queries can be answered by a scan, the test can pass without exercising the multi-version index build this change fixes. Require a nonempty job list, fail unless all jobs reach `FINISHED`, and check that the query uses the built index. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
