Fix reboot replay replay mds data without wait tablet create finish bug.
This commit is contained in:
@ -122,6 +122,7 @@ int ObTabletReplayExecutor::replay_get_tablet_(
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObLS *ls = nullptr;
|
||||
const bool is_update_mds_table = is_replay_update_mds_table_();
|
||||
if (!scn.is_valid() || !tablet_id.is_valid()) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
CLOG_LOG(WARN, "check can skip replay to mds get invalid argument", K(ret), K(scn), K(tablet_id));
|
||||
@ -134,7 +135,7 @@ int ObTabletReplayExecutor::replay_get_tablet_(
|
||||
if (OB_FAIL(ls->replay_get_tablet_no_check(tablet_id, scn, tablet_handle))) {
|
||||
CLOG_LOG(WARN, "replay get table failed", KR(ret), K(ls_id), K(tablet_id));
|
||||
}
|
||||
} else if (OB_FAIL(ls->replay_get_tablet(tablet_id, scn, tablet_handle))) {
|
||||
} else if (OB_FAIL(ls->replay_get_tablet(tablet_id, scn, is_update_mds_table, tablet_handle))) {
|
||||
CLOG_LOG(WARN, "replay get table failed", KR(ret), K(ls_id), K(tablet_id));
|
||||
}
|
||||
|
||||
|
||||
@ -1604,6 +1604,7 @@ int ObLS::replay_get_tablet_no_check(
|
||||
int ObLS::replay_get_tablet(
|
||||
const common::ObTabletID &tablet_id,
|
||||
const SCN &scn,
|
||||
const bool is_update_mds_table,
|
||||
ObTabletHandle &handle) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -1639,7 +1640,8 @@ int ObLS::replay_get_tablet(
|
||||
ret = OB_OBSOLETE_CLOG_NEED_SKIP;
|
||||
LOG_INFO("tablet is already deleted, need skip", KR(ret), K(ls_id), K(tablet_id), K(scn));
|
||||
}
|
||||
} else if (scn > tablet->get_clog_checkpoint_scn()) {
|
||||
} else if ((!is_update_mds_table && scn > tablet->get_clog_checkpoint_scn())
|
||||
|| (is_update_mds_table && scn > tablet->get_mds_checkpoint_scn())) {
|
||||
if (OB_FAIL(tablet->get_latest_tablet_status(data, is_committed))) {
|
||||
if (OB_EMPTY_RESULT == ret) {
|
||||
ret = OB_EAGAIN;
|
||||
|
||||
@ -337,6 +337,7 @@ public:
|
||||
// get tablet while replaying clog
|
||||
int replay_get_tablet(const common::ObTabletID &tablet_id,
|
||||
const share::SCN &scn,
|
||||
const bool is_update_mds_table,
|
||||
ObTabletHandle &handle) const;
|
||||
// get tablet but don't check user_data while replaying clog, because user_data may not exist.
|
||||
int replay_get_tablet_no_check(
|
||||
|
||||
@ -103,6 +103,7 @@ int ObMediumCompactionClogHandler::inner_replay(
|
||||
ObTabletID tablet_id;
|
||||
ObTabletHandle handle;
|
||||
int64_t new_pos = pos;
|
||||
const bool is_update_mds_table = true;
|
||||
|
||||
if (OB_UNLIKELY(pos < 0 || buffer_size <= 0 || pos > buffer_size)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
@ -112,7 +113,7 @@ int ObMediumCompactionClogHandler::inner_replay(
|
||||
LOG_WARN("log header is not valid", K(ret), K(base_header));
|
||||
} else if (OB_FAIL(tablet_id.deserialize(buffer, buffer_size, new_pos))) {
|
||||
LOG_WARN("fail to deserialize tablet id", K(ret), K(buffer_size), K(pos), K(tablet_id));
|
||||
} else if (OB_FAIL(ls_->replay_get_tablet(tablet_id, scn, handle))) {
|
||||
} else if (OB_FAIL(ls_->replay_get_tablet(tablet_id, scn, is_update_mds_table, handle))) {
|
||||
if (OB_OBSOLETE_CLOG_NEED_SKIP == ret) {
|
||||
LOG_INFO("clog is obsolete, should skip replay", K(ret), K(tablet_id), K(scn));
|
||||
ret = OB_SUCCESS;
|
||||
|
||||
@ -308,9 +308,10 @@ int ObIStorageClogRecorder::replay_get_tablet_handle(
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObLSHandle ls_handle;
|
||||
const bool is_update_mds_table = false;
|
||||
if (OB_FAIL(MTL(ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::STORAGE_MOD))) {
|
||||
LOG_WARN("failed to get log stream", K(ret), K(ls_id));
|
||||
} else if (OB_FAIL(ls_handle.get_ls()->replay_get_tablet(tablet_id, scn, tablet_handle))) {
|
||||
} else if (OB_FAIL(ls_handle.get_ls()->replay_get_tablet(tablet_id, scn, is_update_mds_table, tablet_handle))) {
|
||||
if (OB_OBSOLETE_CLOG_NEED_SKIP == ret) {
|
||||
LOG_INFO("clog is obsolete, should skip replay", K(ret), K(ls_id), K(tablet_id), K(scn));
|
||||
ret = OB_SUCCESS;
|
||||
|
||||
@ -606,8 +606,9 @@ int ObTxReplayExecutor::replay_one_row_in_memtable_(ObMutatorRowHeader &row_head
|
||||
int ret = OB_SUCCESS;
|
||||
lib::Worker::CompatMode mode;
|
||||
ObTabletHandle tablet_handle;
|
||||
const bool is_update_mds_table = false;
|
||||
|
||||
if (OB_FAIL(ls_->replay_get_tablet(row_head.tablet_id_, log_ts_ns_, tablet_handle))) {
|
||||
if (OB_FAIL(ls_->replay_get_tablet(row_head.tablet_id_, log_ts_ns_, is_update_mds_table, tablet_handle))) {
|
||||
if (OB_OBSOLETE_CLOG_NEED_SKIP == ret) {
|
||||
ctx_->force_no_need_replay_checksum();
|
||||
ret = OB_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user