This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new eaf5febc970 [enhancement](cooldown) Improve cooldown logs (#25432)
eaf5febc970 is described below
commit eaf5febc970864208a4729b42f4e4be81cce1c89
Author: plat1ko <[email protected]>
AuthorDate: Mon Oct 16 20:17:00 2023 +0800
[enhancement](cooldown) Improve cooldown logs (#25432)
---
be/src/common/config.cpp | 3 ++-
be/src/common/status.h | 8 ++++----
be/src/olap/cold_data_compaction.cpp | 2 +-
be/src/olap/tablet.cpp | 21 ++++++++++++++-------
4 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index b53ed53c3e0..85344697772 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -718,7 +718,8 @@ DEFINE_mInt32(zone_map_row_num_threshold, "20");
// Info = 4,
// Debug = 5,
// Trace = 6
-DEFINE_Int32(aws_log_level, "3");
+// Default to turn off aws sdk log, because aws sdk errors that need to be
cared will be output through Doris logs
+DEFINE_Int32(aws_log_level, "0");
// the buffer size when read data from remote storage like s3
DEFINE_mInt32(remote_storage_read_buffer_mb, "16");
diff --git a/be/src/common/status.h b/be/src/common/status.h
index 5667ce7f917..3dd524c0c99 100644
--- a/be/src/common/status.h
+++ b/be/src/common/status.h
@@ -407,10 +407,10 @@ public:
static Status OK() { return Status(); }
-#define ERROR_CTOR(name, code)
\
- template <typename... Args>
\
- static Status name(std::string_view msg, Args&&... args) {
\
- return Error<ErrorCode::code, true>(msg, std::forward<Args>(args)...);
\
+#define ERROR_CTOR(name, code)
\
+ template <bool stacktrace = true, typename... Args>
\
+ static Status name(std::string_view msg, Args&&... args) {
\
+ return Error<ErrorCode::code, stacktrace>(msg,
std::forward<Args>(args)...); \
}
ERROR_CTOR(PublishTimeout, PUBLISH_TIMEOUT)
diff --git a/be/src/olap/cold_data_compaction.cpp
b/be/src/olap/cold_data_compaction.cpp
index 27812aeab35..fc3f7569aa7 100644
--- a/be/src/olap/cold_data_compaction.cpp
+++ b/be/src/olap/cold_data_compaction.cpp
@@ -63,7 +63,7 @@ Status ColdDataCompaction::execute_compact_impl() {
int64_t permits = get_compaction_permits();
std::shared_lock cooldown_conf_rlock(_tablet->get_cooldown_conf_lock());
if (_tablet->cooldown_conf_unlocked().first != _tablet->replica_id()) {
- return Status::Aborted("this replica is not cooldown replica");
+ return Status::Aborted<false>("this replica is not cooldown replica");
}
RETURN_IF_ERROR(do_compaction(permits));
_state = CompactionState::SUCCESS;
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index a4acaa3ee69..5e55fd68d1f 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -2099,7 +2099,8 @@ Status Tablet::_cooldown_data() {
RETURN_IF_ERROR(get_remote_file_system(storage_policy_id(), &dest_fs));
auto old_rowset = pick_cooldown_rowset();
if (!old_rowset) {
- return Status::InternalError("cannot pick cooldown rowset in tablet
{}", tablet_id());
+ LOG(INFO) << "cannot pick cooldown rowset in tablet " << tablet_id();
+ return Status::OK();
}
if (old_rowset->num_segments() < 1) {
// Empty rowset, just reset rowset's resource_id
@@ -2228,8 +2229,9 @@ bool Tablet::update_cooldown_conf(int64_t cooldown_term,
int64_t cooldown_replic
Status Tablet::write_cooldown_meta() {
std::shared_lock rlock(_cooldown_conf_lock);
if (_cooldown_replica_id != _tablet_meta->replica_id()) {
- return Status::Aborted("not cooldown replcia({} vs {}) tablet_id={}",
- _tablet_meta->replica_id(),
_cooldown_replica_id, tablet_id());
+ return Status::Aborted<false>("not cooldown replica({} vs {})
tablet_id={}",
+ _tablet_meta->replica_id(),
_cooldown_replica_id,
+ tablet_id());
}
std::shared_ptr<io::RemoteFileSystem> fs;
@@ -2294,7 +2296,11 @@ Status Tablet::_follow_cooldowned_data() {
}
TabletMetaPB cooldown_meta_pb;
- RETURN_IF_ERROR(_read_cooldown_meta(fs, &cooldown_meta_pb));
+ auto st = _read_cooldown_meta(fs, &cooldown_meta_pb);
+ if (!st.ok()) {
+ LOG(INFO) << "cannot read cooldown meta: " << st;
+ return Status::InternalError<false>("cannot read cooldown meta");
+ }
DCHECK(cooldown_meta_pb.rs_metas_size() > 0);
if (_tablet_meta->cooldown_meta_id() ==
cooldown_meta_pb.cooldown_meta_id()) {
// cooldowned rowsets are same, no need to follow
@@ -2310,7 +2316,7 @@ Status Tablet::_follow_cooldowned_data() {
std::lock_guard wlock(_meta_lock);
SCOPED_SIMPLE_TRACE_IF_TIMEOUT(TRACE_TABLET_LOCK_THRESHOLD);
if (tablet_state() != TABLET_RUNNING) {
- return Status::InternalError("tablet not running");
+ return Status::InternalError<false>("tablet not running");
}
for (auto& [v, rs] : _rs_version_map) {
@@ -2320,13 +2326,14 @@ Status Tablet::_follow_cooldowned_data() {
}
}
if (!version_aligned) {
- return Status::InternalError("cooldowned version is not aligned");
+ return Status::InternalError<false>("cooldowned version is not
aligned");
}
for (auto& [v, rs] : _rs_version_map) {
if (v.second <= cooldowned_version) {
overlap_rowsets.push_back(rs);
} else if (!rs->is_local()) {
- return Status::InternalError("cooldowned version larger than
that to follow");
+ return Status::InternalError<false>(
+ "cooldowned version larger than that to follow");
}
}
std::sort(overlap_rowsets.begin(), overlap_rowsets.end(),
Rowset::comparator);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]