From 338fda5f48b6f40294dce376503d01ca14cf8027 Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Fri, 14 Mar 2025 12:04:23 +0800 Subject: [PATCH 1/6] [fix](cloud-schema-change) Remove schema change job even if alter version < 2 --- cloud/src/meta-service/meta_service_job.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cloud/src/meta-service/meta_service_job.cpp b/cloud/src/meta-service/meta_service_job.cpp index 6336e97477fbe3..186c80dad4a9ac 100644 --- a/cloud/src/meta-service/meta_service_job.cpp +++ b/cloud/src/meta-service/meta_service_job.cpp @@ -1196,9 +1196,10 @@ void process_schema_change_job(MetaServiceCode& code, std::string& msg, std::str msg = "invalid alter_version"; return; } - if (schema_change.alter_version() < 2) { // no need to update stats - // TODO(cyx): clear schema_change job? + if (schema_change.alter_version() < 2) { + // no need to update stats if (!new_tablet_job_val.empty()) { + new_recorded_job.clear_schema_change(); auto& compactions = *new_recorded_job.mutable_compaction(); auto origin_size = compactions.size(); compactions.erase( From 9c7a67bac5fb5f4a5e375923fef07bfb3f2b45fe Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Wed, 26 Mar 2025 17:28:02 +0800 Subject: [PATCH 2/6] add test case --- .../test_base_compaction_after_sc.out | 7 + .../test_base_compaction_after_sc.groovy | 222 ++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 regression-test/data/compaction/test_base_compaction_after_sc.out create mode 100644 regression-test/suites/compaction/test_base_compaction_after_sc.groovy diff --git a/regression-test/data/compaction/test_base_compaction_after_sc.out b/regression-test/data/compaction/test_base_compaction_after_sc.out new file mode 100644 index 00000000000000..fe77c6391c1faa --- /dev/null +++ b/regression-test/data/compaction/test_base_compaction_after_sc.out @@ -0,0 +1,7 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !select_default -- +6001215 + +-- !select_default2 -- +6001215 + diff --git a/regression-test/suites/compaction/test_base_compaction_after_sc.groovy b/regression-test/suites/compaction/test_base_compaction_after_sc.groovy new file mode 100644 index 00000000000000..0734e10f911469 --- /dev/null +++ b/regression-test/suites/compaction/test_base_compaction_after_sc.groovy @@ -0,0 +1,222 @@ +// 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. + +import org.codehaus.groovy.runtime.IOGroovyMethods +import org.awaitility.Awaitility + +suite("test_base_compaction_after_sc") { + def tableName = "test_base_compaction_after_sc" + + String backend_id; + def backendId_to_backendIP = [:] + def backendId_to_backendHttpPort = [:] + getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); + + backend_id = backendId_to_backendIP.keySet()[0] + def (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) + assertEquals(code, 0) + def configList = parseJson(out.trim()) + assert configList instanceof List + + sql """ DROP TABLE IF EXISTS ${tableName} """ + sql """ + CREATE TABLE IF NOT EXISTS ${tableName} ( + L_ORDERKEY INTEGER NOT NULL, + L_PARTKEY INTEGER NOT NULL, + L_SUPPKEY INTEGER NOT NULL, + L_LINENUMBER INTEGER NOT NULL, + L_QUANTITY DECIMAL(15,2) NOT NULL, + L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL, + L_DISCOUNT DECIMAL(15,2) NOT NULL, + L_TAX DECIMAL(15,2) NOT NULL, + L_RETURNFLAG CHAR(1) NOT NULL, + L_LINESTATUS CHAR(1) NOT NULL, + L_SHIPDATE DATE NOT NULL, + L_COMMITDATE DATE NOT NULL, + L_RECEIPTDATE DATE NOT NULL, + L_SHIPINSTRUCT CHAR(25) NOT NULL, + L_SHIPMODE CHAR(10) NOT NULL, + L_COMMENT VARCHAR(44) NOT NULL + ) + UNIQUE KEY(L_ORDERKEY, L_PARTKEY, L_SUPPKEY, L_LINENUMBER) + DISTRIBUTED BY HASH(L_ORDERKEY) BUCKETS 1 + PROPERTIES ( + "replication_num" = "1", + "disable_auto_compaction" = "true" + ) + + """ + sql """ ALTER TABLE MODIFY COLUMN L_COMMENT CHAR(44) NOT NULL """ + + def wait_for_schema_change = { + def try_times=100 + while(true){ + def res = sql " SHOW ALTER TABLE COLUMN WHERE TableName = '${tableName}' ORDER BY CreateTime DESC LIMIT 1 " + Thread.sleep(10) + if(res[0][9].toString() == "FINISHED"){ + break; + } + assert(try_times>0) + try_times-- + } + } + wait_for_schema_change() + + streamLoad { + // a default db 'regression_test' is specified in + // ${DORIS_HOME}/conf/regression-conf.groovy + table tableName + + // default label is UUID: + // set 'label' UUID.randomUUID().toString() + + // default column_separator is specify in doris fe config, usually is '\t'. + // this line change to ',' + set 'column_separator', '|' + set 'compress_type', 'GZ' + + // relate to ${DORIS_HOME}/regression-test/data/demo/streamload_input.csv. + // also, you can stream load a http stream, e.g. http://xxx/some.csv + file """${getS3Url()}/regression/tpch/sf1/lineitem.csv.split01.gz""" + + time 10000 // limit inflight 10s + + // stream load action will check result, include Success status, and NumberTotalRows == NumberLoadedRows + + // if declared a check callback, the default check condition will ignore. + // So you must check all condition + check { result, exception, startTime, endTime -> + if (exception != null) { + throw exception + } + log.info("Stream load result: ${result}".toString()) + def json = parseJson(result) + assertEquals("success", json.Status.toLowerCase()) + assertEquals(json.NumberTotalRows, json.NumberLoadedRows) + assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0) + } + } + + streamLoad { + // a default db 'regression_test' is specified in + // ${DORIS_HOME}/conf/regression-conf.groovy + table tableName + + // default label is UUID: + // set 'label' UUID.randomUUID().toString() + + // default column_separator is specify in doris fe config, usually is '\t'. + // this line change to ',' + set 'column_separator', '|' + set 'compress_type', 'GZ' + + // relate to ${DORIS_HOME}/regression-test/data/demo/streamload_input.csv. + // also, you can stream load a http stream, e.g. http://xxx/some.csv + file """${getS3Url()}/regression/tpch/sf1/lineitem.csv.split01.gz""" + + time 10000 // limit inflight 10s + + // stream load action will check result, include Success status, and NumberTotalRows == NumberLoadedRows + + // if declared a check callback, the default check condition will ignore. + // So you must check all condition + check { result, exception, startTime, endTime -> + if (exception != null) { + throw exception + } + log.info("Stream load result: ${result}".toString()) + def json = parseJson(result) + assertEquals("success", json.Status.toLowerCase()) + assertEquals(json.NumberTotalRows, json.NumberLoadedRows) + assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0) + } + } + + def tablets = sql_return_maparray """ show tablets from ${tableName}; """ + + // trigger compactions for all tablets in ${tableName} + trigger_and_wait_compaction(tableName, "cumulative") + + streamLoad { + // a default db 'regression_test' is specified in + // ${DORIS_HOME}/conf/regression-conf.groovy + table tableName + + // default label is UUID: + // set 'label' UUID.randomUUID().toString() + + // default column_separator is specify in doris fe config, usually is '\t'. + // this line change to ',' + set 'column_separator', '|' + set 'compress_type', 'GZ' + + // relate to ${DORIS_HOME}/regression-test/data/demo/streamload_input.csv. + // also, you can stream load a http stream, e.g. http://xxx/some.csv + file """${getS3Url()}/regression/tpch/sf1/lineitem.csv.split00.gz""" + + time 10000 // limit inflight 10s + + // stream load action will check result, include Success status, and NumberTotalRows == NumberLoadedRows + + // if declared a check callback, the default check condition will ignore. + // So you must check all condition + check { result, exception, startTime, endTime -> + if (exception != null) { + throw exception + } + log.info("Stream load result: ${result}".toString()) + def json = parseJson(result) + assertEquals("success", json.Status.toLowerCase()) + assertEquals(json.NumberTotalRows, json.NumberLoadedRows) + assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0) + } + } + + // trigger compactions for all tablets in ${tableName} + trigger_and_wait_compaction(tableName, "cumulative") + qt_select_default """ SELECT count(*) FROM ${tableName} """ + + //TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,QueryHits,PathHash,MetaUrl,CompactionStatus + + // trigger compactions for all tablets in ${tableName} + trigger_and_wait_compaction(tableName, "base") + + def replicaNum = get_table_replica_num(tableName) + logger.info("get table replica num: " + replicaNum) + + int rowCount = 0 + for (def tablet in tablets) { + String tablet_id = tablet.TabletId + (code, out, err) = curl("GET", tablet.CompactionStatus) + logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) + assertEquals(code, 0) + def tabletJson = parseJson(out.trim()) + assert tabletJson.rowsets instanceof List + for (String rowset in (List) tabletJson.rowsets) { + rowCount += Integer.parseInt(rowset.split(" ")[1]) + } + } + assert (rowCount < 8 * replicaNum) + qt_select_default2 """ SELECT count(*) FROM ${tableName} """ + + (code, out, err) = be_get_overall_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Get overall compaction status: code=" + code + ", out=" + out + ", err=" + err) + assertEquals(code, 0) + assertTrue(out.toLowerCase().contains("basecompaction")) +} From 21686e12c4fea490a5bc220673dbd57be55af726 Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Wed, 26 Mar 2025 19:19:14 +0800 Subject: [PATCH 3/6] Update test_base_compaction_after_sc.groovy --- .../suites/compaction/test_base_compaction_after_sc.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression-test/suites/compaction/test_base_compaction_after_sc.groovy b/regression-test/suites/compaction/test_base_compaction_after_sc.groovy index 0734e10f911469..3838917955a181 100644 --- a/regression-test/suites/compaction/test_base_compaction_after_sc.groovy +++ b/regression-test/suites/compaction/test_base_compaction_after_sc.groovy @@ -62,7 +62,7 @@ suite("test_base_compaction_after_sc") { ) """ - sql """ ALTER TABLE MODIFY COLUMN L_COMMENT CHAR(44) NOT NULL """ + sql """ ALTER TABLE ${tableName} MODIFY COLUMN L_COMMENT CHAR(44) NOT NULL """ def wait_for_schema_change = { def try_times=100 From e327dfeb6a0124c606fe010c1772d7f9cb91f442 Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Wed, 26 Mar 2025 19:57:59 +0800 Subject: [PATCH 4/6] Update test_base_compaction_after_sc.groovy --- .../suites/compaction/test_base_compaction_after_sc.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regression-test/suites/compaction/test_base_compaction_after_sc.groovy b/regression-test/suites/compaction/test_base_compaction_after_sc.groovy index 3838917955a181..2514b99e4be956 100644 --- a/regression-test/suites/compaction/test_base_compaction_after_sc.groovy +++ b/regression-test/suites/compaction/test_base_compaction_after_sc.groovy @@ -52,7 +52,7 @@ suite("test_base_compaction_after_sc") { L_RECEIPTDATE DATE NOT NULL, L_SHIPINSTRUCT CHAR(25) NOT NULL, L_SHIPMODE CHAR(10) NOT NULL, - L_COMMENT VARCHAR(44) NOT NULL + L_COMMENT CHAR(44) NOT NULL ) UNIQUE KEY(L_ORDERKEY, L_PARTKEY, L_SUPPKEY, L_LINENUMBER) DISTRIBUTED BY HASH(L_ORDERKEY) BUCKETS 1 @@ -62,7 +62,7 @@ suite("test_base_compaction_after_sc") { ) """ - sql """ ALTER TABLE ${tableName} MODIFY COLUMN L_COMMENT CHAR(44) NOT NULL """ + sql """ ALTER TABLE ${tableName} MODIFY COLUMN L_COMMENT VARCHAR(44) NOT NULL """ def wait_for_schema_change = { def try_times=100 From b16e8c4bb5d7be13cf3912ee2b7c30517ccf4117 Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Thu, 27 Mar 2025 19:54:38 +0800 Subject: [PATCH 5/6] test_base_compaction --- regression-test/suites/compaction/test_base_compaction.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression-test/suites/compaction/test_base_compaction.groovy b/regression-test/suites/compaction/test_base_compaction.groovy index 5600017b138db0..62ccddb8ee9793 100644 --- a/regression-test/suites/compaction/test_base_compaction.groovy +++ b/regression-test/suites/compaction/test_base_compaction.groovy @@ -18,7 +18,7 @@ import org.codehaus.groovy.runtime.IOGroovyMethods import org.awaitility.Awaitility -suite("test_base_compaction", "p2") { +suite("test_base_compaction") { def tableName = "base_compaction_uniq_keys" String backend_id; From 1de1dc093c571016a4ff32f56ddee74fd13b4621 Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Tue, 8 Apr 2025 17:14:01 +0800 Subject: [PATCH 6/6] fix test case --- .../test_base_compaction_after_sc.out | 7 - .../compaction/test_base_compaction.groovy | 2 +- .../test_base_compaction_after_sc.groovy | 187 ++---------------- 3 files changed, 20 insertions(+), 176 deletions(-) delete mode 100644 regression-test/data/compaction/test_base_compaction_after_sc.out diff --git a/regression-test/data/compaction/test_base_compaction_after_sc.out b/regression-test/data/compaction/test_base_compaction_after_sc.out deleted file mode 100644 index fe77c6391c1faa..00000000000000 --- a/regression-test/data/compaction/test_base_compaction_after_sc.out +++ /dev/null @@ -1,7 +0,0 @@ --- This file is automatically generated. You should know what you did if you want to edit this --- !select_default -- -6001215 - --- !select_default2 -- -6001215 - diff --git a/regression-test/suites/compaction/test_base_compaction.groovy b/regression-test/suites/compaction/test_base_compaction.groovy index 62ccddb8ee9793..5600017b138db0 100644 --- a/regression-test/suites/compaction/test_base_compaction.groovy +++ b/regression-test/suites/compaction/test_base_compaction.groovy @@ -18,7 +18,7 @@ import org.codehaus.groovy.runtime.IOGroovyMethods import org.awaitility.Awaitility -suite("test_base_compaction") { +suite("test_base_compaction", "p2") { def tableName = "base_compaction_uniq_keys" String backend_id; diff --git a/regression-test/suites/compaction/test_base_compaction_after_sc.groovy b/regression-test/suites/compaction/test_base_compaction_after_sc.groovy index 2514b99e4be956..6e9a3f2c85fb3c 100644 --- a/regression-test/suites/compaction/test_base_compaction_after_sc.groovy +++ b/regression-test/suites/compaction/test_base_compaction_after_sc.groovy @@ -21,51 +21,23 @@ import org.awaitility.Awaitility suite("test_base_compaction_after_sc") { def tableName = "test_base_compaction_after_sc" - String backend_id; - def backendId_to_backendIP = [:] - def backendId_to_backendHttpPort = [:] - getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); - - backend_id = backendId_to_backendIP.keySet()[0] - def (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) - - logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) - assertEquals(code, 0) - def configList = parseJson(out.trim()) - assert configList instanceof List - sql """ DROP TABLE IF EXISTS ${tableName} """ sql """ CREATE TABLE IF NOT EXISTS ${tableName} ( - L_ORDERKEY INTEGER NOT NULL, - L_PARTKEY INTEGER NOT NULL, - L_SUPPKEY INTEGER NOT NULL, - L_LINENUMBER INTEGER NOT NULL, - L_QUANTITY DECIMAL(15,2) NOT NULL, - L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL, - L_DISCOUNT DECIMAL(15,2) NOT NULL, - L_TAX DECIMAL(15,2) NOT NULL, - L_RETURNFLAG CHAR(1) NOT NULL, - L_LINESTATUS CHAR(1) NOT NULL, - L_SHIPDATE DATE NOT NULL, - L_COMMITDATE DATE NOT NULL, - L_RECEIPTDATE DATE NOT NULL, - L_SHIPINSTRUCT CHAR(25) NOT NULL, - L_SHIPMODE CHAR(10) NOT NULL, - L_COMMENT CHAR(44) NOT NULL - ) - UNIQUE KEY(L_ORDERKEY, L_PARTKEY, L_SUPPKEY, L_LINENUMBER) - DISTRIBUTED BY HASH(L_ORDERKEY) BUCKETS 1 - PROPERTIES ( - "replication_num" = "1", - "disable_auto_compaction" = "true" - ) - + `k1` int NOT NULL, + `c1` int, + `c2` int, + `c3` int + ) DUPLICATE KEY(k1) + DISTRIBUTED BY HASH(k1) BUCKETS 1 + PROPERTIES ( + "disable_auto_compaction" = "true", + "replication_num" = "1"); """ - sql """ ALTER TABLE ${tableName} MODIFY COLUMN L_COMMENT VARCHAR(44) NOT NULL """ + sql """ ALTER TABLE ${tableName} MODIFY COLUMN c1 VARCHAR(44) """ def wait_for_schema_change = { - def try_times=100 + def try_times=1000 while(true){ def res = sql " SHOW ALTER TABLE COLUMN WHERE TableName = '${tableName}' ORDER BY CreateTime DESC LIMIT 1 " Thread.sleep(10) @@ -78,145 +50,24 @@ suite("test_base_compaction_after_sc") { } wait_for_schema_change() - streamLoad { - // a default db 'regression_test' is specified in - // ${DORIS_HOME}/conf/regression-conf.groovy - table tableName - - // default label is UUID: - // set 'label' UUID.randomUUID().toString() - - // default column_separator is specify in doris fe config, usually is '\t'. - // this line change to ',' - set 'column_separator', '|' - set 'compress_type', 'GZ' - - // relate to ${DORIS_HOME}/regression-test/data/demo/streamload_input.csv. - // also, you can stream load a http stream, e.g. http://xxx/some.csv - file """${getS3Url()}/regression/tpch/sf1/lineitem.csv.split01.gz""" - - time 10000 // limit inflight 10s - - // stream load action will check result, include Success status, and NumberTotalRows == NumberLoadedRows - - // if declared a check callback, the default check condition will ignore. - // So you must check all condition - check { result, exception, startTime, endTime -> - if (exception != null) { - throw exception - } - log.info("Stream load result: ${result}".toString()) - def json = parseJson(result) - assertEquals("success", json.Status.toLowerCase()) - assertEquals(json.NumberTotalRows, json.NumberLoadedRows) - assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0) + def insert_data = { + for (i in 0..100) { + sql """ INSERT INTO ${tableName} VALUES(1, "2", 3, 4) """ + sql """ DELETE FROM ${tableName} WHERE k1=1 """ } } - streamLoad { - // a default db 'regression_test' is specified in - // ${DORIS_HOME}/conf/regression-conf.groovy - table tableName - - // default label is UUID: - // set 'label' UUID.randomUUID().toString() - - // default column_separator is specify in doris fe config, usually is '\t'. - // this line change to ',' - set 'column_separator', '|' - set 'compress_type', 'GZ' - - // relate to ${DORIS_HOME}/regression-test/data/demo/streamload_input.csv. - // also, you can stream load a http stream, e.g. http://xxx/some.csv - file """${getS3Url()}/regression/tpch/sf1/lineitem.csv.split01.gz""" + insert_data() - time 10000 // limit inflight 10s - - // stream load action will check result, include Success status, and NumberTotalRows == NumberLoadedRows - - // if declared a check callback, the default check condition will ignore. - // So you must check all condition - check { result, exception, startTime, endTime -> - if (exception != null) { - throw exception - } - log.info("Stream load result: ${result}".toString()) - def json = parseJson(result) - assertEquals("success", json.Status.toLowerCase()) - assertEquals(json.NumberTotalRows, json.NumberLoadedRows) - assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0) - } - } - - def tablets = sql_return_maparray """ show tablets from ${tableName}; """ - - // trigger compactions for all tablets in ${tableName} trigger_and_wait_compaction(tableName, "cumulative") - streamLoad { - // a default db 'regression_test' is specified in - // ${DORIS_HOME}/conf/regression-conf.groovy - table tableName - - // default label is UUID: - // set 'label' UUID.randomUUID().toString() - - // default column_separator is specify in doris fe config, usually is '\t'. - // this line change to ',' - set 'column_separator', '|' - set 'compress_type', 'GZ' + insert_data() - // relate to ${DORIS_HOME}/regression-test/data/demo/streamload_input.csv. - // also, you can stream load a http stream, e.g. http://xxx/some.csv - file """${getS3Url()}/regression/tpch/sf1/lineitem.csv.split00.gz""" - - time 10000 // limit inflight 10s + trigger_and_wait_compaction(tableName, "cumulative") - // stream load action will check result, include Success status, and NumberTotalRows == NumberLoadedRows + insert_data() - // if declared a check callback, the default check condition will ignore. - // So you must check all condition - check { result, exception, startTime, endTime -> - if (exception != null) { - throw exception - } - log.info("Stream load result: ${result}".toString()) - def json = parseJson(result) - assertEquals("success", json.Status.toLowerCase()) - assertEquals(json.NumberTotalRows, json.NumberLoadedRows) - assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0) - } - } - - // trigger compactions for all tablets in ${tableName} trigger_and_wait_compaction(tableName, "cumulative") - qt_select_default """ SELECT count(*) FROM ${tableName} """ - //TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,QueryHits,PathHash,MetaUrl,CompactionStatus - - // trigger compactions for all tablets in ${tableName} trigger_and_wait_compaction(tableName, "base") - - def replicaNum = get_table_replica_num(tableName) - logger.info("get table replica num: " + replicaNum) - - int rowCount = 0 - for (def tablet in tablets) { - String tablet_id = tablet.TabletId - (code, out, err) = curl("GET", tablet.CompactionStatus) - logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) - assertEquals(code, 0) - def tabletJson = parseJson(out.trim()) - assert tabletJson.rowsets instanceof List - for (String rowset in (List) tabletJson.rowsets) { - rowCount += Integer.parseInt(rowset.split(" ")[1]) - } - } - assert (rowCount < 8 * replicaNum) - qt_select_default2 """ SELECT count(*) FROM ${tableName} """ - - (code, out, err) = be_get_overall_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) - logger.info("Get overall compaction status: code=" + code + ", out=" + out + ", err=" + err) - assertEquals(code, 0) - assertTrue(out.toLowerCase().contains("basecompaction")) }