Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve](cloud-mow)Modify some mow log to help solve problem #47695

Merged
merged 2 commits into from
Feb 14, 2025
Merged
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 @@ -864,6 +864,7 @@ private void getDeleteBitmapUpdateLock(long transactionId, List<OlapTable> mowTa
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)
Expand Down Expand Up @@ -911,9 +912,11 @@ private void getDeleteBitmapUpdateLock(long transactionId, List<OlapTable> mowTa
break;
}
} catch (Exception e) {
LOG.warn("ignore get delete bitmap lock exception, transactionId={}, retryTime={}", transactionId,
retryTime, e);
LOG.warn("ignore get delete bitmap lock exception, transactionId={}, retryTime={}, tableIds={}",
transactionId,
retryTime, mowTableList.stream().map(Table::getId).collect(Collectors.toList()), e);
}
retryMsg = response.toString();
// sleep random millis [20, 300] ms, avoid txn conflict
int randomMillis = 20 + (int) (Math.random() * (300 - 20));
if (LOG.isDebugEnabled()) {
Expand Down Expand Up @@ -963,8 +966,9 @@ private void getDeleteBitmapUpdateLock(long transactionId, List<OlapTable> mowTa
}
stopWatch.stop();
LOG.info("get delete bitmap lock successfully. txnId: {}. totalRetryTime: {}. "
+ "tableSize: {}. cost: {} ms.", transactionId, totalRetryTime,
lockContext.getTableToPartitions().size(), stopWatch.getTime());
+ "tableSize: {}. cost: {} ms. tableIds: {}. retryMsg: {}.", transactionId, totalRetryTime,
lockContext.getTableToPartitions().size(), stopWatch.getTime(),
mowTableList.stream().map(Table::getId).collect(Collectors.toList()), retryMsg);
}

private void removeDeleteBitmapUpdateLock(List<OlapTable> tableList, long transactionId) {
Expand Down Expand Up @@ -1236,6 +1240,11 @@ private void beforeCommitTransaction(List<Table> tableList, long transactionId,
}

List<Table> tablesToLock = getTablesNeedCommitLock(tableList);
StopWatch stopWatch = null;
if (!tablesToLock.isEmpty()) {
stopWatch = new StopWatch();
stopWatch.start();
}
increaseWaitingLockCount(tablesToLock);
if (!MetaLockUtils.tryCommitLockTables(tablesToLock, timeoutMillis, TimeUnit.MILLISECONDS)) {
decreaseWaitingLockCount(tablesToLock);
Expand All @@ -1244,6 +1253,14 @@ private void beforeCommitTransaction(List<Table> tableList, long transactionId,
"get table cloud commit lock timeout, tableList=("
+ StringUtils.join(tablesToLock, ",") + ")");
}
if (stopWatch != null) {
stopWatch.stop();
long costTimeMs = stopWatch.getTime();
if (costTimeMs > 1000) {
LOG.warn("get table cloud commit lock, tableList=(" + StringUtils.join(tablesToLock, ",") + ")"
+ ", transactionId=" + transactionId + ", cost=" + costTimeMs + " ms");
}
}
}

private void afterCommitTransaction(List<Table> tableList) {
Expand Down