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 b214962dbf8 [fix](merge-cloud) disable ssl in meta check (#33516)
b214962dbf8 is described below

commit b214962dbf8be452de5aa951581385ae3d4a89dd
Author: Luwei <814383...@qq.com>
AuthorDate: Thu Apr 11 11:55:16 2024 +0800

    [fix](merge-cloud) disable ssl in meta check (#33516)
---
 cloud/src/recycler/meta_checker.cpp | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/cloud/src/recycler/meta_checker.cpp 
b/cloud/src/recycler/meta_checker.cpp
index b1ea0f9f8e4..522015555de 100644
--- a/cloud/src/recycler/meta_checker.cpp
+++ b/cloud/src/recycler/meta_checker.cpp
@@ -347,7 +347,7 @@ bool MetaChecker::check_fdb_by_fe_meta(MYSQL* conn) {
             LOG(WARNING) << "failed to init txn";
             return false;
         }
-        if (elem.second.visible_version == 0) {
+        if (elem.second.visible_version == 0 || elem.second.visible_version == 
1) {
             continue;
         }
 
@@ -391,22 +391,20 @@ void MetaChecker::do_check(const std::string& host, const 
std::string& port,
                            const std::string& instance_id, std::string& msg) {
     LOG(INFO) << "meta check begin";
     instance_id_ = instance_id;
-    MYSQL* conn;
-    conn = mysql_init(nullptr);
-    if (!conn) {
-        msg = "mysql init failed ";
-        LOG(WARNING) << msg << mysql_error(conn) << " host " << host << " port 
" << port << " user "
-                     << user << " password " << password << " instance_id " << 
instance_id;
-        return;
-    }
-    conn = mysql_real_connect(conn, host.c_str(), user.c_str(), 
password.c_str(), "", stol(port),
-                              nullptr, 0);
-    if (!conn) {
-        msg = "mysql init failed ";
-        LOG(WARNING) << msg << mysql_error(conn) << " host " << host << " port 
" << port << " user "
-                     << user << " password " << password << " instance_id " << 
instance_id;
+
+    MYSQL conn;
+    mysql_init(&conn);
+    mysql_ssl_mode ssl_mode = SSL_MODE_DISABLED;
+    mysql_options(&conn, MYSQL_OPT_SSL_MODE, (void*)&ssl_mode);
+    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;
         return;
     }
+
     LOG(INFO) << "mysql conn succ ";
 
     using namespace std::chrono;
@@ -416,7 +414,7 @@ void MetaChecker::do_check(const std::string& host, const 
std::string& port,
     LOG(INFO) << "check_fe_meta_by_fdb begin";
     bool ret = false;
     do {
-        ret = check_fe_meta_by_fdb(conn);
+        ret = check_fe_meta_by_fdb(&conn);
         if (!ret) {
             std::this_thread::sleep_for(seconds(10));
         }
@@ -430,7 +428,7 @@ void MetaChecker::do_check(const std::string& host, const 
std::string& port,
     now = 
duration_cast<seconds>(system_clock::now().time_since_epoch()).count();
     LOG(INFO) << "check_fe_meta_by_fdb finish, cost(second): " << now - start;
 
-    ret = check_fdb_by_fe_meta(conn);
+    ret = check_fdb_by_fe_meta(&conn);
     if (!ret) {
         LOG(WARNING) << "check_fdb_by_fe_meta failed, there may be data loss";
         msg = "meta loss err";
@@ -439,7 +437,7 @@ void MetaChecker::do_check(const std::string& host, const 
std::string& port,
     now = 
duration_cast<seconds>(system_clock::now().time_since_epoch()).count();
     LOG(INFO) << "check_fdb_by_fe_meta finish, cost(second): " << now - start;
 
-    mysql_close(conn);
+    mysql_close(&conn);
 
     LOG(INFO) << "meta check finish";
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to