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 @@ -27,7 +27,6 @@ suite('test_clone_missing_version') {
'schedule_slot_num_per_hdd_path=1000',
]
options.beConfigs += [
'disable_auto_compaction=true',
'report_tablet_interval_seconds=1',
]

Expand All @@ -43,7 +42,11 @@ suite('test_clone_missing_version') {
GetDebugPoint().disableDebugPoint(be.Host, be.HttpPort as int, NodeType.BE, injectName)
}

sql 'CREATE TABLE t (k INT) DISTRIBUTED BY HASH(k) BUCKETS 1'
sql """
CREATE TABLE t (k INT) DISTRIBUTED BY HASH(k) BUCKETS 1 PROPERTIES (
"disable_auto_compaction" = "true"
)
"""

sql 'INSERT INTO t VALUES(2)'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ suite('test_compaction_with_visible_version') {
'partition_info_update_interval_secs=5',
]
options.beConfigs += [
'disable_auto_compaction=true',
'report_tablet_interval_seconds=1',
'tablet_rowset_stale_sweep_by_size=true',
'tablet_rowset_stale_sweep_threshold_size=0',
Expand Down Expand Up @@ -166,7 +165,11 @@ suite('test_compaction_with_visible_version') {
}
}

sql " CREATE TABLE ${tableName} (k1 int, k2 int) DISTRIBUTED BY HASH(k1) BUCKETS 1 "
sql """
CREATE TABLE ${tableName} (k1 int, k2 int) DISTRIBUTED BY HASH(k1) BUCKETS 1 PROPERTIES (
"disable_auto_compaction" = "true"
)
"""

// normal
def rowNum = 0L
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

431 changes: 192 additions & 239 deletions regression-test/suites/compaction/test_single_replica_compaction.groovy

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ suite("test_time_series_compaction_polciy", "p0") {
def backendId_to_backendHttpPort = [:]
getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort);

def set_be_config = { key, value ->
for (String backend_id: backendId_to_backendIP.keySet()) {
def (code, out, err) = update_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), key, value)
logger.info("update config: code=" + code + ", out=" + out + ", err=" + err)
}
}

