Fix arb server warn log.

This commit is contained in:
obdev
2023-02-07 20:43:23 +08:00
committed by ob-robot
parent bf3ace128e
commit d3e03d649b
4 changed files with 11 additions and 3 deletions

View File

@ -112,6 +112,9 @@ int ElectionImpl::init_and_start(const int64_t id,
} else if (CLICK_FAIL(acceptor_.start())) {
LOG_INIT(ERROR, "start acceptor failed");
} else {
if (inner_priority_seed_ & static_cast<uint64_t>(PRIORITY_SEED_BIT::SEED_NOT_NORMOL_REPLICA_BIT)) {
event_recorder_.set_need_report(false);
}
is_inited_ = true;
is_running_ = true;
LOG_INIT(INFO, "election init and start");
@ -309,7 +312,9 @@ void ElectionImpl::refresh_priority_()
{
ELECT_TIME_GUARD(500_ms);
int ret = OB_SUCCESS;
if (OB_ISNULL(priority_)) {
if (inner_priority_seed_ & static_cast<uint64_t>(PRIORITY_SEED_BIT::SEED_NOT_NORMOL_REPLICA_BIT)) {
// do nothing
} else if (OB_ISNULL(priority_)) {
ELECT_LOG(INFO, "priority is null", K(*this));
} else if (CLICK_FAIL(priority_->refresh())) {
ELECT_LOG(WARN, "refresh priority failed", KR(ret), K(*this));

View File

@ -274,7 +274,6 @@ private:
bool is_inited_;
bool is_running_;
uint64_t inner_priority_seed_;
common::ObOccamThreadPool *thread_pool_;
common::ObOccamTimer *timer_;
EventRecorder event_recorder_;
mutable ElectionMsgCounter msg_counter_;

View File

@ -63,6 +63,8 @@ int EventRecorder::report_event_(ElectionEventType type, const common::ObString
LOG_EVENT(WARN, "fail to create unique ownership of string");
#undef PRINT_WRAPPER
#define PRINT_WRAPPER KR(ret), K(retry_times), K(report_ts), K(self_addr), K(mtl_id), K(obj_to_string(type)), K(ls_id), KPC(uniq_holder.get_ptr())
} else if (!need_report_) {
LOG_EVENT(INFO, "event happened, but no need do report");
} else if (CLICK_FAIL(GLOBAL_REPORT_TIMER.schedule_task_ignore_handle_repeat_and_immediately(15_s, [retry_times, report_ts, self_addr, mtl_id, type, ls_id, uniq_holder]() mutable -> bool {
ELECT_TIME_GUARD(500_ms);
int ret = OB_SUCCESS;

View File

@ -77,7 +77,8 @@ class EventRecorder
{
public:
EventRecorder(const int64_t &ls_id, const ObAddr &self_addr, ObOccamTimer *&timer) :
ls_id_(ls_id), self_addr_(self_addr), timer_(timer) {}
ls_id_(ls_id), self_addr_(self_addr), timer_(timer), need_report_(true) {}
void set_need_report(const bool need_report) { need_report_ = need_report; }
// proposer event
int report_decentralized_to_be_leader_event(const MemberListWithStates &member_list_with_states);// 当选Leader
int report_leader_lease_expired_event(const MemberListWithStates &member_list_with_states);// Leader续约失败卸任
@ -96,6 +97,7 @@ private:
const int64_t &ls_id_;
const ObAddr &self_addr_;
ObOccamTimer *&timer_;
bool need_report_;
};
}