Skip to content

Commit

Permalink
4
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian committed Jan 31, 2024
1 parent 1715f58 commit 754a731
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
12 changes: 2 additions & 10 deletions be/src/http/action/http_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,18 +398,10 @@ Status HttpStreamAction::_handle_group_commit(HttpRequest* req,
if (iequal(group_commit_mode, "async_mode")) {
group_commit_mode = load_size_smaller_than_wal_limit(req) ? "async_mode" : "sync_mode";
if (iequal(group_commit_mode, "sync_mode")) {
size_t max_available_size =
ExecEnv::GetInstance()->wal_mgr()->get_max_available_size();
LOG(INFO) << "When enable group commit, the data size can't be too large or "
"unknown. The data size for this stream load("
<< (req->header(HttpHeaders::CONTENT_LENGTH).empty()
? 0
: req->header(HttpHeaders::CONTENT_LENGTH))
<< " Bytes) exceeds the WAL (Write-Ahead Log) limit ("
<< max_available_size << " Bytes). ";
std::stringstream ss;
ss << "There is no space for group commit async WAL. WAL dir info: "
ss << "There is no space for group commit http load async WAL. WAL dir info: "
<< ExecEnv::GetInstance()->wal_mgr()->get_wal_dirs_info_string();
LOG(WARNING) << ss.str();
return Status::Error<EXCEEDED_LIMIT>(ss.str());
}
}
Expand Down
12 changes: 2 additions & 10 deletions be/src/http/action/stream_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,18 +718,10 @@ Status StreamLoadAction::_handle_group_commit(HttpRequest* req,
if (iequal(group_commit_mode, "async_mode")) {
group_commit_mode = load_size_smaller_than_wal_limit(req) ? "async_mode" : "sync_mode";
if (iequal(group_commit_mode, "sync_mode")) {
size_t max_available_size =
ExecEnv::GetInstance()->wal_mgr()->get_max_available_size();
LOG(INFO) << "When enable group commit, the data size can't be too large or "
"unknown. The data size for this stream load("
<< (req->header(HttpHeaders::CONTENT_LENGTH).empty()
? 0
: req->header(HttpHeaders::CONTENT_LENGTH))
<< " Bytes) exceeds the WAL (Write-Ahead Log) limit ("
<< max_available_size << " Bytes). ";
std::stringstream ss;
ss << "There is no space for group commit async WAL. WAL dir info: "
ss << "There is no space for group commit stream load async WAL. WAL dir info: "
<< ExecEnv::GetInstance()->wal_mgr()->get_wal_dirs_info_string();
LOG(WARNING) << ss.str();
return Status::Error<EXCEEDED_LIMIT>(ss.str());
}
}
Expand Down
4 changes: 2 additions & 2 deletions be/src/olap/wal/wal_dirs_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void WalDirInfo::update_wal_dir_pre_allocated(size_t increase_pre_allocated,
std::string WalDirInfo::get_wal_dir_info_string() {
return "[" + _wal_dir + ": limit " + std::to_string(_limit) + " Bytes, used " +
std::to_string(_used) + " Bytes, pre allocated " + std::to_string(_pre_allocated) +
" Bytes, available " + std::to_string(available()) + "Bytes.]\n";
" Bytes, available " + std::to_string(available()) + "Bytes.]";
}

Status WalDirsInfo::add(const std::string& wal_dir, size_t limit, size_t used,
Expand Down Expand Up @@ -166,7 +166,7 @@ size_t WalDirsInfo::get_max_available_size() {
std::string WalDirsInfo::get_wal_dirs_info_string() {
std::string wal_dirs_info_string;
for (const auto& wal_dir_info : _wal_dirs_info_vec) {
wal_dirs_info_string += wal_dir_info->get_wal_dir_info_string();
wal_dirs_info_string += wal_dir_info->get_wal_dir_info_string() + "\n";
}
return wal_dirs_info_string;
}
Expand Down

0 comments on commit 754a731

Please sign in to comment.