def trigger_cumulative_compaction_on_tablets = { tablets ->
for (def tablet : tablets) {
String tablet_id = tablet.TabletId
Expand Down Expand Up @@ -82,117 +75,97 @@ suite("test_time_series_compaction_polciy", "p0") {
return rowsetCount
}

boolean disableAutoCompaction = false
try {
String backend_id;
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

for (Object ele in (List) configList) {
assert ele instanceof List<String>
if (((List<String>) ele)[0] == "disable_auto_compaction") {
disableAutoCompaction = Boolean.parseBoolean(((List<String>) ele)[2])
logger.info("disable_auto_compaction: ${((List<String>) ele)[2]}")
}
}
set_be_config.call("disable_auto_compaction", "true")

sql """ DROP TABLE IF EXISTS ${tableName}; """
sql """
CREATE TABLE ${tableName} (
`id` int(11) NULL,
`name` varchar(255) NULL,
`hobbies` text NULL,
`score` int(11) NULL
) ENGINE=OLAP
DUPLICATE KEY(`id`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`id`) BUCKETS 2
PROPERTIES ( "replication_num" = "1", "disable_auto_compaction" = "true", "compaction_policy" = "time_series");
"""
// insert 16 lines, BUCKETS = 2
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (100, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (100, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (100, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (100, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (100, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (100, "andy", "andy love apple", 100); """

qt_sql_1 """ select count() from ${tableName} """

//TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,PathHash,MetaUrl,CompactionStatus
def tablets = sql_return_maparray """ show tablets from ${tableName}; """

int replicaNum = 1
def dedup_tablets = deduplicate_tablets(tablets)
if (dedup_tablets.size() > 0) {
replicaNum = Math.round(tablets.size() / dedup_tablets.size())
if (replicaNum != 1 && replicaNum != 3) {
assert(false)
}
}

// BUCKETS = 2
// before cumulative compaction, there are 17 * 2 = 34 rowsets.
int rowsetCount = get_rowset_count.call(tablets);
assert (rowsetCount == 34 * replicaNum)

// trigger cumulative compactions for all tablets in table
trigger_cumulative_compaction_on_tablets.call(tablets)

// wait for cumulative compaction done
wait_cumulative_compaction_done.call(tablets)

// after cumulative compaction, there is only 26 rowset.
// 5 consecutive empty versions are merged into one empty version
// 34 - 2*4 = 26
rowsetCount = get_rowset_count.call(tablets);
assert (rowsetCount == 26 * replicaNum)

// trigger cumulative compactions for all tablets in ${tableName}
trigger_cumulative_compaction_on_tablets.call(tablets)

// wait for cumulative compaction done
wait_cumulative_compaction_done.call(tablets)

// after cumulative compaction, there is only 22 rowset.
// 26 - 4 = 22
rowsetCount = get_rowset_count.call(tablets);
assert (rowsetCount == 22 * replicaNum)

qt_sql_2 """ select count() from ${tableName}"""
if (isCloudMode()) {
return;
sql """ DROP TABLE IF EXISTS ${tableName}; """
sql """
CREATE TABLE ${tableName} (
`id` int(11) NULL,
`name` varchar(255) NULL,
`hobbies` text NULL,
`score` int(11) NULL
) ENGINE=OLAP
DUPLICATE KEY(`id`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`id`) BUCKETS 2
PROPERTIES (
"replication_num" = "1",
"disable_auto_compaction" = "true",
"compaction_policy" = "time_series"
);
"""
// insert 16 lines, BUCKETS = 2
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (100, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (100, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (100, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (100, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (100, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (100, "andy", "andy love apple", 100); """

qt_sql_1 """ select count() from ${tableName} """

//TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,PathHash,MetaUrl,CompactionStatus
def tablets = sql_return_maparray """ show tablets from ${tableName}; """

int replicaNum = 1
def dedup_tablets = deduplicate_tablets(tablets)
if (dedup_tablets.size() > 0) {
replicaNum = Math.round(tablets.size() / dedup_tablets.size())
if (replicaNum != 1 && replicaNum != 3) {
assert(false)
}
sql """ alter table ${tableName} set ("time_series_compaction_file_count_threshold"="10")"""
sql """sync"""
// trigger cumulative compactions for all tablets in ${tableName}
trigger_cumulative_compaction_on_tablets.call(tablets)

// wait for cumulative compaction done
wait_cumulative_compaction_done.call(tablets)

// after cumulative compaction, there is only 11 rowset.
rowsetCount = get_rowset_count.call(tablets);
assert (rowsetCount == 11 * replicaNum)
qt_sql_3 """ select count() from ${tableName}"""
} finally {
set_be_config.call("disable_auto_compaction", disableAutoCompaction.toString())
}

// BUCKETS = 2
// before cumulative compaction, there are 17 * 2 = 34 rowsets.
int rowsetCount = get_rowset_count.call(tablets);
assert (rowsetCount == 34 * replicaNum)

// trigger cumulative compactions for all tablets in table
trigger_cumulative_compaction_on_tablets.call(tablets)

// wait for cumulative compaction done
wait_cumulative_compaction_done.call(tablets)

// after cumulative compaction, there is only 26 rowset.
// 5 consecutive empty versions are merged into one empty version
// 34 - 2*4 = 26
rowsetCount = get_rowset_count.call(tablets);
assert (rowsetCount == 26 * replicaNum)

// trigger cumulative compactions for all tablets in ${tableName}
trigger_cumulative_compaction_on_tablets.call(tablets)

// wait for cumulative compaction done
wait_cumulative_compaction_done.call(tablets)

// after cumulative compaction, there is only 22 rowset.
// 26 - 4 = 22
rowsetCount = get_rowset_count.call(tablets);
assert (rowsetCount == 22 * replicaNum)

qt_sql_2 """ select count() from ${tableName}"""
if (isCloudMode()) {
return;
}
sql """ alter table ${tableName} set ("time_series_compaction_file_count_threshold"="10")"""
sql """sync"""
// trigger cumulative compactions for all tablets in ${tableName}
trigger_cumulative_compaction_on_tablets.call(tablets)

// wait for cumulative compaction done
wait_cumulative_compaction_done.call(tablets)

// after cumulative compaction, there is only 11 rowset.
rowsetCount = get_rowset_count.call(tablets);
assert (rowsetCount == 11 * replicaNum)
qt_sql_3 """ select count() from ${tableName}"""
}
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,9 @@ suite("test_index_compaction_failure_injection", "nonConcurrent") {
}
}
set_be_config.call("inverted_index_compaction_enable", "true")
if (isCloudMode) {
set_be_config.call("disable_auto_compaction", "true")
}
has_update_be_config = true
// check updated config
check_config.call("inverted_index_compaction_enable", "true");
if (isCloudMode) {
check_config.call("disable_auto_compaction", "true")
}


/**
Expand Down Expand Up @@ -349,9 +343,6 @@ suite("test_index_compaction_failure_injection", "nonConcurrent") {
} finally {
if (has_update_be_config) {
set_be_config.call("inverted_index_compaction_enable", invertedIndexCompactionEnable.toString())
if (isCloudMode) {
set_be_config.call("disable_auto_compaction", disableAutoCompaction.toString())
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,8 @@ suite("test_segcompaction_correctness", "nonConcurrent,p2") {
String endpoint = getS3Endpoint()
String region = getS3Region()
String bucket = getS3BucketName()
def backendId_to_backendIP = [:]
def backendId_to_backendHttpPort = [:]
String backend_id;
try {
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

boolean disableAutoCompaction = true
for (Object ele in (List) configList) {
assert ele instanceof List<String>
if (((List<String>) ele)[0] == "disable_auto_compaction") {
disableAutoCompaction = Boolean.parseBoolean(((List<String>) ele)[2])
}
}
sql """ DROP TABLE IF EXISTS ${tableName} """
sql "${create_table_sql}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,7 @@ suite("test_too_many_segments", "nonConcurrent,p2") { // the epic -238 case
String endpoint = getS3Endpoint()
String region = getS3Region()
String bucket = getS3BucketName()
def backendId_to_backendIP = [:]
def backendId_to_backendHttpPort = [:]
String backend_id;
try {
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

boolean disableAutoCompaction = true
for (Object ele in (List) configList) {
assert ele instanceof List<String>
if (((List<String>) ele)[0] == "disable_auto_compaction") {
disableAutoCompaction = Boolean.parseBoolean(((List<String>) ele)[2])
}
}
sql """ DROP TABLE IF EXISTS ${tableName} """
sql "${create_table_sql}"

Expand Down
20 changes: 0 additions & 20 deletions regression-test/suites/schema_change/test_number_overflow.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,6 @@ suite ("test_number_overflow") {

try {

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

for (Object ele in (List) configList) {
assert ele instanceof List<String>
if (((List<String>) ele)[0] == "disable_auto_compaction") {
disableAutoCompaction = Boolean.parseBoolean(((List<String>) ele)[2])
}
}

sql """ DROP TABLE IF EXISTS test_number_overflow """
sql """
CREATE TABLE IF NOT EXISTS test_number_overflow ( k1 INT NOT NULL, k2 VARCHAR(4096) NOT NULL, k3 VARCHAR(4096) NOT NULL, k4 VARCHAR(4096) NOT NULL, k5 VARCHAR(4096) NOT NULL, k6 VARCHAR(4096) NOT NULL, k7 VARCHAR(4096) NOT NULL, k8 VARCHAR(4096) NOT NULL, k9 VARCHAR(4096) NOT NULL, v1 FLOAT SUM NOT NULL, v2 DECIMAL(20,7) SUM NOT NULL ) AGGREGATE KEY(k1,k2,k3,k4,k5,k6,k7,k8,k9) PARTITION BY RANGE(k1) ( PARTITION partition_a VALUES LESS THAN ("5"), PARTITION partition_b VALUES LESS THAN ("30"), PARTITION partition_c VALUES LESS THAN ("100"), PARTITION partition_d VALUES LESS THAN ("500"), PARTITION partition_e VALUES LESS THAN ("1000"), PARTITION partition_f VALUES LESS THAN ("2000"), PARTITION partition_g VALUES LESS THAN MAXVALUE ) DISTRIBUTED BY HASH(k1, k2) BUCKETS 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,10 @@ suite ("test_agg_keys_schema_change") {

try {

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

boolean disableAutoCompaction = true
for (Object ele in (List) configList) {
assert ele instanceof List<String>
if (((List<String>) ele)[0] == "disable_auto_compaction") {
disableAutoCompaction = Boolean.parseBoolean(((List<String>) ele)[2])
}
}

sql """ DROP TABLE IF EXISTS schema_change_agg_keys_regression_test """
sql """
CREATE TABLE IF NOT EXISTS schema_change_agg_keys_regression_test (
Expand Down
Loading