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 dabc91bc92d [enhance](StorageVault) Print the vault id and vault
message for invalid vault (#33149)
dabc91bc92d is described below
commit dabc91bc92d1aaf6cc0f0dd36989347b3f653c19
Author: AlexYue <[email protected]>
AuthorDate: Tue Apr 2 14:24:16 2024 +0800
[enhance](StorageVault) Print the vault id and vault message for invalid
vault (#33149)
---
be/src/cloud/cloud_storage_engine.cpp | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/be/src/cloud/cloud_storage_engine.cpp
b/be/src/cloud/cloud_storage_engine.cpp
index 1826469112d..f66c85f7953 100644
--- a/be/src/cloud/cloud_storage_engine.cpp
+++ b/be/src/cloud/cloud_storage_engine.cpp
@@ -24,6 +24,8 @@
#include <rapidjson/prettywriter.h>
#include <rapidjson/stringbuffer.h>
+#include <variant>
+
#include "cloud/cloud_base_compaction.h"
#include "cloud/cloud_cumulative_compaction.h"
#include "cloud/cloud_cumulative_compaction_policy.h"
@@ -72,6 +74,21 @@ CloudStorageEngine::CloudStorageEngine(const UniqueId&
backend_uid)
CloudStorageEngine::~CloudStorageEngine() = default;
+static Status vault_process_error(std::string_view id,
+ std::variant<S3Conf, cloud::HdfsVaultInfo>&
vault, Status err) {
+ std::stringstream ss;
+ std::visit(
+ [&]<typename T>(T& val) {
+ if constexpr (std::is_same_v<T, S3Conf>) {
+ ss << val.to_string();
+ } else if constexpr (std::is_same_v<T, cloud::HdfsVaultInfo>) {
+ val.SerializeToOstream(&ss);
+ }
+ },
+ vault);
+ return Status::IOError("Invalid vault, id {}, err {}, detail conf {}", id,
err, ss.str());
+}
+
struct VaultCreateFSVisitor {
VaultCreateFSVisitor(const std::string& id) : id(id) {}
Status operator()(const S3Conf& s3_conf) const {
@@ -139,7 +156,9 @@ Status CloudStorageEngine::open() {
} while (vault_infos.empty());
for (auto& [id, vault_info] : vault_infos) {
- RETURN_IF_ERROR(std::visit(VaultCreateFSVisitor {id}, vault_info));
+ if (auto st = std::visit(VaultCreateFSVisitor {id}, vault_info);
!st.ok()) [[unlikely]] {
+ return vault_process_error(id, vault_info, std::move(st));
+ }
}
set_latest_fs(get_filesystem(std::get<0>(vault_infos.back())));
@@ -259,8 +278,8 @@ void
CloudStorageEngine::_refresh_storage_vault_info_thread_callback() {
auto st = (fs == nullptr)
? std::visit(VaultCreateFSVisitor {id},
vault_info)
: std::visit(RefreshFSVaultVisitor {id,
std::move(fs)}, vault_info);
- if (!st.ok()) {
- LOG(WARNING) << "failed to refresh storage vault. err=" << st;
+ if (!st.ok()) [[unlikely]] {
+ LOG(WARNING) << vault_process_error(id, vault_info,
std::move(st));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]