zhannngchen commented on code in PR #47988: URL: https://github.com/apache/doris/pull/47988#discussion_r2005529639
########## be/src/runtime/routine_load/routine_load_task_executor.cpp: ########## @@ -440,7 +443,10 @@ void RoutineLoadTaskExecutor::exec_task(std::shared_ptr<StreamLoadContext> ctx, consumer_pool->return_consumers(consumer_grp.get()); // commit txn + int64_t commit_and_publish_start_time = MonotonicNanos(); Review Comment: Why do some places use MonotonicNanos while others use MonotonicMicros? ########## fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java: ########## @@ -885,132 +936,146 @@ private void getDeleteBitmapUpdateLock(long transactionId, List<OlapTable> mowTa } StopWatch stopWatch = new StopWatch(); stopWatch.start(); - getPartitionInfo(mowTableList, tabletCommitInfos, lockContext); int totalRetryTime = 0; String retryMsg = ""; - for (Map.Entry<Long, Set<Long>> entry : lockContext.getTableToPartitions().entrySet()) { - GetDeleteBitmapUpdateLockRequest.Builder builder = GetDeleteBitmapUpdateLockRequest.newBuilder(); - builder.setTableId(entry.getKey()).setLockId(transactionId).setInitiator(-1) - .setExpiration(Config.delete_bitmap_lock_expiration_seconds).setRequireCompactionStats(true); - List<Long> tabletList = lockContext.getTableToTabletList().get(entry.getKey()); - for (Long tabletId : tabletList) { - TabletMeta tabletMeta = lockContext.getTabletToTabletMeta().get(tabletId); - TabletIndexPB.Builder tabletIndexBuilder = TabletIndexPB.newBuilder(); - tabletIndexBuilder.setDbId(tabletMeta.getDbId()); - tabletIndexBuilder.setTableId(tabletMeta.getTableId()); - tabletIndexBuilder.setIndexId(tabletMeta.getIndexId()); - tabletIndexBuilder.setPartitionId(tabletMeta.getPartitionId()); - tabletIndexBuilder.setTabletId(tabletId); - builder.addTabletIndexes(tabletIndexBuilder); - } - final GetDeleteBitmapUpdateLockRequest request = builder.build(); - GetDeleteBitmapUpdateLockResponse response = null; - - int retryTime = 0; - while (retryTime++ < Config.metaServiceRpcRetryTimes()) { - try { - response = MetaServiceProxy.getInstance().getDeleteBitmapUpdateLock(request); - if (LOG.isDebugEnabled()) { - LOG.debug("get delete bitmap lock, transactionId={}, Request: {}, Response: {}", transactionId, - request, response); - } - if (DebugPointUtil.isEnable("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.conflict")) { - DebugPoint debugPoint = DebugPointUtil.getDebugPoint( - "CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.conflict"); - double percent = debugPoint.param("percent", 0.4); - long timestamp = System.currentTimeMillis(); - Random random = new Random(timestamp); - if (Math.abs(random.nextInt()) % 100 < 100 * percent) { - LOG.info("set kv txn conflict for test"); - GetDeleteBitmapUpdateLockResponse.Builder getLockResponseBuilder - = GetDeleteBitmapUpdateLockResponse.newBuilder(); - getLockResponseBuilder.setStatus(MetaServiceResponseStatus.newBuilder() - .setCode(MetaServiceCode.KV_TXN_CONFLICT_RETRY_EXCEEDED_MAX_TIMES) - .setMsg("kv txn conflict")); - response = getLockResponseBuilder.build(); + boolean res = false; Review Comment: Why not stat the time cost out of the function directly? ########## fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java: ########## @@ -1052,65 +1117,78 @@ private void sendCalcDeleteBitmaptask(long dbId, long transactionId, } StopWatch stopWatch = new StopWatch(); stopWatch.start(); - int totalTaskNum = backendToPartitionInfos.size(); - MarkedCountDownLatch<Long, Long> countDownLatch = new MarkedCountDownLatch<Long, Long>( - totalTaskNum); - AgentBatchTask batchTask = new AgentBatchTask(); - for (Map.Entry<Long, List<TCalcDeleteBitmapPartitionInfo>> entry : backendToPartitionInfos.entrySet()) { - CalcDeleteBitmapTask task = new CalcDeleteBitmapTask(entry.getKey(), - transactionId, - dbId, - entry.getValue(), - countDownLatch); - countDownLatch.addMark(entry.getKey(), transactionId); - // add to AgentTaskQueue for handling finish report. - // not check return value, because the add will success - AgentTaskQueue.addTask(task); - batchTask.addTask(task); - LOG.info("send calculate delete bitmap task to be {}, txn_id {}, partitionInfos={}", entry.getKey(), - transactionId, entry.getValue()); - } - AgentTaskExecutor.submit(batchTask); - - boolean ok; + boolean res = false; try { Review Comment: ditto -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org