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

[Enhancement] Add more detailed logging for commit transaction scenarios. (backport #49083) #49177

Merged
merged 1 commit into from
Aug 1, 2024
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 @@ -87,7 +87,7 @@ public enum ReplicaStatus {
// 1. tablet has 2 replica A has version[7,8,9,10], B: [7,8,9,10]
// 2. a newly cloned replica C full clone from replica A, then has version [10]
// 3. current partition visible version is still 9
// 4. A query read this tablet at version 9, and picks replica C, but replica C doesn't have version 10,
// 4. A query read this tablet at version 9, and picks replica C, but replica C only have version 10,
// causing `version not found` error
@SerializedName(value = "minReadableVersion")
private volatile long minReadableVersion = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public void commitPreparedTransaction(Database db, long transactionId, long time
StopWatch stopWatch = new StopWatch();
stopWatch.start();
if (!db.tryWriteLock(timeoutMillis, TimeUnit.MILLISECONDS)) {
throw new UserException("get database write lock timeout, database="
throw new UserException("get database write lock timeout, transactionId=" + transactionId + " database="
+ db.getFullName() + ", timeoutMillis=" + timeoutMillis);
}
try {
Expand All @@ -426,10 +426,14 @@ public void commitPreparedTransaction(Database db, long transactionId, long time
if (publishTimeoutMillis < 0) {
// here commit transaction successfully cost too much time to cause publisTimeoutMillis is less than zero,
// so we just return false to indicate publish timeout
throw new UserException("publish timeout: " + timeoutMillis);
String errMsg = String.format("publish timeout: %d, transactionId=%d",
timeoutMillis, transactionId);
throw new UserException(errMsg);
}
if (!waiter.await(publishTimeoutMillis, TimeUnit.MILLISECONDS)) {
throw new UserException("publish timeout: " + timeoutMillis);
String errMsg = String.format("publish timeout: %d, transactionId=%d",
timeoutMillis, transactionId);
throw new UserException(errMsg);
}
}

Expand Down
Loading