This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 2da8f8bae31 [Improvement](mow) Make calculate delete bitmap timeout configurable (#38668) 2da8f8bae31 is described below commit 2da8f8bae31e76e6f887724708fb5b2f51475e65 Author: huanghaibin <284824...@qq.com> AuthorDate: Sun Aug 4 10:15:34 2024 +0800 [Improvement](mow) Make calculate delete bitmap timeout configurable (#38668) Now the timeout of calculating delete bitmap is hard code, make it configurable. --- fe/fe-common/src/main/java/org/apache/doris/common/Config.java | 9 +++++++++ .../doris/cloud/transaction/CloudGlobalTransactionMgr.java | 6 ++---- .../main/java/org/apache/doris/service/FrontendServiceImpl.java | 6 ++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java index e67fd0a525c..3c8d0e0592a 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java @@ -2972,6 +2972,15 @@ public class Config extends ConfigBase { @ConfField(description = {"存算分离模式下建表是否检查残留recycler key, 默认true", "create table in cloud mode, check recycler key remained, default true"}) public static boolean check_create_table_recycle_key_remained = true; + + @ConfField(mutable = true, description = {"存算分离模式下fe向ms请求锁的过期时间,默认10s"}) + public static int delete_bitmap_lock_expiration_seconds = 10; + + @ConfField(mutable = true, description = {"存算分离模式下calculate delete bitmap task 超时时间,默认15s"}) + public static int calculate_delete_bitmap_task_timeout_seconds = 15; + + @ConfField(mutable = true, description = {"存算分离模式下commit阶段等锁超时时间,默认5s"}) + public static int try_commit_lock_timeout_seconds = 5; // ATTN: DONOT add any config not related to cloud mode here // ATTN: DONOT add any config not related to cloud mode here // ATTN: DONOT add any config not related to cloud mode here diff --git a/fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java b/fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java index b153fd006c4..000c05fde27 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java @@ -147,8 +147,6 @@ import java.util.stream.Collectors; public class CloudGlobalTransactionMgr implements GlobalTransactionMgrIface { private static final Logger LOG = LogManager.getLogger(CloudGlobalTransactionMgr.class); private static final String NOT_SUPPORTED_MSG = "Not supported in cloud mode"; - private static final int DELETE_BITMAP_LOCK_EXPIRATION_SECONDS = 10; - private static final int CALCULATE_DELETE_BITMAP_TASK_TIMEOUT_SECONDS = 15; private TxnStateCallbackFactory callbackFactory; private final Map<Long, Long> subTxnIdToTxnId = new ConcurrentHashMap<>(); @@ -743,7 +741,7 @@ public class CloudGlobalTransactionMgr implements GlobalTransactionMgrIface { builder.setTableId(entry.getKey()) .setLockId(transactionId) .setInitiator(-1) - .setExpiration(DELETE_BITMAP_LOCK_EXPIRATION_SECONDS) + .setExpiration(Config.delete_bitmap_lock_expiration_seconds) .setRequireCompactionStats(true); List<Long> tabletList = tableToTabletList.get(entry.getKey()); for (Long tabletId : tabletList) { @@ -853,7 +851,7 @@ public class CloudGlobalTransactionMgr implements GlobalTransactionMgrIface { boolean ok; try { - ok = countDownLatch.await(CALCULATE_DELETE_BITMAP_TASK_TIMEOUT_SECONDS, TimeUnit.SECONDS); + ok = countDownLatch.await(Config.calculate_delete_bitmap_task_timeout_seconds, TimeUnit.SECONDS); } catch (InterruptedException e) { LOG.warn("InterruptedException: ", e); ok = false; diff --git a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java index 47bcff7c6f5..56d2cb01e6a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java +++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java @@ -1679,7 +1679,8 @@ public class FrontendServiceImpl implements FrontendService.Iface { + request.isSetDbId() + " id: " + Long.toString(request.isSetDbId() ? request.getDbId() : 0) + " fullDbName: " + fullDbName); } - long timeoutMs = request.isSetThriftRpcTimeoutMs() ? request.getThriftRpcTimeoutMs() / 2 : 5000; + long timeoutMs = request.isSetThriftRpcTimeoutMs() ? request.getThriftRpcTimeoutMs() / 2 + : Config.try_commit_lock_timeout_seconds * 1000; List<Table> tables = queryLoadCommitTables(request, db); return Env.getCurrentGlobalTransactionMgr() .commitAndPublishTransaction(db, tables, request.getTxnId(), @@ -1795,7 +1796,8 @@ public class FrontendServiceImpl implements FrontendService.Iface { } // Step 4: get timeout - long timeoutMs = request.isSetThriftRpcTimeoutMs() ? request.getThriftRpcTimeoutMs() / 2 : 5000; + long timeoutMs = request.isSetThriftRpcTimeoutMs() ? request.getThriftRpcTimeoutMs() / 2 + : Config.try_commit_lock_timeout_seconds * 1000; // Step 5: commit and publish if (request.isSetTxnInsert() && request.isTxnInsert()) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org