From 63178d179b1b44c568393e4df3e0657884764444 Mon Sep 17 00:00:00 2001 From: obdev Date: Fri, 6 Jan 2023 02:12:00 +0000 Subject: [PATCH] [Election] add some log --- .../leader_coordinator/table_accessor.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/logservice/leader_coordinator/table_accessor.cpp b/src/logservice/leader_coordinator/table_accessor.cpp index 4430694e5a..90ac131a6d 100644 --- a/src/logservice/leader_coordinator/table_accessor.cpp +++ b/src/logservice/leader_coordinator/table_accessor.cpp @@ -89,7 +89,7 @@ int LsElectionReferenceInfoRow::end_(const bool true_to_commit) int LsElectionReferenceInfoRow::change_zone_priority(const ObArray> &zone_list_list) { LC_TIME_GUARD(1_s); - #define PRINT_WRAPPER K(*this), KR(ret) + #define PRINT_WRAPPER K(*this), KR(ret), K(zone_list_list) int ret = OB_SUCCESS; if (CLICK_FAIL(start_and_read_())) { COORDINATOR_LOG_(WARN, "failed when start trans, read row, convert info"); @@ -97,6 +97,8 @@ int LsElectionReferenceInfoRow::change_zone_priority(const ObArray() = manual_leader_server)) { } else if (CLICK_FAIL(write_and_commit_())) { COORDINATOR_LOG_(WARN, "failed when convert info, write row, end trans"); + } else { + COORDINATOR_LOG_(INFO, "change_manual_leader"); } if (trans_.is_started()) { COORDINATOR_LOG_(WARN, "transaction execute failed"); @@ -134,7 +138,7 @@ int LsElectionReferenceInfoRow::change_manual_leader(const common::ObAddr &manua int LsElectionReferenceInfoRow::add_server_to_blacklist(const common::ObAddr &server, InsertElectionBlacklistReason reason) { LC_TIME_GUARD(1_s); - #define PRINT_WRAPPER K(*this), KR(ret) + #define PRINT_WRAPPER K(*this), KR(ret), K(server), K(reason) int ret = OB_SUCCESS; if (!server.is_valid()) { ret = OB_INVALID_ARGUMENT; @@ -157,6 +161,8 @@ int LsElectionReferenceInfoRow::add_server_to_blacklist(const common::ObAddr &se COORDINATOR_LOG_(WARN, "copy reason failed"); } else if (CLICK_FAIL(write_and_commit_())) { COORDINATOR_LOG_(WARN, "failed when convert info, write row, end trans"); + } else { + COORDINATOR_LOG_(INFO, "add_server_to_blacklist"); } } } @@ -175,7 +181,7 @@ int LsElectionReferenceInfoRow::add_server_to_blacklist(const common::ObAddr &se int LsElectionReferenceInfoRow::delete_server_from_blacklist(const common::ObAddr &server) { LC_TIME_GUARD(1_s); - #define PRINT_WRAPPER K(*this), KR(ret) + #define PRINT_WRAPPER K(*this), KR(ret), K(server) int ret = OB_SUCCESS; if (!server.is_valid()) { ret = OB_INVALID_ARGUMENT; @@ -200,6 +206,8 @@ int LsElectionReferenceInfoRow::delete_server_from_blacklist(const common::ObAdd COORDINATOR_LOG_(WARN, "replace old array with new array failed"); } else if (CLICK_FAIL(write_and_commit_())) { COORDINATOR_LOG_(WARN, "failed when convert info, write row, end trans"); + } else { + COORDINATOR_LOG_(INFO, "delete_server_from_blacklist"); } } } @@ -225,6 +233,8 @@ int LsElectionReferenceInfoRow::start_and_read_() COORDINATOR_LOG_(WARN, "read row from table failed"); } else if (CLICK_FAIL(convert_table_info_to_user_info_())) { COORDINATOR_LOG_(WARN, "convert table info to user info failed"); + } else { + COORDINATOR_LOG_(INFO, "read __all_ls_election_reference_info"); } return ret; #undef PRINT_WRAPPER