Skip to content
Open
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 @@ -38,6 +38,7 @@ public interface StreamLoadConstants {
String RESULT_STATUS_FAILED = "Fail";
String RESULT_STATUS_LABEL_EXISTED = "Label Already Exists";
String RESULT_STATUS_TRANSACTION_NOT_EXISTED = "TXN_NOT_EXISTS";
String RESULT_STATUS_TRANSACTION_IN_PROCESSING = "TXN_IN_PROCESSING";
String RESULT_STATUS_TRANSACTION_COMMIT_TIMEOUT = "Commit Timeout";
String RESULT_STATUS_TRANSACTION_PUBLISH_TIMEOUT = "Publish Timeout";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ public boolean prepare(StreamLoadSnapshot.Transaction transaction) {
} else {
return true;
}
case StreamLoadConstants.RESULT_STATUS_TRANSACTION_IN_PROCESSING:
String warnMsg = String.format("Transaction in processing, db: %s, table: %s, label: %s, " +
"\nresponseBody: %s", transaction.getDatabase(), transaction.getTable(),
transaction.getLabel(), responseBody);
log.warn(warnMsg);
return false;
}
}

Expand Down Expand Up @@ -275,6 +281,10 @@ public boolean commit(StreamLoadSnapshot.Transaction transaction) {
responseBody));
}

if (StreamLoadConstants.RESULT_STATUS_TRANSACTION_IN_PROCESSING.equals(status)) {
log.info("Transaction in processing, retry later, lable: {}, body : {}", transaction.getLabel(), responseBody);
return false;
}

if (StreamLoadConstants.RESULT_STATUS_OK.equals(status)) {
manager.callback(streamLoadResponse);
Expand Down