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

[fix](group commit) group commit show error url #38292

Merged
merged 1 commit into from
Jul 24, 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
4 changes: 4 additions & 0 deletions be/src/service/internal_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,10 @@ void PInternalService::group_commit_insert(google::protobuf::RpcController* cont
response->set_loaded_rows(state->num_rows_load_success());
response->set_filtered_rows(state->num_rows_load_filtered());
status->to_protobuf(response->mutable_status());
if (!state->get_error_log_file_path().empty()) {
response->set_error_url(
to_load_error_http_path(state->get_error_log_file_path()));
}
_exec_env->new_load_stream_mgr()->remove(load_id);
});
} catch (const Exception& e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2369,11 +2369,17 @@ private void handleInsertStmt() throws Exception {
errMsg = "group commit insert failed. db_id: " + dbId + ", table_id: " + tableId
+ ", query_id: " + DebugUtil.printId(context.queryId()) + ", backend_id: "
+ groupCommitPlanner.getBackend().getId() + ", status: " + response.getStatus();
if (response.hasErrorUrl()) {
errMsg += ", error url: " + response.getErrorUrl();
}
}
} else if (code != TStatusCode.OK) {
errMsg = "group commit insert failed. db_id: " + dbId + ", table_id: " + tableId + ", query_id: "
+ DebugUtil.printId(context.queryId()) + ", backend_id: " + groupCommitPlanner.getBackend()
.getId() + ", status: " + response.getStatus();
if (response.hasErrorUrl()) {
errMsg += ", error url: " + response.getErrorUrl();
}
ErrorReport.reportDdlException(errMsg, ErrorCode.ERR_FAILED_WHEN_INSERT);
}
label = response.getLabel();
Expand Down
1 change: 1 addition & 0 deletions gensrc/proto/internal_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ message PGroupCommitInsertResponse {
optional int64 txn_id = 3;
optional int64 loaded_rows = 4;
optional int64 filtered_rows = 5;
optional string error_url = 6;
}

message POpenLoadStreamRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ suite("insert_group_commit_into") {
sql "set enable_insert_strict=false"
group_commit_insert """ insert into ${table} values (1, 'a', 10),(5, 'q', 50),(101, 'a', 100); """, 2
sql "set enable_insert_strict=true"
try {
sql """ insert into ${table} values (102, 'a', 100); """
assertTrue(false, "insert should fail")
} catch (Exception e) {
logger.info("error: " + e.getMessage())
assertTrue(e.getMessage().contains("url:"))
}
sql """ alter table ${table} ADD ROLLUP r1(name, score); """
group_commit_insert_with_retry """ insert into ${table}(id, name) values(2, 'b'); """, 1
group_commit_insert_with_retry """ insert into ${table}(id) values(6); """, 1
Expand Down
Loading