Skip to content

Commit

Permalink
[chore](ColdHeatSeparation) Reduce the frequency of log following rea…
Browse files Browse the repository at this point in the history
…d failure (apache#32706)
  • Loading branch information
ByteYue authored Mar 25, 2024
1 parent f00750f commit 72e8c62
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
7 changes: 4 additions & 3 deletions be/src/io/fs/s3_file_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,12 @@ void S3FileWriter::_put_object(UploadFileBuffer& buf) {
}

std::string S3FileWriter::_dump_completed_part() const {
std::string view;
std::stringstream ss;
ss << "part_numbers:";
for (const auto& part : _completed_parts) {
view.append(fmt::format("part {}, ", view, part->GetPartNumber()));
ss << " " << part->GetPartNumber();
}
return view;
return ss.str();
}

} // namespace doris::io
36 changes: 20 additions & 16 deletions be/src/olap/olap_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <gen_cpp/Types_types.h>
#include <gen_cpp/olap_file.pb.h>
#include <glog/logging.h>
#include <stdint.h>

#include <algorithm>
Expand Down Expand Up @@ -1403,22 +1404,25 @@ void StorageEngine::_cold_data_compaction_producer_callback() {
for (auto& [tablet, score] : tablet_to_follow) {
LOG(INFO) << "submit to follow cooldown meta. tablet_id=" << tablet->tablet_id()
<< " score=" << score;
static_cast<void>(
_cold_data_compaction_thread_pool->submit_func([&, t = std::move(tablet)]() {
{
std::lock_guard lock(tablet_submitted_mtx);
tablet_submitted.insert(t->tablet_id());
}
auto st = t->cooldown();
{
std::lock_guard lock(tablet_submitted_mtx);
tablet_submitted.erase(t->tablet_id());
}
if (!st.ok()) {
LOG(WARNING) << "failed to cooldown. tablet_id=" << t->tablet_id()
<< " err=" << st;
}
}));
static_cast<void>(_cold_data_compaction_thread_pool->submit_func([&,
t = std::move(
tablet)]() {
{
std::lock_guard lock(tablet_submitted_mtx);
tablet_submitted.insert(t->tablet_id());
}
auto st = t->cooldown();
{
std::lock_guard lock(tablet_submitted_mtx);
tablet_submitted.erase(t->tablet_id());
}
if (!st.ok()) {
// The cooldown of the replica may be relatively slow
// resulting in a short period of time where following cannot be successful
LOG_EVERY_N(WARNING, 5)
<< "failed to cooldown. tablet_id=" << t->tablet_id() << " err=" << st;
}
}));
}
}
}
Expand Down

0 comments on commit 72e8c62

Please sign in to comment.