diff --git a/src/logservice/replayservice/ob_tablet_replay_executor.cpp b/src/logservice/replayservice/ob_tablet_replay_executor.cpp index 4c46a10699..71b0bcf57b 100644 --- a/src/logservice/replayservice/ob_tablet_replay_executor.cpp +++ b/src/logservice/replayservice/ob_tablet_replay_executor.cpp @@ -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)); } diff --git a/src/storage/ls/ob_ls.cpp b/src/storage/ls/ob_ls.cpp index df1dff9c9a..f9816995ad 100755 --- a/src/storage/ls/ob_ls.cpp +++ b/src/storage/ls/ob_ls.cpp @@ -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; diff --git a/src/storage/ls/ob_ls.h b/src/storage/ls/ob_ls.h index 5461e41550..039e6055a9 100755 --- a/src/storage/ls/ob_ls.h +++ b/src/storage/ls/ob_ls.h @@ -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( diff --git a/src/storage/ls/ob_ls_storage_clog_handler.cpp b/src/storage/ls/ob_ls_storage_clog_handler.cpp index 768d15f7ca..f86ac7c36a 100644 --- a/src/storage/ls/ob_ls_storage_clog_handler.cpp +++ b/src/storage/ls/ob_ls_storage_clog_handler.cpp @@ -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; diff --git a/src/storage/ob_storage_clog_recorder.cpp b/src/storage/ob_storage_clog_recorder.cpp index 3c17e351f6..a99882c871 100644 --- a/src/storage/ob_storage_clog_recorder.cpp +++ b/src/storage/ob_storage_clog_recorder.cpp @@ -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; diff --git a/src/storage/tx/ob_tx_replay_executor.cpp b/src/storage/tx/ob_tx_replay_executor.cpp index d5b9f4491a..034e94ae21 100755 --- a/src/storage/tx/ob_tx_replay_executor.cpp +++ b/src/storage/tx/ob_tx_replay_executor.cpp @@ -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;