From 06670a3748f15bfef0a111056270bb9198ac90a1 Mon Sep 17 00:00:00 2001 From: ByteYue Date: Fri, 22 Mar 2024 22:09:30 +0800 Subject: [PATCH 1/2] log every error --- be/src/olap/olap_server.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp index 3d6e40ae6d6ee3..493abcb8485e85 100644 --- a/be/src/olap/olap_server.cpp +++ b/be/src/olap/olap_server.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -1411,8 +1412,11 @@ void StorageEngine::_cold_data_compaction_producer_callback() { tablet_submitted.erase(t->tablet_id()); } if (!st.ok()) { - LOG(WARNING) << "failed to cooldown. tablet_id=" << t->tablet_id() - << " err=" << st; + // 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; } })); } From 6cd185048c04f6db21633c0daadeefa8cc8b30a8 Mon Sep 17 00:00:00 2001 From: ByteYue Date: Fri, 22 Mar 2024 22:16:34 +0800 Subject: [PATCH 2/2] format --- be/src/io/fs/s3_file_writer.cpp | 7 +++--- be/src/olap/olap_server.cpp | 38 ++++++++++++++++----------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/be/src/io/fs/s3_file_writer.cpp b/be/src/io/fs/s3_file_writer.cpp index b7a8eb043115dc..388aed1ea34eec 100644 --- a/be/src/io/fs/s3_file_writer.cpp +++ b/be/src/io/fs/s3_file_writer.cpp @@ -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 diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp index 493abcb8485e85..576cb9a9a4a786 100644 --- a/be/src/olap/olap_server.cpp +++ b/be/src/olap/olap_server.cpp @@ -1400,25 +1400,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( - _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; - } - })); + static_cast(_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; + } + })); } } }