This is an automated email from the ASF dual-hosted git repository.
liaoxin01 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 3648555f59d [fix](cloud) Remove passwords from MetaChecker connection
warnings (#70772)
3648555f59d is described below
commit 3648555f59dc8f4b2fc9cbcd85b9ca1d63b61e56
Author: Yixuan Wang <[email protected]>
AuthorDate: Mon Nov 23 09:42:51 2026 +0800
[fix](cloud) Remove passwords from MetaChecker connection warnings (#70772)
### Background
Cloud builds with BUILD_CHECK_META can run a metadata consistency check.
MetaChecker opens a MySQL connection to the requested FE for the check.
### What problem does this PR solve?
Issue Number: None
Related PR: #33499 (introduced the credential logging)
PR Type: Bugfix
Problem Summary:
A failed MySQL connection caused MetaChecker to include the supplied
database password in a WARNING. The warning now records the numeric
MySQL error code, host, port, user, and instance ID.
### Details
- **Frequency:** Always when mysql_real_connect fails in this code path.
- **Root cause:** MetaChecker::init_mysql_connection streamed the
password into the warning.
- **Why existing tests missed it:** Cloud unit tests do not exercise
this warning. The check_meta and table-stream orphan regression cases
check the consistency results and HTTP response after connecting to FE.
- **Fix:** Record the numeric MySQL error code and endpoint context in
the warning. Use the password only in the MySQL connection attempt.
- **Other paths and branches:** This is the only MetaChecker
connection-failure warning. Local branch-4.0 and branch-4.1 refs contain
the same logging statement. The branch-3.1 and branch-4.2 refs were
unavailable locally.
- **Behavior change:** The connection-failure warning uses a numeric
code and omits the password and free-form MySQL error text.
---
cloud/src/recycler/meta_checker.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/cloud/src/recycler/meta_checker.cpp
b/cloud/src/recycler/meta_checker.cpp
index 9ba443fe694..51f0f072ba5 100644
--- a/cloud/src/recycler/meta_checker.cpp
+++ b/cloud/src/recycler/meta_checker.cpp
@@ -850,9 +850,8 @@ void MetaChecker::init_mysql_connection(const std::string&
host, const std::stri
if (!mysql_real_connect(&conn, host.c_str(), user.c_str(),
password.c_str(), "", stol(port),
nullptr, 0)) {
msg = "mysql conn failed ";
- LOG(WARNING) << msg << mysql_error(&conn) << " host " << host << "
port " << port
- << " user " << user << " password " << password << "
instance_id "
- << instance_id;
+ LOG(WARNING) << msg << "error_code " << mysql_errno(&conn) << " host "
<< host << " port "
+ << port << " user " << user << " instance_id " <<
instance_id;
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]