Fix group log content check for raw_write.
This commit is contained in:
@ -3222,8 +3222,7 @@ int LogSlidingWindow::submit_group_log(const LSN &lsn,
|
||||
if (OB_SUCC(ret)) {
|
||||
SCN min_scn;
|
||||
if (log_task->is_valid()) {
|
||||
if (group_entry_header.get_log_proposal_id() != log_task->get_proposal_id()
|
||||
|| lsn != log_task->get_begin_lsn()
|
||||
if (lsn != log_task->get_begin_lsn()
|
||||
|| group_entry_header.get_max_scn() != log_task->get_max_scn()
|
||||
|| group_entry_header.get_accum_checksum() != log_task->get_accum_checksum()) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
|
||||
@ -180,10 +180,12 @@ bool LogStateMgr::can_append(const int64_t proposal_id, const bool need_check_pr
|
||||
return bool_ret;
|
||||
}
|
||||
|
||||
bool LogStateMgr::can_raw_write() const
|
||||
bool LogStateMgr::can_raw_write(const int64_t proposal_id, const bool need_check_proposal_id) const
|
||||
{
|
||||
bool bool_ret = false;
|
||||
if (is_leader_active_()
|
||||
&& ((need_check_proposal_id && proposal_id == get_proposal_id())
|
||||
|| false == need_check_proposal_id)
|
||||
&& OB_LIKELY(mode_mgr_->can_raw_write())) {
|
||||
bool_ret = true;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
const int64_t &proposal_id);
|
||||
virtual int set_scan_disk_log_finished();
|
||||
virtual bool can_append(const int64_t proposal_id, const bool need_check_proposal_id) const;
|
||||
virtual bool can_raw_write() const;
|
||||
virtual bool can_raw_write(const int64_t proposal_id, const bool need_check_proposal_id) const;
|
||||
virtual bool can_slide_sw() const;
|
||||
virtual bool can_handle_committed_info(const int64_t &proposal_id) const;
|
||||
virtual bool can_revoke(const int64_t proposal_id) const;
|
||||
|
||||
@ -2598,10 +2598,11 @@ int PalfHandleImpl::submit_group_log(const PalfAppendOptions &opts,
|
||||
if (palf_reach_time_interval(1 * 1000 * 1000, log_disk_full_warn_time_)) {
|
||||
PALF_LOG(WARN, "log outof disk space", K(ret), KPC(this), K(opts), K(lsn));
|
||||
}
|
||||
} else if (!state_mgr_.can_raw_write()) {
|
||||
} else if (!state_mgr_.can_raw_write(opts.proposal_id, opts.need_check_proposal_id)) {
|
||||
ret = OB_NOT_MASTER;
|
||||
PALF_LOG(WARN, "cannot submit_group_log", K(ret), K_(self), K_(palf_id), KP(buf), K(buf_len),
|
||||
"role", state_mgr_.get_role(), "state", state_mgr_.get_state(),
|
||||
"current proposal_id", state_mgr_.get_proposal_id(),
|
||||
"mode_mgr can_raw_write", mode_mgr_.can_raw_write(), K(opts));
|
||||
} else if (OB_UNLIKELY(state_mgr_.is_changing_config_with_arb())) {
|
||||
ret = OB_EAGAIN;
|
||||
|
||||
Reference in New Issue
Block a user