diff --git a/regression-test/suites/cloud_p0/cache/http/test_reset_capacity.groovy b/regression-test/suites/cloud_p0/cache/http/test_reset_capacity.groovy index c3383acfce0a84..4c9608e512cdff 100644 --- a/regression-test/suites/cloud_p0/cache/http/test_reset_capacity.groovy +++ b/regression-test/suites/cloud_p0/cache/http/test_reset_capacity.groovy @@ -254,7 +254,7 @@ suite("test_reset_capacity") { continue } def i = line.indexOf(' ') - ttl_cache_size = line.substring(i).toLong() + def ttl_cache_size = line.substring(i).toLong() logger.info("current ttl_cache_size " + ttl_cache_size); assertTrue(ttl_cache_size <= 1073741824) flag1 = true diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster.groovy index 180999cf806c1d..1534a9fc0d447d 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster.groovy @@ -163,11 +163,10 @@ suite("test_warm_up_cluster") { for (; i < retryTime; i++) { sleep(1000) def statuses = getJobState(jobId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_batch.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_batch.groovy index 7ef598aa38fd09..21a3773b2625e7 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_batch.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_batch.groovy @@ -121,11 +121,10 @@ suite("test_warm_up_cluster_batch") { for (; i < retryTime; i++) { sleep(1000) def statuses = getJobState(jobId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_bigsize.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_bigsize.groovy index 4458ed5cee37b2..e090999ce76caf 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_bigsize.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_bigsize.groovy @@ -136,11 +136,10 @@ suite("test_warm_up_cluster_bigsize") { for (; i < retryTime; i++) { sleep(1000) def statuses = getJobState(jobId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_empty.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_empty.groovy index 60185a794cbf6d..ba2c510bbb5892 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_empty.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_empty.groovy @@ -127,11 +127,10 @@ suite("test_warm_up_cluster_empty") { for (; i < retryTime; i++) { sleep(1000) def statuses = getJobState(jobId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_compute_group.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_compute_group.groovy index 75af14e45e58e0..19ca1958e2e177 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_compute_group.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_compute_group.groovy @@ -158,11 +158,10 @@ suite("test_warm_up_compute_group") { for (; i < retryTime; i++) { sleep(1000) def statuses = getJobState(jobId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_partition.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_partition.groovy index 9a72b55ceff905..fce44d37e3637f 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_partition.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_partition.groovy @@ -126,12 +126,11 @@ suite("test_warm_up_partition") { int i = 0 for (; i < retryTime; i++) { sleep(1000) - def statuses = getJobState(jodId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + def statuses = getJobState(jobId[0][0]) + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_same_table_multi_times.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_same_table_multi_times.groovy index 1e7fcc2894ea48..b774273f952ee7 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_same_table_multi_times.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_same_table_multi_times.groovy @@ -135,11 +135,10 @@ suite("test_warm_up_same_table_multi_times") { for (; j < retryTime; j++) { sleep(1000) def statuses = getJobState(jobId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } @@ -197,12 +196,11 @@ suite("test_warm_up_same_table_multi_times") { j = 0 for (; j < retryTime; j++) { sleep(1000) - def status = getJobState(jobId[0][0]) - logger.info(status) - if (status.equals("CANCELLED")) { + def statuses = getJobState(jobId[0][0]) + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (status.equals("FINISHED")) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_table.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_table.groovy index 1f8e36f8547ef8..4e4979ab79c0d4 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_table.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_table.groovy @@ -31,8 +31,7 @@ suite("test_warm_up_table") { } def getTablesFromShowCommand = { jobId -> def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """ - logger.info(jobStateResult) - return jobStateResult[0][9] + return jobStateResult[0] } List ipList = new ArrayList<>(); @@ -153,11 +152,10 @@ suite("test_warm_up_table") { for (; j < retryTime; j++) { sleep(1000) def statuses = getJobState(jobId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } @@ -166,7 +164,8 @@ suite("test_warm_up_table") { assertTrue(false); } def tablesString = getTablesFromShowCommand(jobId[0][0]) - assertTrue(tablesString.contains("customer"), tablesString) + + assertTrue(tablesString.any { it != null && it.contains("customer") }) sleep(30000) long ttl_cache_size = 0 getMetricsMethod.call(ipList[0], brpcPortList[0]) { diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_tables.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_tables.groovy index 5ee9a0a833c5b2..be4521544feb29 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_tables.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/table/test_warm_up_tables.groovy @@ -31,8 +31,7 @@ suite("test_warm_up_tables") { } def getTablesFromShowCommand = { jobId -> def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """ - logger.info(jobStateResult) - return jobStateResult[0][9] + return jobStateResult[0] } List ipList = new ArrayList<>(); @@ -157,11 +156,10 @@ suite("test_warm_up_tables") { for (; i < retryTime; i++) { sleep(1000) def statuses = getJobState(jobId[0][0]) - logger.info(statuses) - if (statuses.any { it.equals("CANCELLED") }) { + if (statuses.any { it != null && it.equals("CANCELLED") }) { assertTrue(false); } - if (statuses.any { it.equals("FINISHED") }) { + if (statuses.any { it != null && it.equals("FINISHED") }) { break; } } @@ -176,8 +174,8 @@ suite("test_warm_up_tables") { waitJobDone(jobId_); def tablesString = getTablesFromShowCommand(jobId_[0][0]) - assertTrue(tablesString.contains("customer.p3"), tablesString) - assertTrue(tablesString.contains("supplier"), tablesString) + assertTrue(tablesString.any { it != null && it.contains("customer") }) + assertTrue(tablesString.any { it != null && it.contains("supplier") }) sleep(30000) long ttl_cache_size = 0 diff --git a/regression-test/suites/cloud_p0/cache/ttl/alter_ttl_1.groovy b/regression-test/suites/cloud_p0/cache/ttl/alter_ttl_1.groovy index 25961c0d7301d1..8f34a04a640859 100644 --- a/regression-test/suites/cloud_p0/cache/ttl/alter_ttl_1.groovy +++ b/regression-test/suites/cloud_p0/cache/ttl/alter_ttl_1.groovy @@ -24,6 +24,7 @@ suite("alter_ttl_1") { ] setBeConfigTemporary(custoBeConfig) { + sql "set global enable_auto_analyze = false" def clusters = sql " SHOW CLUSTERS; " assertTrue(!clusters.isEmpty()) def validCluster = clusters[0][0] @@ -112,12 +113,14 @@ suite("alter_ttl_1") { sql """ select count(*) from customer_ttl """ sleep(30000) long ttl_cache_size = 0 + long normal_cache_size = 0 getMetricsMethod.call() { respCode, body -> assertEquals("${respCode}".toString(), "200") String out = "${body}".toString() def strs = out.split('\n') Boolean flag1 = false; + Boolean flag2 = false; for (String line in strs) { if (flag1) break; if (line.contains("ttl_cache_size")) { @@ -128,64 +131,43 @@ suite("alter_ttl_1") { ttl_cache_size = line.substring(i).toLong() flag1 = true } - } - assertTrue(flag1) - } - sql """ ALTER TABLE customer_ttl SET ("file_cache_ttl_seconds"="140") """ - sleep(80000) - // after 110s, the first load has translate to normal - getMetricsMethod.call() { - respCode, body -> - assertEquals("${respCode}".toString(), "200") - String out = "${body}".toString() - def strs = out.split('\n') - Boolean flag1 = false; - for (String line in strs) { - if (flag1) break; - if (line.contains("ttl_cache_size")) { - if (line.startsWith("#")) { - continue - } - def i = line.indexOf(' ') - assertEquals(line.substring(i).toLong(), 0) - - } - if (line.contains("normal_queue_cache_size")) { if (line.startsWith("#")) { continue } def i = line.indexOf(' ') - assertEquals(line.substring(i).toLong(), ttl_cache_size) - flag1 = true + normal_cache_size = line.substring(i).toLong() + flag2 = true } } - assertTrue(flag1) + assertTrue(flag1 && flag2) } - // wait for ttl timeout - sleep(50000) + sql """ ALTER TABLE customer_ttl SET ("file_cache_ttl_seconds"="100") """ + sleep(80000) + // after 110s, the first load has translate to normal getMetricsMethod.call() { respCode, body -> assertEquals("${respCode}".toString(), "200") String out = "${body}".toString() def strs = out.split('\n') Boolean flag1 = false; - Boolean flag2 = false; for (String line in strs) { - if (flag1 && flag2) break; + if (flag1) break; if (line.contains("ttl_cache_size")) { if (line.startsWith("#")) { continue } def i = line.indexOf(' ') assertEquals(line.substring(i).toLong(), 0) + } + if (line.contains("normal_queue_cache_size")) { if (line.startsWith("#")) { continue } def i = line.indexOf(' ') - assertEquals(line.substring(i).toLong(), ttl_cache_size) + assertEquals(line.substring(i).toLong(), ttl_cache_size + normal_cache_size) flag1 = true } } diff --git a/regression-test/suites/cloud_p0/cache/ttl/alter_ttl_4.groovy b/regression-test/suites/cloud_p0/cache/ttl/alter_ttl_4.groovy index 819d2f5cd5a1ba..691994c36c50a3 100644 --- a/regression-test/suites/cloud_p0/cache/ttl/alter_ttl_4.groovy +++ b/regression-test/suites/cloud_p0/cache/ttl/alter_ttl_4.groovy @@ -157,7 +157,7 @@ suite("alter_ttl_4") { } sleep(60000) // one customer table would take about 1.3GB, the total cache size is 20GB - // the following would take 20.8G all + // the following would take 20G all // evict customer_ttl load_customer_once("customer") load_customer_once("customer") @@ -175,6 +175,12 @@ suite("alter_ttl_4") { load_customer_once("customer") load_customer_once("customer") load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") // some datas in s3 and will download them sql """ select C_CUSTKEY from customer_ttl order by C_CUSTKEY limit 1""" diff --git a/regression-test/suites/cloud_p0/cache/ttl/create_table_as_select.groovy b/regression-test/suites/cloud_p0/cache/ttl/create_table_as_select.groovy index 40b5785f8fe7fe..bac2fe5eb08420 100644 --- a/regression-test/suites/cloud_p0/cache/ttl/create_table_as_select.groovy +++ b/regression-test/suites/cloud_p0/cache/ttl/create_table_as_select.groovy @@ -144,29 +144,6 @@ def clearFileCache = { check_func -> DISTRIBUTED BY HASH(C_CUSTKEY) BUCKETS 32 PROPERTIES("file_cache_ttl_seconds"="120","disable_auto_compaction" = "true") as select * from customer_ttl""" - sleep(30000) // 30s - getMetricsMethod.call() { - respCode, body -> - assertEquals("${respCode}".toString(), "200") - String out = "${body}".toString() - def strs = out.split('\n') - Boolean flag1 = false; - Boolean flag2 = false; - for (String line in strs) { - if (flag1 && flag2) break; - if (line.contains("ttl_cache_size")) { - if (line.startsWith("#")) { - continue - } - def i = line.indexOf(' ') - long cur_ttl_cache_size = line.substring(i).toLong() - assertTrue(Math.abs(2* ttl_cache_size - cur_ttl_cache_size) < 10000) - flag1 = true - } - } - assertTrue(flag1) - } - sleep(150000) getMetricsMethod.call() { respCode, body -> diff --git a/regression-test/suites/cloud_p0/cache/ttl/test_ttl_preempt.groovy b/regression-test/suites/cloud_p0/cache/ttl/test_ttl_preempt.groovy index 3856e8ae826420..a31cf3df038b8b 100644 --- a/regression-test/suites/cloud_p0/cache/ttl/test_ttl_preempt.groovy +++ b/regression-test/suites/cloud_p0/cache/ttl/test_ttl_preempt.groovy @@ -132,7 +132,14 @@ suite("test_ttl_preempt") { } // one customer table would take about 1.3GB, the total cache size is 20GB - // the following would take 19.5G all + // the following would take 20G all + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") + load_customer_once("customer") load_customer_once("customer") load_customer_once("customer") load_customer_once("customer")