MCPcopy Create free account
hub / github.com/apache/impala / UpdateBackendExecStatus

Method UpdateBackendExecStatus

be/src/runtime/coordinator.cc:1135–1256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133}
1134
1135Status Coordinator::UpdateBackendExecStatus(const ReportExecStatusRequestPB& request,
1136 const TRuntimeProfileForest& thrift_profiles) {
1137 const int32_t coord_state_idx = request.coord_state_idx();
1138 VLOG_FILE << "UpdateBackendExecStatus() query_id=" << PrintId(query_id())
1139 << " backend_idx=" << coord_state_idx;
1140
1141 if (coord_state_idx >= backend_states_.size()) {
1142 return Status(TErrorCode::INTERNAL_ERROR,
1143 Substitute("Unknown backend index $0 (max known: $1)",
1144 coord_state_idx, backend_states_.size() - 1));
1145 }
1146 BackendState* backend_state = backend_states_[coord_state_idx];
1147
1148 if (thrift_profiles.__isset.host_profile) {
1149 backend_state->UpdateHostProfile(thrift_profiles.host_profile);
1150 }
1151
1152 // Set by ApplyExecStatusReport, contains all the AuxErrorInfoPB objects in
1153 // ReportExecStatusRequestPB.
1154 vector<AuxErrorInfoPB> aux_error_info;
1155
1156 if (backend_state->ApplyExecStatusReport(request, thrift_profiles, &exec_summary_,
1157 &scan_progress_, &query_progress_, &dml_exec_state_, &aux_error_info,
1158 fragment_stats_)) {
1159 // Merge effective filter targets from backend report
1160 for (const EffectiveFilterTargetPB& target : request.effective_filter_targets()) {
1161 effective_filter_targets_[target.filter_id()].insert(target.scan_node_id());
1162 }
1163
1164 // This backend execution has completed.
1165 if (VLOG_QUERY_IS_ON) {
1166 // Don't log backend completion if the query has already been cancelled.
1167 int pending_backends = backend_exec_complete_barrier_->pending();
1168 if (pending_backends >= 1) {
1169 VLOG_QUERY << "Backend completed:"
1170 << " host=" << backend_state->impalad_address()
1171 << " remaining=" << pending_backends
1172 << " query_id=" << PrintId(query_id());
1173 BackendState::LogFirstInProgress(backend_states_);
1174 }
1175 }
1176 bool is_fragment_failure;
1177 TUniqueId failed_instance_id;
1178 Status status = backend_state->GetStatus(&is_fragment_failure, &failed_instance_id);
1179
1180 // Iterate through all AuxErrorInfoPB objects, and use each one to possibly blacklist
1181 // any "faulty" nodes.
1182 Status retryable_status = UpdateBlacklistWithAuxErrorInfo(
1183 &aux_error_info, status, backend_state);
1184 // Check if the backend node should be blacklisted based on the reported backend
1185 // error. Note that only blacklist one node per report.
1186 if (!status.ok() && retryable_status.ok()) {
1187 retryable_status = UpdateBlacklistWithBackendState(status, backend_state);
1188 }
1189
1190 // If any nodes were blacklisted, retry the query. This needs to be done before
1191 // UpdateExecState is called with the error status to avoid exposing the error to any
1192 // clients. If a retry is attempted, the ClientRequestState::query_status_ will be

Callers

nothing calls this directly

Calls 15

PrintIdFunction · 0.85
SubstituteFunction · 0.85
discard_resultFunction · 0.85
NetworkAddressPBToStringFunction · 0.85
OKFunction · 0.85
UpdateHostProfileMethod · 0.80
ApplyExecStatusReportMethod · 0.80
TryQueryRetryMethod · 0.80
MarkBackendFinishedMethod · 0.80
BackendsReleasedMethod · 0.80
StatusClass · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected