[Bug](profile) add lock on add_filter_info #22355

multiple scanner may update profile at same time
This commit is contained in:
Pxl
2023-07-29 12:45:50 +08:00
committed by GitHub
parent bc88d34b16
commit 210f6661b4
2 changed files with 3 additions and 0 deletions

View File

@ -655,6 +655,7 @@ bool NewOlapScanNode::_is_key_column(const std::string& key_name) {
}
void NewOlapScanNode::add_filter_info(int id, const PredicateFilterInfo& update_info) {
std::unique_lock lock(_profile_mtx);
// update
_filter_info[id].filtered_row += update_info.filtered_row;
_filter_info[id].input_row += update_info.input_row;

View File

@ -190,6 +190,8 @@ private:
RuntimeProfile::Counter* _filtered_segment_counter = nullptr;
// total number of segment related to this scan node
RuntimeProfile::Counter* _total_segment_counter = nullptr;
std::mutex _profile_mtx;
};
} // namespace doris::vectorized