Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ suite("test_stale_rowset") {
}
}
def getCurCacheSize = {
backendIdToCacheSize = [:]
def backendIdToCacheSize = [:]
for (String[] backend in backends) {
if (backend[9].equals("true") && backend[19].contains("regression_cluster_name1")) {
StringBuilder sb = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ suite("test_reset_capacity") {
}
assertEquals(backendIdToBackendIP.size(), 1)

backendId = backendIdToBackendIP.keySet()[0]
def backendId = backendIdToBackendIP.keySet()[0]
def url = backendIdToBackendIP.get(backendId) + ":" + backendIdToBackendHttpPort.get(backendId) + """/api/file_cache?op=clear&sync=true"""
logger.info(url)
def clearFileCache = { check_func ->
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ suite("test_multi_stale_rowset") {
}
}
def getCurCacheSize = {
backendIdToCacheSize = [:]
def backendIdToCacheSize = [:]
for (int i = 0; i < ipList.size(); i++) {
StringBuilder sb = new StringBuilder();
sb.append("curl http://")
Expand All @@ -117,10 +117,10 @@ suite("test_multi_stale_rowset") {
sb.append("/vars/*file_cache_cache_size")
String command = sb.toString()
logger.info(command);
process = command.execute()
code = process.waitFor()
err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream())));
out = process.getText()
def process = command.execute()
def code = process.waitFor()
def err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream())));
def out = process.getText()
logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err)
assertEquals(code, 0)
String[] str = out.split(':')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
import org.codehaus.groovy.runtime.IOGroovyMethods

