From 1f19bc88f4575cd6fff73b0a4f1ef2366bb3fa37 Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Wed, 27 Nov 2024 11:00:12 +0800 Subject: [PATCH 01/11] 1 4 --- be/src/cloud/cloud_cumulative_compaction.cpp | 2 + be/src/cloud/cloud_storage_engine.cpp | 3 +- be/src/olap/tablet.cpp | 13 +- .../test_cumu_compaction_with_delete.out | 37 ++++ .../test_cumu_compaction_with_delete.groovy | 186 ++++++++++++++++++ 5 files changed, 239 insertions(+), 2 deletions(-) create mode 100644 regression-test/data/compaction/test_cumu_compaction_with_delete.out create mode 100644 regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy diff --git a/be/src/cloud/cloud_cumulative_compaction.cpp b/be/src/cloud/cloud_cumulative_compaction.cpp index f63054563aa18a..948b5778a274ba 100644 --- a/be/src/cloud/cloud_cumulative_compaction.cpp +++ b/be/src/cloud/cloud_cumulative_compaction.cpp @@ -92,6 +92,8 @@ Status CloudCumulativeCompaction::prepare_compact() { // plus 1 to skip the delete version. // NOTICE: after that, the cumulative point may be larger than max version of this tablet, but it doesn't matter. update_cumulative_point(); + st = Status::Error( + "_last_delete_version.first not equal to -1"); } return st; } diff --git a/be/src/cloud/cloud_storage_engine.cpp b/be/src/cloud/cloud_storage_engine.cpp index b66a9cfbdb2245..650909a29157cd 100644 --- a/be/src/cloud/cloud_storage_engine.cpp +++ b/be/src/cloud/cloud_storage_engine.cpp @@ -677,7 +677,8 @@ Status CloudStorageEngine::_submit_cumulative_compaction_task(const CloudTabletS auto st = compaction->prepare_compact(); if (!st.ok()) { long now = duration_cast(system_clock::now().time_since_epoch()).count(); - if (st.is()) { + if (st.is() && + st.msg() != "_last_delete_version.first not equal to -1") { // Backoff strategy if no suitable version tablet->last_cumu_no_suitable_version_ms = now; } diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index 379fb6eec3cb43..8d56d1b499e93e 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -1731,8 +1731,13 @@ Status Tablet::prepare_compaction_and_calculate_permits( } if (!res.ok()) { - tablet->set_last_cumu_compaction_failure_time(UnixMillis()); permits = 0; + // if we meet a delete version, should increase the cumulative point to let base compaction handle the delete version. + // no need to wait 5s. + if (!(res.msg() == "_last_delete_version.first not equal to -1")) { + DCHECK(res.is()); + tablet->set_last_cumu_compaction_failure_time(UnixMillis()); + } if (!res.is()) { DorisMetrics::instance()->cumulative_compaction_request_failed->increment(1); return Status::InternalError("prepare cumulative compaction with err: {}", res); @@ -1740,6 +1745,12 @@ Status Tablet::prepare_compaction_and_calculate_permits( // return OK if OLAP_ERR_CUMULATIVE_NO_SUITABLE_VERSION, so that we don't need to // print too much useless logs. // And because we set permits to 0, so even if we return OK here, nothing will be done. + LOG_INFO( + "cumulative compaction meet delete rowset, increase cumu point without other " + "operation.") + .tag("tablet id:", tablet->tablet_id()) + .tag("after cumulative compaction, cumu point:", + tablet->cumulative_layer_point()); return Status::OK(); } } else if (compaction_type == CompactionType::BASE_COMPACTION) { diff --git a/regression-test/data/compaction/test_cumu_compaction_with_delete.out b/regression-test/data/compaction/test_cumu_compaction_with_delete.out new file mode 100644 index 00000000000000..2d0787106900ea --- /dev/null +++ b/regression-test/data/compaction/test_cumu_compaction_with_delete.out @@ -0,0 +1,37 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !1 -- +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 + +-- !3 -- +2 2 +3 3 +4 4 +5 5 +6 6 + +-- !4 -- +3 3 +4 4 +5 5 +6 6 + +-- !5 -- +4 4 +5 5 +6 6 + +-- !5 -- +5 5 +6 6 + +-- !5 -- +6 6 + +-- !6 -- +6 6 + diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy new file mode 100644 index 00000000000000..b77a6d02c66550 --- /dev/null +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -0,0 +1,186 @@ +// 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 + +suite("test_cumu_compaction_with_delete") { + def tableName = "test_cumu_compaction_with_delete" + def cloudMode = isCloudMode() + + def check_version_and_cumu_point = { tablets, version, cumu_point -> + // before compaction, there are 6 rowsets. + int rowsetCount = 0 + int cumuPoint = 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 + rowsetCount +=((List) tabletJson.rowsets).size() + //logger.info(tabletJson) + cumuPoint = tabletJson["cumulative point"] + } + assert (rowsetCount == version * 1) + assert (cumuPoint == cumu_point) + } + + def cumulative_compaction = { tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id -> + // trigger cumu compactions for all tablets in ${tableName} + for (def tablet in tablets) { + String tablet_id = tablet.TabletId + backend_id = tablet.BackendId + + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) + logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) + sleep(1000) + + def compactJson = parseJson(out.trim()) + } + } + + 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] + + sql """ DROP TABLE IF EXISTS ${tableName} """ + sql """ + CREATE TABLE ${tableName} ( + `user_id` INT NOT NULL, + `value` INT NOT NULL) + UNIQUE KEY(`user_id`) + DISTRIBUTED BY HASH(`user_id`) + BUCKETS 1 + PROPERTIES ("replication_allocation" = "tag.location.default: 1", + "disable_auto_compaction" = "true", + "enable_mow_light_delete" = "true")""" + + // [0-1] | [2-2] [3-3] [4-4] [5-5] [6-6] [7-7] + // cumu point = 2 + sql """ INSERT INTO ${tableName} VALUES (1,1)""" + sql """ INSERT INTO ${tableName} VALUES (2,2)""" + sql """ INSERT INTO ${tableName} VALUES (3,3)""" + sql """ INSERT INTO ${tableName} VALUES (4,4)""" + sql """ INSERT INTO ${tableName} VALUES (5,5)""" + sql """ INSERT INTO ${tableName} VALUES (6,6)""" + qt_1 """select * from ${tableName} order by user_id, value""" + + //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}; """ + + check_version_and_cumu_point(tablets, 7, 2) + + // [0-1] [2-7] | + // cumu point = 2 + cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) + if (cloudMode) { + check_version_and_cumu_point(tablets, 2, 2) + } else { + check_version_and_cumu_point(tablets, 2, 8) + } + + // [0-1] [2-7] | [8-8] + // cumu point = 8 + sql """ delete from ${tableName} where user_id = 1""" + qt_3 """select * from ${tableName} order by user_id, value""" + + // [0-1] [2-7] [8-8] | + // cumu point = 9 + cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) + check_version_and_cumu_point(tablets, 3, 9) + + // [0-1] [2-7] [8-8] | [9-9] + // cumu point = 9 + sql """ delete from ${tableName} where user_id = 2""" + qt_4 """select * from ${tableName} order by user_id, value""" + + // [0-1] [2-7] [8-8] [9-9] | + // cumu point = 10 + cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) + check_version_and_cumu_point(tablets, 4, 10) + + // [0-1] [2-7] [8-8] [9-9] | [10-10] + // cumu point = 10 + sql """ delete from ${tableName} where user_id = 3""" + qt_5 """select * from ${tableName} order by user_id, value""" + + // [0-1] [2-7] [8-8] [9-9] [10-10] | + // cumu point = 11 + cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) + check_version_and_cumu_point(tablets, 5, 11) + + // [0-1] [2-7] [8-8] [9-9] [10-10] | [11-11] + // cumu point = 11 + sql """ delete from ${tableName} where user_id = 4""" + qt_5 """select * from ${tableName} order by user_id, value""" + + // [0-1] [2-7] [8-8] [9-9] [10-10] [11-11] | + // cumu point = 12 + cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) + check_version_and_cumu_point(tablets, 6, 12) + + // [0-1] [2-7] [8-8] [9-9] [10-10] [11-11] | [12-12] + // cumu point = 12 + sql """ delete from ${tableName} where user_id = 5""" + qt_5 """select * from ${tableName} order by user_id, value""" + + // [0-1] [2-7] [8-8] [9-9] [10-10] [11-11] [12-12] | + // cumu point = 13 + cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) + check_version_and_cumu_point(tablets, 7, 13) + + // trigger base compactions for all tablets in ${tableName} + for (def tablet in tablets) { + String tablet_id = tablet.TabletId + backend_id = tablet.BackendId + + (code, out, err) = be_run_base_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) + logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) + sleep(1000) + + def compactJson = parseJson(out.trim()) + } + + // after base compaction, there is only 1 rowset. + rowsetCount = 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 + rowsetCount +=((List) tabletJson.rowsets).size() + } + if (cloudMode) { + assert (rowsetCount == 2) + } else { + assert (rowsetCount == 1) + } + + qt_6 """select * from ${tableName} order by user_id, value""" + + } finally { + try_sql("DROP TABLE IF EXISTS ${tableName}") + } +} From 67c8f50d64522a213e50e5ce57a527082fa90b34 Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Thu, 5 Dec 2024 01:35:00 +0800 Subject: [PATCH 02/11] 2 --- be/src/olap/cumulative_compaction_policy.cpp | 2 + .../test_cumu_compaction_with_delete.out | 34 -------- .../test_cumu_compaction_with_delete.groovy | 80 ++++--------------- 3 files changed, 18 insertions(+), 98 deletions(-) diff --git a/be/src/olap/cumulative_compaction_policy.cpp b/be/src/olap/cumulative_compaction_policy.cpp index ee7a2b1812a0ae..36de9f96158f1b 100644 --- a/be/src/olap/cumulative_compaction_policy.cpp +++ b/be/src/olap/cumulative_compaction_policy.cpp @@ -286,6 +286,8 @@ int SizeBasedCumulativeCompactionPolicy::pick_input_rowsets( } DBUG_EXECUTE_IF("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.return_input_rowsets", { return transient_size; }) + DBUG_EXECUTE_IF("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max", + { promotion_size = INT64_MAX; }) if (total_size >= promotion_size) { return transient_size; diff --git a/regression-test/data/compaction/test_cumu_compaction_with_delete.out b/regression-test/data/compaction/test_cumu_compaction_with_delete.out index 2d0787106900ea..12b32ed478443a 100644 --- a/regression-test/data/compaction/test_cumu_compaction_with_delete.out +++ b/regression-test/data/compaction/test_cumu_compaction_with_delete.out @@ -1,37 +1,3 @@ -- This file is automatically generated. You should know what you did if you want to edit this --- !1 -- -1 1 -2 2 -3 3 -4 4 -5 5 -6 6 - --- !3 -- -2 2 -3 3 -4 4 -5 5 -6 6 - --- !4 -- -3 3 -4 4 -5 5 -6 6 - --- !5 -- -4 4 -5 5 -6 6 - --- !5 -- -5 5 -6 6 - --- !5 -- -6 6 - -- !6 -- -6 6 diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy index b77a6d02c66550..be1e1dda85bd9e 100644 --- a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -54,7 +54,9 @@ suite("test_cumu_compaction_with_delete") { } } + GetDebugPoint().clearDebugPointsForAllBEs() try { + GetDebugPoint().enableDebugPointForAllBEs("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max") String backend_id; def backendId_to_backendIP = [:] @@ -75,79 +77,26 @@ suite("test_cumu_compaction_with_delete") { "disable_auto_compaction" = "true", "enable_mow_light_delete" = "true")""" - // [0-1] | [2-2] [3-3] [4-4] [5-5] [6-6] [7-7] - // cumu point = 2 - sql """ INSERT INTO ${tableName} VALUES (1,1)""" - sql """ INSERT INTO ${tableName} VALUES (2,2)""" - sql """ INSERT INTO ${tableName} VALUES (3,3)""" - sql """ INSERT INTO ${tableName} VALUES (4,4)""" - sql """ INSERT INTO ${tableName} VALUES (5,5)""" - sql """ INSERT INTO ${tableName} VALUES (6,6)""" - qt_1 """select * from ${tableName} order by user_id, value""" - //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}; """ - check_version_and_cumu_point(tablets, 7, 2) - - // [0-1] [2-7] | - // cumu point = 2 - cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - if (cloudMode) { - check_version_and_cumu_point(tablets, 2, 2) - } else { - check_version_and_cumu_point(tablets, 2, 8) - } - - // [0-1] [2-7] | [8-8] - // cumu point = 8 + // [0-1] | [2-2] [3-3] [4-4] [5-5] [6-6] [7-7] + // cumu point = 2 + sql """ INSERT INTO ${tableName} VALUES (1,1)""" sql """ delete from ${tableName} where user_id = 1""" - qt_3 """select * from ${tableName} order by user_id, value""" - - // [0-1] [2-7] [8-8] | - // cumu point = 9 cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - check_version_and_cumu_point(tablets, 3, 9) - // [0-1] [2-7] [8-8] | [9-9] - // cumu point = 9 - sql """ delete from ${tableName} where user_id = 2""" - qt_4 """select * from ${tableName} order by user_id, value""" - - // [0-1] [2-7] [8-8] [9-9] | - // cumu point = 10 - cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - check_version_and_cumu_point(tablets, 4, 10) - - // [0-1] [2-7] [8-8] [9-9] | [10-10] - // cumu point = 10 - sql """ delete from ${tableName} where user_id = 3""" - qt_5 """select * from ${tableName} order by user_id, value""" - - // [0-1] [2-7] [8-8] [9-9] [10-10] | - // cumu point = 11 + sql """ INSERT INTO ${tableName} VALUES (1,1)""" + sql """ delete from ${tableName} where user_id = 1""" cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - check_version_and_cumu_point(tablets, 5, 11) - - // [0-1] [2-7] [8-8] [9-9] [10-10] | [11-11] - // cumu point = 11 - sql """ delete from ${tableName} where user_id = 4""" - qt_5 """select * from ${tableName} order by user_id, value""" - // [0-1] [2-7] [8-8] [9-9] [10-10] [11-11] | - // cumu point = 12 + sql """ INSERT INTO ${tableName} VALUES (1,1)""" + sql """ delete from ${tableName} where user_id = 1""" cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - check_version_and_cumu_point(tablets, 6, 12) - - // [0-1] [2-7] [8-8] [9-9] [10-10] [11-11] | [12-12] - // cumu point = 12 - sql """ delete from ${tableName} where user_id = 5""" - qt_5 """select * from ${tableName} order by user_id, value""" - // [0-1] [2-7] [8-8] [9-9] [10-10] [11-11] [12-12] | - // cumu point = 13 + sql """ INSERT INTO ${tableName} VALUES (1,1)""" + sql """ delete from ${tableName} where user_id = 1""" cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - check_version_and_cumu_point(tablets, 7, 13) // trigger base compactions for all tablets in ${tableName} for (def tablet in tablets) { @@ -179,8 +128,11 @@ suite("test_cumu_compaction_with_delete") { } qt_6 """select * from ${tableName} order by user_id, value""" - + } catch (Exception e){ + logger.info(e.getMessage()) + assertFalse(true) } finally { - try_sql("DROP TABLE IF EXISTS ${tableName}") + try_sql("DROP TABLE IF EXISTS ${tableName} FORCE") + GetDebugPoint().disableDebugPointForAllBEs("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max") } } From c0a872c2caf344cefd51fdd46f7546bcbd7f9a5b Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Thu, 5 Dec 2024 02:30:04 +0800 Subject: [PATCH 03/11] 3 --- be/src/olap/cumulative_compaction_policy.cpp | 5 +- be/src/olap/tablet_manager.cpp | 3 + .../test_cumu_compaction_with_delete.groovy | 96 ++----------------- 3 files changed, 12 insertions(+), 92 deletions(-) diff --git a/be/src/olap/cumulative_compaction_policy.cpp b/be/src/olap/cumulative_compaction_policy.cpp index 36de9f96158f1b..fd9393558250f5 100644 --- a/be/src/olap/cumulative_compaction_policy.cpp +++ b/be/src/olap/cumulative_compaction_policy.cpp @@ -286,8 +286,9 @@ int SizeBasedCumulativeCompactionPolicy::pick_input_rowsets( } DBUG_EXECUTE_IF("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.return_input_rowsets", { return transient_size; }) - DBUG_EXECUTE_IF("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max", - { promotion_size = INT64_MAX; }) + DBUG_EXECUTE_IF( + "SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max", + { promotion_size = INT64_MAX; }) if (total_size >= promotion_size) { return transient_size; diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp index 33fee7ca350900..1d84aaca134381 100644 --- a/be/src/olap/tablet_manager.cpp +++ b/be/src/olap/tablet_manager.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -758,6 +759,8 @@ std::vector TabletManager::find_best_tablets_to_compaction( last_failure_ms = tablet_ptr->last_base_compaction_failure_time(); } if (now_ms - last_failure_ms <= 5000) { + DBUG_EXECUTE_IF("TabletManager::find_best_tablets_to_compaction.dcheck", + { DCHECK(false) << "Too often to check compaction"; }) VLOG_DEBUG << "Too often to check compaction, skip it. " << "compaction_type=" << compaction_type_str << ", last_failure_time_ms=" << last_failure_ms diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy index be1e1dda85bd9e..b5a641faa9d919 100644 --- a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -19,51 +19,11 @@ import org.codehaus.groovy.runtime.IOGroovyMethods suite("test_cumu_compaction_with_delete") { def tableName = "test_cumu_compaction_with_delete" - def cloudMode = isCloudMode() - - def check_version_and_cumu_point = { tablets, version, cumu_point -> - // before compaction, there are 6 rowsets. - int rowsetCount = 0 - int cumuPoint = 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 - rowsetCount +=((List) tabletJson.rowsets).size() - //logger.info(tabletJson) - cumuPoint = tabletJson["cumulative point"] - } - assert (rowsetCount == version * 1) - assert (cumuPoint == cumu_point) - } - - def cumulative_compaction = { tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id -> - // trigger cumu compactions for all tablets in ${tableName} - for (def tablet in tablets) { - String tablet_id = tablet.TabletId - backend_id = tablet.BackendId - - (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) - logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) - sleep(1000) - - def compactJson = parseJson(out.trim()) - } - } GetDebugPoint().clearDebugPointsForAllBEs() try { GetDebugPoint().enableDebugPointForAllBEs("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max") - 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] + GetDebugPoint().enableDebugPointForAllBEs("TabletManager::find_best_tablets_to_compaction.dcheck") sql """ DROP TABLE IF EXISTS ${tableName} """ sql """ @@ -74,57 +34,12 @@ suite("test_cumu_compaction_with_delete") { DISTRIBUTED BY HASH(`user_id`) BUCKETS 1 PROPERTIES ("replication_allocation" = "tag.location.default: 1", - "disable_auto_compaction" = "true", "enable_mow_light_delete" = "true")""" - //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}; """ - - // [0-1] | [2-2] [3-3] [4-4] [5-5] [6-6] [7-7] - // cumu point = 2 - sql """ INSERT INTO ${tableName} VALUES (1,1)""" - sql """ delete from ${tableName} where user_id = 1""" - cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - - sql """ INSERT INTO ${tableName} VALUES (1,1)""" - sql """ delete from ${tableName} where user_id = 1""" - cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - - sql """ INSERT INTO ${tableName} VALUES (1,1)""" - sql """ delete from ${tableName} where user_id = 1""" - cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - - sql """ INSERT INTO ${tableName} VALUES (1,1)""" - sql """ delete from ${tableName} where user_id = 1""" - cumulative_compaction(tablets, backendId_to_backendIP, backendId_to_backendHttpPort, backend_id) - - // trigger base compactions for all tablets in ${tableName} - for (def tablet in tablets) { - String tablet_id = tablet.TabletId - backend_id = tablet.BackendId - - (code, out, err) = be_run_base_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) - logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) - sleep(1000) - - def compactJson = parseJson(out.trim()) - } - - // after base compaction, there is only 1 rowset. - rowsetCount = 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 - rowsetCount +=((List) tabletJson.rowsets).size() - } - if (cloudMode) { - assert (rowsetCount == 2) - } else { - assert (rowsetCount == 1) + for(int i = 1; i <= 100; ++i){ + sql """ INSERT INTO ${tableName} VALUES (1,1)""" + sql """ delete from ${tableName} where user_id = 1""" + Thread.sleep(500) } qt_6 """select * from ${tableName} order by user_id, value""" @@ -134,5 +49,6 @@ suite("test_cumu_compaction_with_delete") { } finally { try_sql("DROP TABLE IF EXISTS ${tableName} FORCE") GetDebugPoint().disableDebugPointForAllBEs("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max") + GetDebugPoint().disableDebugPointForAllBEs("TabletManager::find_best_tablets_to_compaction.dcheck") } } From 834b174abd2f7ff8cdac8fe7ffdfaae7ed33ff42 Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Thu, 5 Dec 2024 15:13:50 +0800 Subject: [PATCH 04/11] 4 --- be/src/olap/cumulative_compaction_policy.cpp | 3 -- be/src/olap/tablet_manager.cpp | 3 -- .../test_cumu_compaction_with_delete.out | 3 -- .../test_cumu_compaction_with_delete.groovy | 54 ------------------- 4 files changed, 63 deletions(-) delete mode 100644 regression-test/data/compaction/test_cumu_compaction_with_delete.out delete mode 100644 regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy diff --git a/be/src/olap/cumulative_compaction_policy.cpp b/be/src/olap/cumulative_compaction_policy.cpp index fd9393558250f5..ee7a2b1812a0ae 100644 --- a/be/src/olap/cumulative_compaction_policy.cpp +++ b/be/src/olap/cumulative_compaction_policy.cpp @@ -286,9 +286,6 @@ int SizeBasedCumulativeCompactionPolicy::pick_input_rowsets( } DBUG_EXECUTE_IF("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.return_input_rowsets", { return transient_size; }) - DBUG_EXECUTE_IF( - "SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max", - { promotion_size = INT64_MAX; }) if (total_size >= promotion_size) { return transient_size; diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp index 1d84aaca134381..33fee7ca350900 100644 --- a/be/src/olap/tablet_manager.cpp +++ b/be/src/olap/tablet_manager.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -759,8 +758,6 @@ std::vector TabletManager::find_best_tablets_to_compaction( last_failure_ms = tablet_ptr->last_base_compaction_failure_time(); } if (now_ms - last_failure_ms <= 5000) { - DBUG_EXECUTE_IF("TabletManager::find_best_tablets_to_compaction.dcheck", - { DCHECK(false) << "Too often to check compaction"; }) VLOG_DEBUG << "Too often to check compaction, skip it. " << "compaction_type=" << compaction_type_str << ", last_failure_time_ms=" << last_failure_ms diff --git a/regression-test/data/compaction/test_cumu_compaction_with_delete.out b/regression-test/data/compaction/test_cumu_compaction_with_delete.out deleted file mode 100644 index 12b32ed478443a..00000000000000 --- a/regression-test/data/compaction/test_cumu_compaction_with_delete.out +++ /dev/null @@ -1,3 +0,0 @@ --- This file is automatically generated. You should know what you did if you want to edit this --- !6 -- - diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy deleted file mode 100644 index b5a641faa9d919..00000000000000 --- a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy +++ /dev/null @@ -1,54 +0,0 @@ -// 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 - -suite("test_cumu_compaction_with_delete") { - def tableName = "test_cumu_compaction_with_delete" - - GetDebugPoint().clearDebugPointsForAllBEs() - try { - GetDebugPoint().enableDebugPointForAllBEs("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max") - GetDebugPoint().enableDebugPointForAllBEs("TabletManager::find_best_tablets_to_compaction.dcheck") - - sql """ DROP TABLE IF EXISTS ${tableName} """ - sql """ - CREATE TABLE ${tableName} ( - `user_id` INT NOT NULL, - `value` INT NOT NULL) - UNIQUE KEY(`user_id`) - DISTRIBUTED BY HASH(`user_id`) - BUCKETS 1 - PROPERTIES ("replication_allocation" = "tag.location.default: 1", - "enable_mow_light_delete" = "true")""" - - for(int i = 1; i <= 100; ++i){ - sql """ INSERT INTO ${tableName} VALUES (1,1)""" - sql """ delete from ${tableName} where user_id = 1""" - Thread.sleep(500) - } - - qt_6 """select * from ${tableName} order by user_id, value""" - } catch (Exception e){ - logger.info(e.getMessage()) - assertFalse(true) - } finally { - try_sql("DROP TABLE IF EXISTS ${tableName} FORCE") - GetDebugPoint().disableDebugPointForAllBEs("SizeBaseCumulativeCompactionPolicy.pick_input_rowsets.set_promotion_size_to_max") - GetDebugPoint().disableDebugPointForAllBEs("TabletManager::find_best_tablets_to_compaction.dcheck") - } -} From 551e9158102a6b0cfafc23385880490390f73723 Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Thu, 5 Dec 2024 20:08:14 +0800 Subject: [PATCH 05/11] 5 --- .../test_cumu_compaction_with_delete.out | 3 + .../test_cumu_compaction_with_delete.groovy | 73 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 regression-test/data/compaction/test_cumu_compaction_with_delete.out create mode 100644 regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy diff --git a/regression-test/data/compaction/test_cumu_compaction_with_delete.out b/regression-test/data/compaction/test_cumu_compaction_with_delete.out new file mode 100644 index 00000000000000..f958424e65c626 --- /dev/null +++ b/regression-test/data/compaction/test_cumu_compaction_with_delete.out @@ -0,0 +1,3 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !select -- + diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy new file mode 100644 index 00000000000000..ae06aa89d91eee --- /dev/null +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -0,0 +1,73 @@ +// 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 + +suite("test_cumu_compaction_with_delete") { + def tableName = "test_cumu_compaction_with_delete" + def check_cumu_point = { cumu_point -> + def tablets = sql_return_maparray """ show tablets from ${tableName}; """ + int cumuPoint = 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 + cumuPoint = tabletJson["cumulative point"] + } + return cumuPoint == cumu_point + } + + try { + sql """ DROP TABLE IF EXISTS ${tableName} """ + sql """ + CREATE TABLE ${tableName} ( + `user_id` INT NOT NULL, + `value` INT NOT NULL) + UNIQUE KEY(`user_id`) + DISTRIBUTED BY HASH(`user_id`) + BUCKETS 1 + PROPERTIES ("replication_allocation" = "tag.location.default: 1", + "enable_mow_light_delete" = "true")""" + + for(int i = 1; i <= 50; ++i){ + sql """ INSERT INTO ${tableName} VALUES (1,1)""" + sql """ delete from ${tableName} where user_id = 1""" + } + + now = System.currentTimeMillis() + + while(true){ + if(check_cumu_point(102)){ + break; + } + Thread.sleep(1000) + } + time_diff = System.currentTimeMillis() - now + logger.info("time_diff:" + time_diff) + assertTrue(time_diff<250*1000) + + qt_select """select * from ${tableName} order by user_id, value""" + } catch (Exception e){ + logger.info(e.getMessage()) + assertFalse(true) + } finally { + try_sql("DROP TABLE IF EXISTS ${tableName} FORCE") + } +} \ No newline at end of file From ef39ca1193ba02a38b582e8094eb6a104528f588 Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Fri, 6 Dec 2024 02:35:41 +0800 Subject: [PATCH 06/11] 6 --- be/src/olap/tablet.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index 8d56d1b499e93e..4e62373b7f0d7a 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -1735,7 +1735,6 @@ Status Tablet::prepare_compaction_and_calculate_permits( // if we meet a delete version, should increase the cumulative point to let base compaction handle the delete version. // no need to wait 5s. if (!(res.msg() == "_last_delete_version.first not equal to -1")) { - DCHECK(res.is()); tablet->set_last_cumu_compaction_failure_time(UnixMillis()); } if (!res.is()) { From 5db2e8dd90adce8d8fc210a6807f66ca14055dd7 Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Fri, 6 Dec 2024 10:17:57 +0800 Subject: [PATCH 07/11] 7 --- .../suites/compaction/test_cumu_compaction_with_delete.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy index ae06aa89d91eee..f0ef2fb377dedc 100644 --- a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -28,7 +28,6 @@ suite("test_cumu_compaction_with_delete") { logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def tabletJson = parseJson(out.trim()) - assert tabletJson.rowsets instanceof List cumuPoint = tabletJson["cumulative point"] } return cumuPoint == cumu_point From 9c2a213abb24c31b1aafc582259e0b93b18a7bab Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Sat, 7 Dec 2024 20:24:48 +0800 Subject: [PATCH 08/11] 8 --- .../compaction/test_cumu_compaction_with_delete.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy index f0ef2fb377dedc..a1dfc3b9864b1c 100644 --- a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -30,7 +30,7 @@ suite("test_cumu_compaction_with_delete") { def tabletJson = parseJson(out.trim()) cumuPoint = tabletJson["cumulative point"] } - return cumuPoint == cumu_point + return cumuPoint > cumu_point } try { @@ -45,7 +45,7 @@ suite("test_cumu_compaction_with_delete") { PROPERTIES ("replication_allocation" = "tag.location.default: 1", "enable_mow_light_delete" = "true")""" - for(int i = 1; i <= 50; ++i){ + for(int i = 1; i <= 100; ++i){ sql """ INSERT INTO ${tableName} VALUES (1,1)""" sql """ delete from ${tableName} where user_id = 1""" } @@ -53,7 +53,7 @@ suite("test_cumu_compaction_with_delete") { now = System.currentTimeMillis() while(true){ - if(check_cumu_point(102)){ + if(check_cumu_point(100)){ break; } Thread.sleep(1000) From d32857575a112fcb6736be3068a7b7f9784214c4 Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Tue, 10 Dec 2024 19:52:46 +0800 Subject: [PATCH 09/11] 9 --- be/src/cloud/cloud_cumulative_compaction.cpp | 6 ++- be/src/common/config.cpp | 1 + be/src/common/config.h | 2 + be/src/olap/tablet.cpp | 3 +- .../test_cumu_compaction_with_delete.groovy | 50 +++++++++++++++++++ 5 files changed, 59 insertions(+), 3 deletions(-) diff --git a/be/src/cloud/cloud_cumulative_compaction.cpp b/be/src/cloud/cloud_cumulative_compaction.cpp index 948b5778a274ba..eda7f6c1190abd 100644 --- a/be/src/cloud/cloud_cumulative_compaction.cpp +++ b/be/src/cloud/cloud_cumulative_compaction.cpp @@ -92,8 +92,10 @@ Status CloudCumulativeCompaction::prepare_compact() { // plus 1 to skip the delete version. // NOTICE: after that, the cumulative point may be larger than max version of this tablet, but it doesn't matter. update_cumulative_point(); - st = Status::Error( - "_last_delete_version.first not equal to -1"); + if (config::enable_sleep_between_delete_cumu_compaction) { + st = Status::Error( + "_last_delete_version.first not equal to -1"); + } } return st; } diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index 1528d9091c2f43..11759a91bd329d 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -1400,6 +1400,7 @@ DEFINE_mBool(enable_delete_bitmap_merge_on_compaction, "false"); // Enable validation to check the correctness of table size. DEFINE_Bool(enable_table_size_correctness_check, "false"); DEFINE_Bool(force_regenerate_rowsetid_on_start_error, "false"); +DEFINE_mBool(enable_sleep_between_delete_cumu_compaction, "false"); // clang-format off #ifdef BE_TEST diff --git a/be/src/common/config.h b/be/src/common/config.h index 3bdbeb95edb65d..f507120e6081f8 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -1486,6 +1486,8 @@ DECLARE_Bool(force_regenerate_rowsetid_on_start_error); DECLARE_mBool(enable_delete_bitmap_merge_on_compaction); // Enable validation to check the correctness of table size. DECLARE_Bool(enable_table_size_correctness_check); +// Enable sleep 5s between delete cumulative compaction. +DECLARE_mBool(enable_sleep_between_delete_cumu_compaction); #ifdef BE_TEST // test s3 diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index 4e62373b7f0d7a..c04caf98fcfa6b 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -1734,7 +1734,8 @@ Status Tablet::prepare_compaction_and_calculate_permits( permits = 0; // if we meet a delete version, should increase the cumulative point to let base compaction handle the delete version. // no need to wait 5s. - if (!(res.msg() == "_last_delete_version.first not equal to -1")) { + if (!(res.msg() == "_last_delete_version.first not equal to -1") || + config::enable_sleep_between_delete_cumu_compaction) { tablet->set_last_cumu_compaction_failure_time(UnixMillis()); } if (!res.is()) { diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy index a1dfc3b9864b1c..dbf2bb32194477 100644 --- a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -69,4 +69,54 @@ suite("test_cumu_compaction_with_delete") { } finally { try_sql("DROP TABLE IF EXISTS ${tableName} FORCE") } + + def backendId_to_backendIP = [:] + 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) + } + } + + try { + set_be_config.call("enable_sleep_between_delete_cumu_compaction", "true") + sql """ DROP TABLE IF EXISTS ${tableName} """ + sql """ + CREATE TABLE ${tableName} ( + `user_id` INT NOT NULL, + `value` INT NOT NULL) + UNIQUE KEY(`user_id`) + DISTRIBUTED BY HASH(`user_id`) + BUCKETS 1 + PROPERTIES ("replication_allocation" = "tag.location.default: 1", + "enable_mow_light_delete" = "true")""" + + for(int i = 1; i <= 100; ++i){ + sql """ INSERT INTO ${tableName} VALUES (1,1)""" + sql """ delete from ${tableName} where user_id = 1""" + } + + now = System.currentTimeMillis() + + while(true){ + if(check_cumu_point(100)){ + break; + } + Thread.sleep(1000) + } + time_diff = System.currentTimeMillis() - now + logger.info("time_diff:" + time_diff) + assertTrue(time_diff>=250*1000) + + qt_select """select * from ${tableName} order by user_id, value""" + } catch (Exception e){ + logger.info(e.getMessage()) + assertFalse(true) + } finally { + try_sql("DROP TABLE IF EXISTS ${tableName} FORCE") + set_be_config.call("enable_sleep_between_delete_cumu_compaction", "false") + } } \ No newline at end of file From abb7d02432ff6a3e030f6b89f7d08115e5765ccf Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Tue, 10 Dec 2024 21:24:08 +0800 Subject: [PATCH 10/11] 10 --- be/src/cloud/cloud_cumulative_compaction.cpp | 2 +- .../data/compaction/test_cumu_compaction_with_delete.out | 4 +++- .../compaction/test_cumu_compaction_with_delete.groovy | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/be/src/cloud/cloud_cumulative_compaction.cpp b/be/src/cloud/cloud_cumulative_compaction.cpp index eda7f6c1190abd..52e646409f8120 100644 --- a/be/src/cloud/cloud_cumulative_compaction.cpp +++ b/be/src/cloud/cloud_cumulative_compaction.cpp @@ -92,7 +92,7 @@ Status CloudCumulativeCompaction::prepare_compact() { // plus 1 to skip the delete version. // NOTICE: after that, the cumulative point may be larger than max version of this tablet, but it doesn't matter. update_cumulative_point(); - if (config::enable_sleep_between_delete_cumu_compaction) { + if (!config::enable_sleep_between_delete_cumu_compaction) { st = Status::Error( "_last_delete_version.first not equal to -1"); } diff --git a/regression-test/data/compaction/test_cumu_compaction_with_delete.out b/regression-test/data/compaction/test_cumu_compaction_with_delete.out index f958424e65c626..642559699ac60c 100644 --- a/regression-test/data/compaction/test_cumu_compaction_with_delete.out +++ b/regression-test/data/compaction/test_cumu_compaction_with_delete.out @@ -1,3 +1,5 @@ -- This file is automatically generated. You should know what you did if you want to edit this --- !select -- +-- !select1 -- + +-- !select2 -- diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy index dbf2bb32194477..5466b395efe453 100644 --- a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -60,9 +60,9 @@ suite("test_cumu_compaction_with_delete") { } time_diff = System.currentTimeMillis() - now logger.info("time_diff:" + time_diff) - assertTrue(time_diff<250*1000) + assertTrue(time_diff<200*1000) - qt_select """select * from ${tableName} order by user_id, value""" + qt_select1 """select * from ${tableName} order by user_id, value""" } catch (Exception e){ logger.info(e.getMessage()) assertFalse(true) @@ -111,7 +111,7 @@ suite("test_cumu_compaction_with_delete") { logger.info("time_diff:" + time_diff) assertTrue(time_diff>=250*1000) - qt_select """select * from ${tableName} order by user_id, value""" + qt_select2 """select * from ${tableName} order by user_id, value""" } catch (Exception e){ logger.info(e.getMessage()) assertFalse(true) From 5e9fc93c7d52f682ed437443f445662727caa8b1 Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Wed, 11 Dec 2024 22:46:43 +0800 Subject: [PATCH 11/11] 11 --- .../suites/compaction/test_cumu_compaction_with_delete.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy index 5466b395efe453..7c6be0b177ce1e 100644 --- a/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy +++ b/regression-test/suites/compaction/test_cumu_compaction_with_delete.groovy @@ -109,7 +109,7 @@ suite("test_cumu_compaction_with_delete") { } time_diff = System.currentTimeMillis() - now logger.info("time_diff:" + time_diff) - assertTrue(time_diff>=250*1000) + assertTrue(time_diff>=200*1000) qt_select2 """select * from ${tableName} order by user_id, value""" } catch (Exception e){