[FEAT MERGE] log4100 branch

Co-authored-by: tino247 <tino247@126.com>
Co-authored-by: BinChenn <binchenn.bc@gmail.com>
Co-authored-by: HaHaJeff <jeffzhouhhh@gmail.com>
This commit is contained in:
obdev
2023-01-28 18:17:31 +08:00
committed by ob-robot
parent a269ffe6be
commit 50024b39cd
772 changed files with 60275 additions and 11301 deletions

View File

@ -59,6 +59,7 @@ public:
if (OB_UNLIKELY(msg.get_ballot_number() < p_acceptor->ballot_number_)) {
using T = typename ResponseType<RequestMsg>::type;
T reject_msg = create_reject_message_(p_acceptor->p_election_->get_self_addr(),
p_acceptor->p_election_->inner_priority_seed_,
p_acceptor->p_election_->get_membership_version_(),
msg);
reject_msg.set_rejected(p_acceptor->ballot_number_);
@ -72,17 +73,20 @@ public:
}
private:
static ElectionPrepareResponseMsg create_reject_message_(const common::ObAddr &addr,
const uint64_t inner_priority_seed,
const LogConfigVersion &membership_version,
const ElectionPrepareRequestMsg &msg)
{
UNUSED(inner_priority_seed),
UNUSED(membership_version);
return ElectionPrepareResponseMsg(addr, msg);
}
static ElectionAcceptResponseMsg create_reject_message_(const common::ObAddr &addr,
const uint64_t inner_priority_seed,
const LogConfigVersion &membership_version,
const ElectionAcceptRequestMsg &msg)
{
return ElectionAcceptResponseMsg(addr, membership_version, msg);
return ElectionAcceptResponseMsg(addr, inner_priority_seed, membership_version, msg);
}
};
@ -311,6 +315,7 @@ void ElectionAcceptor::on_accept_request(const ElectionAcceptRequestMsg &accept_
*us_to_expired = lease_.get_lease_end_ts() - get_monotonic_ts();
// 3. 构造accept ok消息
ElectionAcceptResponseMsg accept_res_accept(p_election_->get_self_addr(),
p_election_->inner_priority_seed_,
p_election_->get_membership_version_(),
accept_req);
(void) p_election_->refresh_priority_();
@ -340,12 +345,8 @@ int64_t ElectionAcceptor::to_string(char *buf, const int64_t buf_len) const
common::databuff_printf(buf, buf_len, pos, ", vote_reason:%s", to_cstring(vote_reason_));
common::databuff_printf(buf, buf_len, pos, ", last_time_window_open_ts:%s", ObTime2Str::ob_timestamp_str_range<YEAR, USECOND>(last_time_window_open_ts_));
if (highest_priority_prepare_req_.is_valid()) {
common::databuff_printf(buf, buf_len, pos, ", highest_priority_prepare_req_sender:%s",
to_cstring(highest_priority_prepare_req_.get_sender()));
common::databuff_printf(buf, buf_len, pos, ", highest_priority_prepare_req_ballot:%ld",
highest_priority_prepare_req_.get_ballot_number());
common::databuff_printf(buf, buf_len, pos, ", prepare_req_with_null_priority:%s",
to_cstring(!highest_priority_prepare_req_.is_buffer_valid()));
common::databuff_printf(buf, buf_len, pos, ", highest_priority_prepare_req:%s",
to_cstring(highest_priority_prepare_req_));
}
common::databuff_printf(buf, buf_len, pos, ", p_election:0x%lx}", (unsigned long)p_election_);
return pos;
@ -353,4 +354,4 @@ int64_t ElectionAcceptor::to_string(char *buf, const int64_t buf_len) const
}
}
}
}