suite("test_warm_up_cluster") {
def custoBeConfig = [
enable_evict_file_cache_in_advance : false,
file_cache_enter_disk_resource_limit_mode_percent : 99
]
setBeConfigTemporary(custoBeConfig) {
def ttlProperties = """ PROPERTIES("file_cache_ttl_seconds"="12000") """
def getJobState = { jobId ->
def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """
return jobStateResult[0][3]
return jobStateResult[0]
}
def table = "customer"

Expand Down Expand Up @@ -157,12 +162,11 @@ suite("test_warm_up_cluster") {
int i = 0
for (; i < retryTime; i++) {
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;
}
}
Expand Down Expand Up @@ -262,4 +266,5 @@ suite("test_warm_up_cluster") {
}
assertTrue(flag)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.codehaus.groovy.runtime.IOGroovyMethods
suite("test_warm_up_cluster_batch") {
def getJobState = { jobId ->
def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """
return jobStateResult[0][3]
return jobStateResult[0]
}
def table = "customer"

Expand Down Expand Up @@ -120,12 +120,11 @@ suite("test_warm_up_cluster_batch") {
int i = 0
for (; i < retryTime; i++) {
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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
import org.codehaus.groovy.runtime.IOGroovyMethods

suite("test_warm_up_cluster_bigsize") {
def custoBeConfig = [
enable_evict_file_cache_in_advance : false,
file_cache_enter_disk_resource_limit_mode_percent : 99
]
setBeConfigTemporary(custoBeConfig) {
def ttlProperties = """ PROPERTIES("file_cache_ttl_seconds"="12000") """
def getJobState = { jobId ->
def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """
return jobStateResult[0][3]
return jobStateResult[0]
}
def table = "customer"

Expand Down Expand Up @@ -130,12 +135,11 @@ suite("test_warm_up_cluster_bigsize") {
int i = 0
for (; i < retryTime; i++) {
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;
}
}
Expand Down Expand Up @@ -188,4 +192,5 @@ suite("test_warm_up_cluster_bigsize") {
}
sql new File("""${context.file.parent}/../ddl/${table}_delete.sql""").text
sql new File("""${context.file.parent}/../ddl/supplier_delete.sql""").text
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ suite("test_warm_up_cluster_empty") {
def ttlProperties = """ PROPERTIES("file_cache_ttl_seconds"="12000") """
def getJobState = { jobId ->
def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """
return jobStateResult[0][3]
return jobStateResult[0]
}
def table = "customer"

Expand Down Expand Up @@ -55,7 +55,7 @@ suite("test_warm_up_cluster_empty") {
println("the brpc port is " + brpcPortList);

for (unique_id : beUniqueIdList) {
resp = get_cluster.call(unique_id);
def resp = get_cluster.call(unique_id);
for (cluster : resp) {
if (cluster.type == "COMPUTE") {
drop_cluster.call(cluster.cluster_name, cluster.cluster_id);
Expand Down Expand Up @@ -126,12 +126,11 @@ suite("test_warm_up_cluster_empty") {
int i = 0
for (; i < retryTime; i++) {
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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ suite("test_warm_up_compute_group") {
def ttlProperties = """ PROPERTIES("file_cache_ttl_seconds"="12000") """
def getJobState = { jobId ->
def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """
return jobStateResult[0][3]
return jobStateResult[0]
}
def table = "customer"

Expand Down Expand Up @@ -157,12 +157,11 @@ suite("test_warm_up_compute_group") {
int i = 0
for (; i < retryTime; i++) {
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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ suite("test_warmup_show_stmt_2") {
result = show_cache_hotspot("regression_cluster_name0")
log.info(result.toString())
org.junit.Assert.assertTrue(getLineNumber() + "result.size() " + result.size() + " > 0", result.size() > 0)
assertEquals(result[0].get("PartitionName"), "p3")
// assertEquals(result[0].get("PartitionName"), "p3")
assertEquals(result[0].get("TableName"), "regression_test_cloud_p0_cache_multi_cluster_warm_up_hotspot.customer")
// result = show_cache_hotspot("regression_cluster_name1")
// assertEquals(result.size(), 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ suite("test_warmup_show_stmt_3") {
}
for (int i = 0; i < 3; i++) {
sleep(40000)
result = show_cache_hotspot("regression_cluster_name0", "regression_test_cloud_p0_cache_multi_cluster_warm_up_hotspot.customer")
def result = show_cache_hotspot("regression_cluster_name0", "regression_test_cloud_p0_cache_multi_cluster_warm_up_hotspot.customer")
assertTrue(result.size() > 0);
}
thread.join()
sleep(40000)
result = show_cache_hotspot("regression_cluster_name0", "regression_test_cloud_p0_cache_multi_cluster_warm_up_hotspot.customer")
def result = show_cache_hotspot("regression_cluster_name0", "regression_test_cloud_p0_cache_multi_cluster_warm_up_hotspot.customer")
assertTrue(result.size() > 0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
import org.codehaus.groovy.runtime.IOGroovyMethods

suite("test_warm_up_partition") {
def custoBeConfig = [
enable_evict_file_cache_in_advance : false,
file_cache_enter_disk_resource_limit_mode_percent : 99
]
setBeConfigTemporary(custoBeConfig) {
def ttlProperties = """ PROPERTIES("file_cache_ttl_seconds"="12000") """
def getJobState = { jobId ->
def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """
return jobStateResult[0][3]
return jobStateResult[0]
}

List<String> ipList = new ArrayList<>();
Expand Down Expand Up @@ -121,12 +126,11 @@ suite("test_warm_up_partition") {
int i = 0
for (; i < retryTime; i++) {
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;
}
}
Expand Down Expand Up @@ -190,4 +194,5 @@ suite("test_warm_up_partition") {
assertTrue(true)
}
sql new File("""${context.file.parent}/../ddl/${table}_delete.sql""").text
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@
import org.codehaus.groovy.runtime.IOGroovyMethods

suite("test_warm_up_same_table_multi_times") {
def custoBeConfig = [
enable_evict_file_cache_in_advance : false,
file_cache_enter_disk_resource_limit_mode_percent : 99
]

setBeConfigTemporary(custoBeConfig) {
def clusters = sql " SHOW CLUSTERS; "
assertTrue(!clusters.isEmpty())
def validCluster = clusters[0][0]
sql """use @${validCluster};""";

def ttlProperties = """ PROPERTIES("file_cache_ttl_seconds"="12000") """
def getJobState = { jobId ->
def jobStateResult = sql """ SHOW WARM UP JOB WHERE ID = ${jobId} """
return jobStateResult[0][2]
return jobStateResult[0]
}

String[][] backends = sql """ show backends """
Expand All @@ -30,7 +41,7 @@ suite("test_warm_up_same_table_multi_times") {
def backendIdToBackendHttpPort = [:]
def backendIdToBackendBrpcPort = [:]
for (String[] backend in backends) {
if (backend[9].equals("true") && backend[19].contains("regression_cluster_name0")) {
if (backend[9].equals("true") && backend[19].contains("${validCluster}")) {
backendIdToBackendIP.put(backend[0], backend[1])
backendIdToBackendHttpPort.put(backend[0], backend[4])
backendIdToBackendBrpcPort.put(backend[0], backend[5])
Expand Down Expand Up @@ -73,8 +84,7 @@ suite("test_warm_up_same_table_multi_times") {



sql "use @regression_cluster_name0"
// sql "use @compute_cluster"
sql "use @${validCluster}"

def table = "customer"
sql new File("""${context.file.parent}/../ddl/${table}_delete.sql""").text
Expand Down Expand Up @@ -113,23 +123,22 @@ suite("test_warm_up_same_table_multi_times") {
load_customer_once()
load_customer_once()

def jobId = sql "warm up cluster regression_cluster_name0 with table customer;"
def jobId = sql "warm up cluster ${validCluster} with table customer;"
try {
sql "warm up cluster regression_cluster_name0 with table customer;"
assertTrue(false)
sql "warm up cluster ${validCluster} with table customer;"
assertTrue(true) // dup warm up command can be send to fe queue now
} catch (Exception e) {
assertTrue(true)
assertTrue(false)
}
int retryTime = 120
int 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;
}
}
Expand Down Expand Up @@ -180,19 +189,18 @@ suite("test_warm_up_same_table_multi_times") {
assertTrue(flag)
}

// AGAIN! regression_cluster_name1
jobId = sql "warm up cluster regression_cluster_name0 with table customer;"
// AGAIN!
jobId = sql "warm up cluster ${validCluster} with table customer;"

retryTime = 120
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;
}
}
Expand Down Expand Up @@ -265,4 +273,5 @@ suite("test_warm_up_same_table_multi_times") {
long diff = skip_io_bytes_end - skip_io_bytes_start;
println("skip_io_bytes diff: " + diff);
assertTrue(diff > 1000);
}
}
Loading