Skip to content

Commit

Permalink
[bugfix] Fix BE core about vectorized join build thread memtracker sw…
Browse files Browse the repository at this point in the history
…itch, and FileStat duplicate
  • Loading branch information
xinyiZzz authored and dataroaring committed May 31, 2022
1 parent 89d3a36 commit 429a41d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
22 changes: 12 additions & 10 deletions be/src/runtime/minidump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ int Minidump::_signo = SIGUSR1;
std::unique_ptr<google_breakpad::ExceptionHandler> Minidump::_error_handler = nullptr;

// Save the absolute path and create_time of a minidump file
struct FileStat {
struct MinidumpFileStat {
std::string abs_path;
time_t create_time;

FileStat(const std::string& path_, time_t ctime) : abs_path(path_), create_time(ctime) {}
MinidumpFileStat(const std::string& path_, time_t ctime)
: abs_path(path_), create_time(ctime) {}
};

Status Minidump::init() {
Expand Down Expand Up @@ -134,7 +135,7 @@ void Minidump::_clean_old_minidump() {

// check file create time and sort and save in stats
int ret = 0;
std::vector<FileStat> stats;
std::vector<MinidumpFileStat> stats;
for (auto it = files.begin(); it != files.end(); ++it) {
std::string path = config::minidump_dir + "/" + *it;

Expand All @@ -150,13 +151,14 @@ void Minidump::_clean_old_minidump() {
}

// sort file by ctime ascending
std::sort(stats.begin(), stats.end(), [](const FileStat& f1, const FileStat& f2) {
if (f1.create_time > f2.create_time) {
return false;
} else {
return true;
}
});
std::sort(stats.begin(), stats.end(),
[](const MinidumpFileStat& f1, const MinidumpFileStat& f2) {
if (f1.create_time > f2.create_time) {
return false;
} else {
return true;
}
});

int to_delete = stats.size() - config::max_minidump_file_number;
int deleted = 0;
Expand Down
1 change: 1 addition & 0 deletions be/src/vec/exec/join/vhash_join_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,7 @@ Status HashJoinNode::open(RuntimeState* state) {
}

void HashJoinNode::_hash_table_build_thread(RuntimeState* state, std::promise<Status>* status) {
SCOPED_ATTACH_TASK_THREAD(state, mem_tracker());
status->set_value(_hash_table_build(state));
}

Expand Down

0 comments on commit 429a41d

Please sign in to comment.