Skip to content

Commit

Permalink
[Chore](load) print error url to the log when encountering data quali…
Browse files Browse the repository at this point in the history
…ty issues during load (apache#45212)

There has been an issue where load does not print the error URL.
Printing the error URL in the log is convenient for locating the
problem.
  • Loading branch information
liaoxin01 authored Dec 11, 2024
1 parent 1ee8d40 commit 02e8c8c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion be/src/http/action/stream_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ void StreamLoadAction::handle(HttpRequest* req) {
<< ctx->commit_and_publish_txn_cost_nanos / 1000000
<< ", number_total_rows=" << ctx->number_total_rows
<< ", number_loaded_rows=" << ctx->number_loaded_rows
<< ", receive_bytes=" << ctx->receive_bytes << ", loaded_bytes=" << ctx->loaded_bytes;
<< ", receive_bytes=" << ctx->receive_bytes << ", loaded_bytes=" << ctx->loaded_bytes
<< ", error_url=" << ctx->error_url;

// update statistics
streaming_load_requests_total->increment(1);
Expand Down
14 changes: 11 additions & 3 deletions be/src/runtime/fragment_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,20 @@ void FragmentMgr::coordinator_callback(const ReportStatusRequest& req) {
params.load_counters.emplace(s_unselected_rows, std::to_string(num_rows_load_unselected));

if (!req.runtime_state->get_error_log_file_path().empty()) {
params.__set_tracking_url(
to_load_error_http_path(req.runtime_state->get_error_log_file_path()));
std::string error_log_url =
to_load_error_http_path(req.runtime_state->get_error_log_file_path());
LOG(INFO) << "error log file path: " << error_log_url
<< ", query id: " << print_id(req.query_id)
<< ", fragment instance id: " << print_id(req.fragment_instance_id);
params.__set_tracking_url(error_log_url);
} else if (!req.runtime_states.empty()) {
for (auto* rs : req.runtime_states) {
if (!rs->get_error_log_file_path().empty()) {
params.__set_tracking_url(to_load_error_http_path(rs->get_error_log_file_path()));
std::string error_log_url = to_load_error_http_path(rs->get_error_log_file_path());
LOG(INFO) << "error log file path: " << error_log_url
<< ", query id: " << print_id(req.query_id)
<< ", fragment instance id: " << print_id(rs->fragment_instance_id());
params.__set_tracking_url(error_log_url);
}
if (rs->wal_id() > 0) {
params.__set_txn_id(rs->wal_id());
Expand Down
4 changes: 3 additions & 1 deletion be/src/runtime/runtime_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ Status RuntimeState::create_error_log_file() {
LOG(WARNING) << error_msg.str();
return Status::InternalError(error_msg.str());
}
VLOG_FILE << "create error log file: " << _error_log_file_path;
LOG(INFO) << "create error log file: " << _error_log_file_path
<< ", query id: " << print_id(_query_id)
<< ", fragment instance id: " << print_id(_fragment_instance_id);

return Status::OK();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2409,6 +2409,7 @@ public void updateFragmentExecStatus(TReportExecStatusParams params) {
updateLoadCounters(params.getLoadCounters());
}
if (params.isSetTrackingUrl()) {
LOG.info("query_id={} tracking_url: {}", DebugUtil.printId(queryId), params.getTrackingUrl());
trackingUrl = params.getTrackingUrl();
}
if (params.isSetTxnId()) {
Expand Down

0 comments on commit 02e8c8c

Please sign in to comment.