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

[BugFix] Fix transaction of insert load job can not be aborted when job has been cancelled #48059

Merged
merged 2 commits into from
Jul 31, 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 @@ -262,4 +262,8 @@ public void readFields(DataInput in) throws IOException {
public void setEstimateScanRow(long rows) {
this.estimateScanRow = rows;
}

public void setTransactionId(long txnId) {
this.transactionId = txnId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void recordFinishedOrCacnelledLoadJob(long jobId, EtlJobType jobType, Str
}
}

public long registerLoadJob(String label, String dbName, long tableId, EtlJobType jobType,
public long registerLoadJob(String label, String dbName, long tableId, long txnId, EtlJobType jobType,
long createTimestamp, long estimateScanRows,
int estimateFileNum, long estimateFileSize,
TLoadJobType type, long timeout, Coordinator coordinator)
Expand All @@ -248,6 +248,7 @@ public long registerLoadJob(String label, String dbName, long tableId, EtlJobTyp
loadJob = new InsertLoadJob(label, db.getId(), tableId, createTimestamp, type, timeout, coordinator);
loadJob.setLoadFileInfo(estimateFileNum, estimateFileSize);
loadJob.setEstimateScanRow(estimateScanRows);
loadJob.setTransactionId(txnId);
} else {
throw new LoadException("Unknown job type [" + jobType.name() + "]");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2049,6 +2049,7 @@ public void handleDMLStmt(ExecPlan execPlan, DmlStmt stmt) throws Exception {
label,
database.getFullName(),
targetTable.getId(),
transactionId,
EtlJobType.INSERT,
createTime,
estimateScanRows,
Expand Down
Loading