This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit d55e41b65695895d57e6d84d4e94d61091d037d6 Author: AlexYue <yj976240...@gmail.com> AuthorDate: Sat Sep 2 14:43:57 2023 +0800 [test](ColdHotSeparation) refresh case (#23741) --- .../modify_partition_add_policy.groovy | 39 ++++++++++++++++++++++ .../create_table_use_partition_policy.groovy | 10 +++--- .../table_modify_resouce_and_policy.groovy | 6 +++- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/regression-test/suites/cold_heat_separation/empty_table_use_policy/modify_partition_add_policy.groovy b/regression-test/suites/cold_heat_separation/empty_table_use_policy/modify_partition_add_policy.groovy index dfad19d89c..467830b7e3 100644 --- a/regression-test/suites/cold_heat_separation/empty_table_use_policy/modify_partition_add_policy.groovy +++ b/regression-test/suites/cold_heat_separation/empty_table_use_policy/modify_partition_add_policy.groovy @@ -105,13 +105,52 @@ suite("add_table_policy_by_modify_partition") { // OK assertEquals(alter_table_partition_try_again_result.size(), 1); + try_sql """ + CREATE STORAGE POLICY IF NOT EXISTS tmp2 + PROPERTIES( + "storage_resource" = "test_modify_partition_table_use_resource", + "cooldown_datetime" = "$cooldownTime" + ); + """ + + sql """ + CREATE TABLE create_table_partion_use_created_policy_test + ( + k1 DATE, + k2 INT, + V1 VARCHAR(2048) REPLACE + ) PARTITION BY RANGE (k1) ( + PARTITION p1 VALUES LESS THAN ("2022-01-01") ("storage_policy" = "tmp2" ,"replication_num"="1"), + PARTITION p2 VALUES LESS THAN ("2022-02-01") ("storage_policy" = "tmp2" ,"replication_num"="1") + ) DISTRIBUTED BY HASH(k2) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "storage_policy" = "created_create_table_partition_alter_policy" + ); + """ + + // Test that the partition's specified policy would be covered by the table's policy + def partitions = sql """ + show partitions from create_table_partion_use_created_policy_test + """ + + for (par in partitions) { + assertTrue(par[12] == "created_create_table_partition_alter_policy") + } + sql """ DROP TABLE IF EXISTS create_table_partition; """ sql """ + DROP TABLE IF EXISTS create_table_partion_use_created_policy_test; + """ + sql """ DROP STORAGE POLICY created_create_table_partition_alter_policy """ sql """ + DROP STORAGE POLICY tmp2 + """ + sql """ DROP RESOURCE test_modify_partition_table_use_resource """ } diff --git a/regression-test/suites/cold_heat_separation_p2/create_table_use_partition_policy.groovy b/regression-test/suites/cold_heat_separation_p2/create_table_use_partition_policy.groovy index b059cc545f..a065e0b4f9 100644 --- a/regression-test/suites/cold_heat_separation_p2/create_table_use_partition_policy.groovy +++ b/regression-test/suites/cold_heat_separation_p2/create_table_use_partition_policy.groovy @@ -36,9 +36,9 @@ suite("create_table_use_partition_policy") { def tabletId = t[0] String meta_url = t[17] def clos = { respCode, body -> - logger.info("test ttl expired resp Code {}", "${respCode}".toString()) assertEquals("${respCode}".toString(), "200") String out = "${body}".toString() + logger.info("test ttl expired resp Code {}, body {}", "${respCode}".toString(), out) def obj = new JsonSlurper().parseText(out) data_sizes[0] = obj.local_data_size data_sizes[1] = obj.remote_data_size @@ -260,8 +260,8 @@ suite("create_table_use_partition_policy") { // } LocalDataSize1 = sizes[0] RemoteDataSize1 = sizes[1] - log.info( "test local size is zero") - assertEquals(LocalDataSize1, 0) + log.info( "test local size is not zero") + assertTrue(LocalDataSize1 != 0) log.info( "test remote size is zero") assertEquals(RemoteDataSize1, 0) @@ -364,8 +364,8 @@ suite("create_table_use_partition_policy") { assertTrue(tablets.size() > 0) LocalDataSize1 = sizes[0] RemoteDataSize1 = sizes[1] - log.info( "test local size is zero") - assertEquals(LocalDataSize1, 0) + log.info( "test local size is not zero") + assertTrue(LocalDataSize1 != 0) log.info( "test remote size is zero") assertEquals(RemoteDataSize1, 0) diff --git a/regression-test/suites/cold_heat_separation_p2/table_modify_resouce_and_policy.groovy b/regression-test/suites/cold_heat_separation_p2/table_modify_resouce_and_policy.groovy index 6a0b9b8143..9335d4760e 100644 --- a/regression-test/suites/cold_heat_separation_p2/table_modify_resouce_and_policy.groovy +++ b/regression-test/suites/cold_heat_separation_p2/table_modify_resouce_and_policy.groovy @@ -204,6 +204,7 @@ suite("table_modify_resouce") { tablets = sql """ SHOW TABLETS FROM ${tableName} """ + fetchDataSize(sizes, tablets[0]) try_times -= 1 assertTrue(try_times > 0) } @@ -286,13 +287,16 @@ suite("table_modify_resouce") { log.info( "test tablets not empty") assertTrue(tablets.size() > 0) fetchDataSize(sizes, tablets[0]) + try_times = 100 while (sizes[0] != 0) { - log.info( "test local size not zero, sleep 10s") + log.info( "test local size is not zero, sleep 10s") sleep(10000) tablets = sql """ SHOW TABLETS FROM ${tableName} """ fetchDataSize(sizes, tablets[0]) + try_times -= 1 + assertTrue(try_times > 0) } // 所有的local data size为0 log.info( "test all local size is zero") --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org