shuke987 commented on code in PR #65453:
URL: https://github.com/apache/doris/pull/65453#discussion_r3586070533
##########
regression-test/suites/variant_p0/with_index/load.groovy:
##########
@@ -58,7 +58,8 @@ suite("regression_test_variant_with_index", "p0"){
build_index_on_table("inv_idx", table_name)
- wait_for_last_schema_change_finish(table_name, timeout)
+ wait_for_last_col_change_finish(table_name, timeout)
+ wait_for_last_build_index_finish(table_name, timeout)
Review Comment:
Fixed in 2fb05cbd149. The variant drop path now waits for the schema job
plus all new Cloud delete jobs. Its create/build path waits for schema
completion before BUILD INDEX, snapshots existing JobIds, and waits for every
new build job.
##########
regression-test/plugins/plugin_index_change.groovy:
##########
@@ -24,21 +24,30 @@ import java.util.regex.Pattern;
def delta_time = 1000
Suite.metaClass.wait_for_last_build_index_finish = {table_name, OpTimeout ->
- def useTime = 0
- for(int t = delta_time; t <= OpTimeout; t += delta_time){
- def alter_res = sql """SHOW BUILD INDEX WHERE TableName =
"${table_name}" ORDER BY CreateTime DESC LIMIT 1;"""
+ def finished = false
+ def alter_res = []
+ for(int t = 0; t <= OpTimeout; t += delta_time){
+ alter_res = sql """SHOW BUILD INDEX WHERE TableName = "${table_name}"
ORDER BY CreateTime DESC LIMIT 1;"""
+ if (alter_res.isEmpty()) {
+ logger.info(table_name + " has no build index job to wait for")
Review Comment:
Fixed in 2fb05cbd149. The helper no longer accepts an empty result as
success. Explicit build/delete callers snapshot existing JobIds before the DDL
and pass that snapshot to the strict wait, which filters all newly created
rows, fails on any new CANCELLED job, and requires the complete new-job set to
be FINISHED and stable across two polls. Schema-only callers were moved to the
column-change wait.
##########
regression-test/plugins/plugin_index_change.groovy:
##########
@@ -51,25 +60,28 @@ Suite.metaClass.build_index_on_table = {index_name,
table_name ->
}
Suite.metaClass.wait_for_last_col_change_finish = { table_name, OpTimeout ->
- def useTime = 0
+ def finished = false
+ def alter_res = ""
- for (int t = delta_time; t <= OpTimeout; t += delta_time) {
- def alter_res = sql """SHOW ALTER TABLE COLUMN WHERE TableName =
"${table_name}" ORDER BY CreateTime DESC LIMIT 1;"""
+ for (int t = 0; 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)
+ finished = true
+ break
+ }
+ if (t >= OpTimeout) {
break
}
- useTime = t
sleep(delta_time)
}
- assertTrue(useTime <= OpTimeout, "wait_for_last_col_change_finish timeout")
+ assertTrue(finished, "wait_for_last_col_change_finish timeout, latest
result: ${alter_res}")
}
Suite.metaClass.wait_for_last_schema_change_finish = {table_name, OpTimeout ->
wait_for_last_col_change_finish(table_name, OpTimeout)
Review Comment:
Fixed in 2fb05cbd149. Cloud full-table DROP INDEX callers now snapshot
existing build-index JobIds before the drop, wait for the column/schema job,
and then wait for all newly created delete jobs. Schema-only create-index
callers remain column-only.
##########
regression-test/suites/inverted_index_p0/index_change/test_index_change_4.groovy:
##########
@@ -39,12 +39,15 @@ suite("test_index_change_4") {
if (finished_num == expected_finished_num) {
sleep(10000)
logger.info(table_name + " all build index jobs finished,
detail: " + alter_res)
+ finished = true
+ break
Review Comment:
Fixed in 2fb05cbd149. The suite-local V1 helper now requires a nonempty SHOW
BUILD INDEX result before can succeed, so zero rows remain pending and
eventually time out.
##########
regression-test/plugins/plugin_index_change.groovy:
##########
@@ -51,25 +60,28 @@ Suite.metaClass.build_index_on_table = {index_name,
table_name ->
}
Suite.metaClass.wait_for_last_col_change_finish = { table_name, OpTimeout ->
- def useTime = 0
+ def finished = false
+ def alter_res = ""
- for (int t = delta_time; t <= OpTimeout; t += delta_time) {
- def alter_res = sql """SHOW ALTER TABLE COLUMN WHERE TableName =
"${table_name}" ORDER BY CreateTime DESC LIMIT 1;"""
+ for (int t = 0; 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)
+ finished = true
+ break
+ }
+ if (t >= OpTimeout) {
break
}
- useTime = t
sleep(delta_time)
}
- assertTrue(useTime <= OpTimeout, "wait_for_last_col_change_finish timeout")
+ assertTrue(finished, "wait_for_last_col_change_finish timeout, latest
result: ${alter_res}")
}
Suite.metaClass.wait_for_last_schema_change_finish = {table_name, OpTimeout ->
wait_for_last_col_change_finish(table_name, OpTimeout)
- wait_for_last_build_index_finish(table_name, OpTimeout)
Review Comment:
Fixed in 2fb05cbd149. now snapshots existing JobIds before the Cloud
full-table drop, waits for the schema job, and then waits for all newly created
delete jobs before creating the next 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]