This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push: new 7043db6401f [fix](regression test) fix test_schema_change_fail due to set force_olap_table_replication_num #34343 (#37861) 7043db6401f is described below commit 7043db6401fd86c044a4f99c38caa6e374b7c29f Author: yujun <yu.jun.re...@gmail.com> AuthorDate: Wed Jul 17 22:48:20 2024 +0800 [fix](regression test) fix test_schema_change_fail due to set force_olap_table_replication_num #34343 (#37861) cherry pick from #34343 --- .../test_schema_change_fail.groovy | 62 ++++++++++++---------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/regression-test/suites/schema_change_p2/test_schema_change_fail.groovy b/regression-test/suites/schema_change_p2/test_schema_change_fail.groovy index 8dc65365c39..e93bd15c4c1 100644 --- a/regression-test/suites/schema_change_p2/test_schema_change_fail.groovy +++ b/regression-test/suites/schema_change_p2/test_schema_change_fail.groovy @@ -27,50 +27,56 @@ suite('test_schema_change_fail', 'p0,p2,nonConcurrent') { } def tbl = 'test_schema_change_fail' - - def beId = backends[0].BackendId.toLong() - def beHost = backends[0].Host - def beHttpPort = backends[0].HttpPort.toInteger() def injectName = 'SchemaChangeJob.process_alter_tablet.alter_fail' + def injectBe = null def checkReplicaBad = { -> def tabletId = sql_return_maparray("SHOW TABLETS FROM ${tbl}")[0].TabletId.toLong() def replicas = sql_return_maparray(sql_return_maparray("SHOW TABLET ${tabletId}").DetailCmd) - assertEquals(backends.size(), replicas.size()) + int badReplicaNum = 0 for (def replica : replicas) { - if (replica.BackendId.toLong() == beId) { + if (replica.BackendId.toLong() == injectBe.BackendId.toLong()) { assertEquals(true, replica.IsBad.toBoolean()) + badReplicaNum++ + } else { + assertEquals(false, replica.IsBad.toBoolean()) } } + assertEquals(1, badReplicaNum) } def followFe = frontends.stream().filter(fe -> !fe.IsMaster.toBoolean()).findFirst().orElse(null) def followFeUrl = "jdbc:mysql://${followFe.Host}:${followFe.QueryPort}/?useLocalSessionState=false&allowLoadLocalInfile=false" followFeUrl = context.config.buildUrlWithDb(followFeUrl, context.dbName) - sql "DROP TABLE IF EXISTS ${tbl} FORCE" - sql """ - CREATE TABLE ${tbl} - ( - `a` TINYINT NOT NULL, - `b` TINYINT NULL - ) - UNIQUE KEY (`a`) - DISTRIBUTED BY HASH(`a`) BUCKETS 1 - PROPERTIES - ( - 'replication_num' = '${backends.size()}', - 'light_schema_change' = 'false' - ) - """ - - sql "INSERT INTO ${tbl} VALUES (1, 2), (3, 4)" - try { - DebugPoint.enableDebugPoint(beHost, beHttpPort, NodeType.BE, injectName) setFeConfig('disable_tablet_scheduler', true) - sleep(1000) + sleep(3000) + + sql "DROP TABLE IF EXISTS ${tbl} FORCE" + sql """ + CREATE TABLE ${tbl} + ( + `a` TINYINT NOT NULL, + `b` TINYINT NULL + ) + UNIQUE KEY (`a`) + DISTRIBUTED BY HASH(`a`) BUCKETS 1 + PROPERTIES + ( + 'replication_num' = '${backends.size()}', + 'light_schema_change' = 'false' + ) + """ + + def injectBeId = sql_return_maparray("SHOW TABLETS FROM ${tbl}")[0].BackendId.toLong() + injectBe = backends.stream().filter(be -> be.BackendId.toLong() == injectBeId).findFirst().orElse(null) + assertNotNull(injectBe) + + sql "INSERT INTO ${tbl} VALUES (1, 2), (3, 4)" + + DebugPoint.enableDebugPoint(injectBe.Host, injectBe.HttpPort.toInteger(), NodeType.BE, injectName) sql "ALTER TABLE ${tbl} MODIFY COLUMN b DOUBLE" sleep(5 * 1000) @@ -83,8 +89,10 @@ suite('test_schema_change_fail', 'p0,p2,nonConcurrent') { checkReplicaBad() } } finally { - DebugPoint.disableDebugPoint(beHost, beHttpPort, NodeType.BE, injectName) setFeConfig('disable_tablet_scheduler', false) + if (injectBe != null) { + DebugPoint.disableDebugPoint(injectBe.Host, injectBe.HttpPort.toInteger(), NodeType.BE, injectName) + } sql "DROP TABLE IF EXISTS ${tbl} FORCE" } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org