diff --git a/src/storage/meta_mem/ob_tablet_pointer.cpp b/src/storage/meta_mem/ob_tablet_pointer.cpp index c7af1c00d..3a5d24a32 100644 --- a/src/storage/meta_mem/ob_tablet_pointer.cpp +++ b/src/storage/meta_mem/ob_tablet_pointer.cpp @@ -326,14 +326,14 @@ int ObTabletPointer::try_gc_mds_table() return mds_table_handler_.try_gc_mds_table(); } -void ObTabletPointer::set_mds_written() +void ObTabletPointer::set_tablet_status_written() { - mds_table_handler_.set_mds_written(); + mds_table_handler_.set_tablet_status_written(); } -bool ObTabletPointer::is_mds_written() const +bool ObTabletPointer::is_tablet_status_written() const { - return mds_table_handler_.is_mds_written(); + return mds_table_handler_.is_tablet_status_written(); } void ObTabletPointer::mark_mds_table_deleted() diff --git a/src/storage/meta_mem/ob_tablet_pointer.h b/src/storage/meta_mem/ob_tablet_pointer.h index f83f0de16..35f4c0d48 100644 --- a/src/storage/meta_mem/ob_tablet_pointer.h +++ b/src/storage/meta_mem/ob_tablet_pointer.h @@ -65,8 +65,8 @@ public: int get_mds_table(mds::MdsTableHandle &handle, bool not_exist_create = false); // interfaces forward to mds_table_handler_ void mark_mds_table_deleted(); - void set_mds_written(); - bool is_mds_written() const; + void set_tablet_status_written(); + bool is_tablet_status_written() const; int try_release_mds_nodes_below(const share::SCN &scn); int try_gc_mds_table(); int get_min_mds_ckpt_scn(share::SCN &scn); diff --git a/src/storage/multi_data_source/mds_table_handler.h b/src/storage/multi_data_source/mds_table_handler.h index 1e1107ae9..712174663 100644 --- a/src/storage/multi_data_source/mds_table_handler.h +++ b/src/storage/multi_data_source/mds_table_handler.h @@ -29,9 +29,9 @@ public: int try_gc_mds_table(); int try_release_nodes_below(const share::SCN &scn); void reset() { this->~ObMdsTableHandler(); } - void set_mds_written() { ATOMIC_CAS(&(is_written_), false, true); } + void set_tablet_status_written() { ATOMIC_CAS(&(is_written_), false, true); } void mark_removed_from_t3m(ObTabletPointer *pointer); - bool is_mds_written() const { return ATOMIC_LOAD(&(is_written_)); } + bool is_tablet_status_written() const { return ATOMIC_LOAD(&(is_written_)); } TO_STRING_KV(K_(mds_table_handle)); private: MdsTableMgrHandle mds_table_mgr_handle_;// mgr handle destroy after table handle destroy diff --git a/src/storage/tablet/ob_i_tablet_mds_interface.h b/src/storage/tablet/ob_i_tablet_mds_interface.h index 3f8d3e5f6..b121b6808 100644 --- a/src/storage/tablet/ob_i_tablet_mds_interface.h +++ b/src/storage/tablet/ob_i_tablet_mds_interface.h @@ -46,7 +46,7 @@ public: template int is_locked_by_others(bool &is_locked, const mds::MdsWriter &self = mds::MdsWriter()) const; - int check_mds_written(bool &written); + int check_tablet_status_written(bool &written); // specialization get for each module int get_latest_tablet_status(ObTabletCreateDeleteMdsUserData &data, bool &is_committed) const; int get_tablet_status(const share::SCN &snapshot, diff --git a/src/storage/tablet/ob_i_tablet_mds_interface.ipp b/src/storage/tablet/ob_i_tablet_mds_interface.ipp index 8c7f62966..b833a3f04 100644 --- a/src/storage/tablet/ob_i_tablet_mds_interface.ipp +++ b/src/storage/tablet/ob_i_tablet_mds_interface.ipp @@ -118,7 +118,7 @@ inline int ObITabletMdsInterface::get_autoinc_seq(ObIAllocator &allocator, #undef PRINT_WRAPPER } -inline int ObITabletMdsInterface::check_mds_written(bool &written) +inline int ObITabletMdsInterface::check_tablet_status_written(bool &written) { int ret = OB_SUCCESS; written = false; @@ -129,7 +129,7 @@ inline int ObITabletMdsInterface::check_mds_written(bool &written) ret = OB_ERR_UNEXPECTED; MDS_LOG(ERROR, "tablet pointer is null", K(ret), KPC(this)); } else { - written = get_tablet_ponter_()->is_mds_written(); + written = get_tablet_ponter_()->is_tablet_status_written(); } return ret; } @@ -292,9 +292,8 @@ int ObITabletMdsInterface::set(T &&data, mds::MdsCtx &ctx, const int64_t lock_ti MDS_LOG_SET(WARN, "tablet pointer is null", K(ret), KPC(this)); } else if (MDS_FAIL(handle.set(std::forward(data), ctx, lock_timeout_us))) { MDS_LOG_SET(WARN, "failed to set dummy key unit data"); - } else { - get_tablet_ponter_()->set_mds_written(); - MDS_LOG_SET(TRACE, "success to set dummy key unit data"); + } else if (std::is_same::type>::value) { + get_tablet_ponter_()->set_tablet_status_written(); } return ret; #undef PRINT_WRAPPER @@ -320,9 +319,8 @@ int ObITabletMdsInterface::replay(T &&data, mds::MdsCtx &ctx, const share::SCN & MDS_LOG_SET(WARN, "tablet pointer is null", K(ret), KPC(this)); } else if (CLICK_FAIL(handle.replay(std::forward(data), ctx, scn))) { MDS_LOG_SET(WARN, "failed to replay dummy key unit data"); - } else { - get_tablet_ponter_()->set_mds_written(); - MDS_LOG_SET(TRACE, "success to replay dummy key unit data"); + } else if (std::is_same::type>::value) { + get_tablet_ponter_()->set_tablet_status_written(); } } return ret; @@ -347,7 +345,7 @@ int ObITabletMdsInterface::set(const Key &key, Value &&data, mds::MdsCtx &ctx, c } else if (CLICK_FAIL(handle.set(key, std::forward(data), ctx, lock_timeout_us))) { MDS_LOG_SET(WARN, "failed to set multi key unit data"); } else { - get_tablet_ponter_()->set_mds_written(); + get_tablet_ponter_()->set_tablet_status_written(); MDS_LOG_SET(TRACE, "success to set multi key unit data"); } return ret; @@ -378,7 +376,7 @@ int ObITabletMdsInterface::replay(const Key &key, } else if (CLICK_FAIL(handle.replay(key, std::forward(mds), ctx, scn))) { MDS_LOG_SET(WARN, "failed to replay multi key unit data"); } else { - get_tablet_ponter_()->set_mds_written(); + get_tablet_ponter_()->set_tablet_status_written(); MDS_LOG_SET(TRACE, "success to replay multi key unit data"); } } @@ -408,7 +406,7 @@ int ObITabletMdsInterface::remove(const Key &key, mds::MdsCtx &ctx, const int64_ ret = OB_ERR_UNEXPECTED; MDS_LOG_SET(WARN, "tablet pointer is null", K(ret), KPC(this)); } else { - get_tablet_ponter_()->set_mds_written(); + get_tablet_ponter_()->set_tablet_status_written(); MDS_LOG_SET(TRACE, "success to remove multi key unit data"); } return ret; @@ -434,7 +432,7 @@ int ObITabletMdsInterface::replay_remove(const Key &key, mds::MdsCtx &ctx, const } else if (CLICK() && OB_SUCCESS != (ret = handle.replay_remove(key, ctx, scn))) { MDS_LOG_SET(WARN, "failed to replay remove multi key unit data"); } else { - get_tablet_ponter_()->set_mds_written(); + get_tablet_ponter_()->set_tablet_status_written(); MDS_LOG_SET(TRACE, "success to remove multi key unit data"); } return ret; diff --git a/src/storage/tx_storage/ob_tablet_gc_service.cpp b/src/storage/tx_storage/ob_tablet_gc_service.cpp index fb91302b3..fd540da20 100755 --- a/src/storage/tx_storage/ob_tablet_gc_service.cpp +++ b/src/storage/tx_storage/ob_tablet_gc_service.cpp @@ -402,7 +402,7 @@ int ObTabletGCHandler::check_tablet_need_gc_( ObTabletCreateDeleteMdsUserData data; bool mds_table_not_null = false; bool is_finish = false; - if (OB_FAIL(tablet->check_mds_written(mds_table_not_null))) { + if (OB_FAIL(tablet->check_tablet_status_written(mds_table_not_null))) { STORAGE_LOG(WARN, "failed to check mds written", KR(ret), KPC(tablet)); } else if (OB_FAIL(tablet->ObITabletMdsInterface::get_latest_tablet_status(data, is_finish))) { if (OB_EMPTY_RESULT == ret) {