Fix bug that load error log is empty sometimes (#424)

_num_print_error_rows is not initialized
This commit is contained in:
Mingyu Chen
2018-12-13 11:23:32 +08:00
committed by ZHAO Chun
parent 371e3d18ca
commit 850150896a
2 changed files with 5 additions and 28 deletions

View File

@ -46,30 +46,6 @@
namespace doris {
RuntimeState::RuntimeState(
const TUniqueId& fragment_instance_id,
const TQueryOptions& query_options,
const std::string& now, ExecEnv* exec_env) :
_obj_pool(new ObjectPool()),
_data_stream_recvrs_pool(new ObjectPool()),
_unreported_error_idx(0),
_profile(_obj_pool.get(), "Fragment " + print_id(fragment_instance_id)),
_fragment_mem_tracker(NULL),
_is_cancelled(false),
_per_fragment_instance_idx(0),
_root_node_id(-1),
_num_rows_load_success(0),
_num_rows_load_filtered(0),
_num_print_error_rows(0),
_normal_row_number(0),
_error_row_number(0),
_error_log_file(nullptr),
_is_running(true),
_instance_buffer_reservation(new ReservationTracker) {
Status status = init(fragment_instance_id, query_options, now, exec_env);
DCHECK(status.ok());
}
RuntimeState::RuntimeState(
const TExecPlanFragmentParams& fragment_params,
const TQueryOptions& query_options,
@ -86,6 +62,7 @@ RuntimeState::RuntimeState(
_root_node_id(-1),
_num_rows_load_success(0),
_num_rows_load_filtered(0),
_num_print_error_rows(0),
_normal_row_number(0),
_error_row_number(0),
_error_log_file(nullptr),
@ -431,7 +408,10 @@ void RuntimeState::append_error_msg_to_file(
}
}
if (_num_print_error_rows.fetch_add(1, std::memory_order_relaxed) > MAX_ERROR_NUM) {
// if num of printed error row exceeds the limit, and this is not a summary message,
// return
if (_num_print_error_rows.fetch_add(1, std::memory_order_relaxed) > MAX_ERROR_NUM
&& !line.empty()) {
return;
}

View File

@ -65,9 +65,6 @@ class RowDescriptor;
// query and shared across all execution nodes of that query.
class RuntimeState {
public:
RuntimeState(const TUniqueId& fragment_instance_id,
const TQueryOptions& query_options,
const std::string& now, ExecEnv* exec_env);
RuntimeState(
const TExecPlanFragmentParams& fragment_params,