Skip to content

Commit

Permalink
improve some log
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba committed Jan 3, 2025
1 parent 1023235 commit 0c4a50f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ private void commitTransaction(DorisCommittable committable) throws IOException
jsonMapper.readValue(
loadResult,
new TypeReference<HashMap<String, String>>() {});
if (!res.get("status").equals(SUCCESS)
&& !ResponseUtil.isCommitted(res.get("msg"))) {
if (res.get("status").equals(SUCCESS)) {
LOG.info("load result {}", loadResult);
} else if (ResponseUtil.isCommitted(res.get("msg"))) {
LOG.info(
"transaction {} has already committed successfully, skipping, load response is {}",
committable.getTxnID(),
res.get("msg"));
} else {
throw new DorisRuntimeException(
"commit transaction failed " + loadResult);
} else {
LOG.info("load result {}", loadResult);
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ public void abortTransaction(long txnID) throws Exception {
String msg = res.get("msg");
// transaction already aborted
if (msg != null && ResponseUtil.isAborted(msg)) {
LOG.warn("Failed to abort transaction, {}", msg);
LOG.info(
"transaction {} may have already been successfully aborted, skipping, abort response is {}",
txnID,
msg);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ public void close() throws Exception {
if (scheduledExecutorService != null) {
scheduledExecutorService.shutdownNow();
}
LOG.info("Try to abort txn before closing.");
abortPossibleSuccessfulTransaction();

if (dorisStreamLoadMap != null && !dorisStreamLoadMap.isEmpty()) {
Expand Down

0 comments on commit 0c4a50f

Please sign in to comment.