From 3a6bc5bba3c6a0ecfd6ae5cfb6569cac665a428c Mon Sep 17 00:00:00 2001 From: Tyshawn Date: Mon, 14 Aug 2023 08:12:46 +0000 Subject: [PATCH] [BUG.FIX] adjust log level and add tenant id for temporary allocator. --- src/storage/blocksstable/ob_sstable.cpp | 6 +-- src/storage/ls/ob_ls_tablet_service.cpp | 34 ++++++++--------- src/storage/meta_mem/ob_meta_pointer_map.h | 16 ++++---- .../meta_mem/ob_storage_meta_cache.cpp | 6 +-- src/storage/meta_mem/ob_storage_meta_cache.h | 2 +- .../meta_mem/ob_tenant_meta_mem_mgr.cpp | 6 +-- src/storage/tablet/ob_tablet.cpp | 38 +++++++++---------- src/storage/tablet/ob_tablet_persister.cpp | 12 +++--- src/storage/tablet/ob_tablet_table_store.cpp | 2 +- 9 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/storage/blocksstable/ob_sstable.cpp b/src/storage/blocksstable/ob_sstable.cpp index 42f5c3f7f..37fb67029 100644 --- a/src/storage/blocksstable/ob_sstable.cpp +++ b/src/storage/blocksstable/ob_sstable.cpp @@ -684,7 +684,7 @@ int ObSSTable::check_row_locked( int ret = OB_SUCCESS; void *buf = NULL; ObSSTableRowLockChecker *row_checker = NULL; - ObArenaAllocator allocator(ObModIds::OB_STORE_ROW_LOCK_CHECKER); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_STORE_ROW_LOCK_CHECKER)); lock_state.trans_version_ = SCN::min_scn(); lock_state.is_locked_ = false; @@ -1119,7 +1119,7 @@ void ObSSTable::dec_macro_ref() const int ret = OB_SUCCESS; MacroBlockId macro_id; ObMacroIdIterator iterator; - common::ObArenaAllocator tmp_allocator("CacheSST"); + common::ObArenaAllocator tmp_allocator(common::ObMemAttr(MTL_ID(), "CacheSST")); ObSafeArenaAllocator safe_allocator(tmp_allocator); ObSSTableMetaHandle meta_handle; if (OB_FAIL(get_meta(meta_handle, &safe_allocator))) { @@ -1179,7 +1179,7 @@ int ObSSTable::inc_macro_ref(bool &inc_success) const int64_t data_blk_cnt = 0; int64_t other_blk_cnt = 0; int64_t linked_blk_cnt = 0; - common::ObArenaAllocator tmp_allocator("CacheSST"); + common::ObArenaAllocator tmp_allocator(common::ObMemAttr(MTL_ID(), "CacheSST")); ObSafeArenaAllocator safe_allocator(tmp_allocator); ObSSTableMetaHandle meta_handle; if (OB_FAIL(get_meta(meta_handle, &safe_allocator))) { diff --git a/src/storage/ls/ob_ls_tablet_service.cpp b/src/storage/ls/ob_ls_tablet_service.cpp index 758453f63..7f99a0237 100755 --- a/src/storage/ls/ob_ls_tablet_service.cpp +++ b/src/storage/ls/ob_ls_tablet_service.cpp @@ -819,7 +819,7 @@ int ObLSTabletService::rebuild_tablet_with_old( { int ret = OB_SUCCESS; ObTimeGuard time_guard("ObLSTabletService::rebuild_tablet_with_old", 1_s); - common::ObArenaAllocator allocator("RebuildTablet"); + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "RebuildTablet")); ObTabletHandle old_tablet_hdl; ObTabletHandle tmp_tablet_hdl; ObTabletHandle new_tablet_hdl; @@ -869,7 +869,7 @@ int ObLSTabletService::migrate_update_tablet( { int ret = OB_SUCCESS; ObTimeGuard time_guard("ObLSTabletService::migrate_update_tablet", 1_s); - common::ObArenaAllocator allocator("MigUpTab"); + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "MigUpTab")); const common::ObTabletID &tablet_id = mig_tablet_param.tablet_id_; const share::ObLSID &ls_id = mig_tablet_param.ls_id_; const ObTabletMapKey key(mig_tablet_param.ls_id_, mig_tablet_param.tablet_id_); @@ -917,7 +917,7 @@ int ObLSTabletService::migrate_create_tablet( { int ret = OB_SUCCESS; ObTimeGuard time_guard("ObLSTabletService::migrate_create_tablet", 1_s); - common::ObArenaAllocator allocator("MigCreateTab"); + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "MigCreateTab")); const share::ObLSID &ls_id = mig_tablet_param.ls_id_; const common::ObTabletID &tablet_id = mig_tablet_param.tablet_id_; const ObTabletMapKey key(ls_id, tablet_id); @@ -1005,7 +1005,7 @@ int ObLSTabletService::update_tablet_checkpoint( ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid argument", K(ret), K(key), K(new_addr), K(new_handle)); } else { - common::ObArenaAllocator allocator("CKPTUpdate"); + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "CKPTUpdate")); ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); ObTabletHandle tablet_handle; ObMetaDiskAddr addr; @@ -1051,7 +1051,7 @@ int ObLSTabletService::update_tablet_table_store( const ObIArray &tables) { int ret = OB_SUCCESS; - common::ObArenaAllocator allocator; + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "UpTabStore")); if (IS_NOT_INIT) { ret = OB_NOT_INIT; LOG_WARN("ls tablet svr hasn't been inited", K(ret)); @@ -1121,7 +1121,7 @@ int ObLSTabletService::update_tablet_table_store( ObTabletHandle &handle) { int ret = OB_SUCCESS; - common::ObArenaAllocator allocator; + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "UpTabStore")); const share::ObLSID &ls_id = ls_->get_ls_id(); const ObTabletMapKey key(ls_id, tablet_id); ObTabletHandle old_tablet_hdl; @@ -1337,7 +1337,7 @@ int ObLSTabletService::update_medium_compaction_info( ObTabletHandle &handle) { int ret = OB_SUCCESS; - common::ObArenaAllocator allocator; + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "UpMeidumCom")); ObTabletHandle old_tablet_handle; ObTimeGuard time_guard("ObLSTabletService::update_medium_compaction_info", 1_s); ObBucketHashWLockGuard lock_guard(bucket_lock_, tablet_id.hash()); @@ -1397,7 +1397,7 @@ int ObLSTabletService::build_new_tablet_from_mds_table( { TIMEGUARD_INIT(STORAGE, 10_ms, 5_s); int ret = OB_SUCCESS; - common::ObArenaAllocator allocator("BuildMSD"); + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "BuildMSD")); const share::ObLSID &ls_id = ls_->get_ls_id(); const ObTabletMapKey key(ls_id, tablet_id); ObTabletHandle old_tablet_handle; @@ -1429,7 +1429,7 @@ int ObLSTabletService::build_new_tablet_from_mds_table( ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); ObTablet *old_tablet = old_tablet_handle.get_obj(); ObMetaDiskAddr disk_addr; - ObArenaAllocator arena_allocator("mds_reader"); + ObArenaAllocator arena_allocator(common::ObMemAttr(MTL_ID(), "mds_reader")); ObTabletMdsData mds_data; if (OB_FAIL(ret)) { @@ -1760,7 +1760,7 @@ int ObLSTabletService::replay_create_tablet( LOG_ERROR("restart replay tablet should not exist", K(ret), K(ls_id), K(tablet_id)); } else { ObTimeGuard time_guard("ObLSTabletService::replay_create_tablet", 1_s); - common::ObArenaAllocator allocator("ReplayCreate"); + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "ReplayCreate")); const ObTabletMapKey key(ls_id, tablet_id); ObTabletHandle tablet_hdl; ObTablet *tablet = nullptr; @@ -1956,7 +1956,7 @@ int ObLSTabletService::create_tablet( ObTabletHandle &tablet_handle) { int ret = OB_SUCCESS; - common::ObArenaAllocator tmp_allocator("CreateTab"); + common::ObArenaAllocator tmp_allocator(common::ObMemAttr(MTL_ID(), "CreateTab")); common::ObArenaAllocator *allocator = nullptr; ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); const ObTabletMapKey key(ls_id, tablet_id); @@ -2047,7 +2047,7 @@ int ObLSTabletService::create_inner_tablet( ObTabletHandle &tablet_handle) { int ret = OB_SUCCESS; - common::ObArenaAllocator allocator("LSCreateTab"); + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "LSCreateTab")); ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); const ObTabletMapKey key(ls_id, tablet_id); ObSSTable new_sstable; @@ -3397,7 +3397,7 @@ int ObLSTabletService::build_ha_tablet_new_table_store( const ObBatchUpdateTableStoreParam ¶m) { int ret = OB_SUCCESS; - ObArenaAllocator allocator("BuildHaTab"); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "BuildHaTab")); ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); ObMetaDiskAddr disk_addr; ObTimeGuard time_guard("ObLSTabletService::build_ha_tablet_new_table_store", 1_s); @@ -3545,7 +3545,7 @@ int ObLSTabletService::check_old_row_legitimacy( //the vertical partition is no longer maintained, //and the defense check skips the vertical partition function const ObDMLBaseParam &dml_param = run_ctx.dml_param_; - ObArenaAllocator scan_allocator(ObModIds::OB_TABLE_SCAN_ITER); + ObArenaAllocator scan_allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_TABLE_SCAN_ITER)); ObIAllocator *allocator = &scan_allocator; ObSingleRowGetter old_row_getter(*allocator, *data_tablet_handle.get_obj()); ObNewRow *storage_old_row = nullptr; @@ -4861,7 +4861,7 @@ int ObLSTabletService::get_conflict_rows( TRANS_LOG(DEBUG, "get conflict rows", K(flag), K(row), K(lbt())); int ret = OB_SUCCESS; ObRelativeTable &data_table = run_ctx.relative_table_; - ObArenaAllocator scan_allocator(ObModIds::OB_TABLE_SCAN_ITER); + ObArenaAllocator scan_allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_TABLE_SCAN_ITER)); ObIAllocator *allocator = &scan_allocator; ObTablet *data_tablet = tablet_handle.get_obj(); ObDatumRowkeyHelper rowkey_helper(scan_allocator); @@ -5117,7 +5117,7 @@ int ObLSTabletService::table_refresh_row( ObNewRow &row) { int ret = OB_SUCCESS; - ObArenaAllocator scan_allocator(ObModIds::OB_LOB_ACCESS_BUFFER); + ObArenaAllocator scan_allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_LOB_ACCESS_BUFFER)); ObTablet *data_tablet = data_tablet_handle.get_obj(); ObRelativeTable &data_table = run_ctx.relative_table_; ObStoreRowkey rowkey; @@ -5362,7 +5362,7 @@ void ObLSTabletService::dump_diag_info_for_old_row_loss( const ObStoreRow &tbl_row) { int ret = OB_SUCCESS; - ObArenaAllocator allocator; + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "DumpDIAGInfo")); ObTableAccessParam access_param; ObTableAccessContext access_ctx; ObSEArray out_col_pros; diff --git a/src/storage/meta_mem/ob_meta_pointer_map.h b/src/storage/meta_mem/ob_meta_pointer_map.h index de0523067..a365b8399 100644 --- a/src/storage/meta_mem/ob_meta_pointer_map.h +++ b/src/storage/meta_mem/ob_meta_pointer_map.h @@ -460,7 +460,7 @@ int ObMetaPointerMap::load_and_hook_meta_obj( } else if (meta_pointer->is_in_memory()) { // some other thread finish loading need_free_obj = true; if (OB_FAIL(meta_pointer->get_in_memory_obj(guard))) { - STORAGE_LOG(ERROR, "fail to get meta object", K(ret), KP(meta_pointer)); + STORAGE_LOG(WARN, "fail to get meta object", K(ret), KP(meta_pointer)); } } else if (OB_UNLIKELY(disk_addr != meta_pointer->get_addr() || meta_pointer != tmp_ptr_hdl.get_resource_ptr() @@ -473,7 +473,7 @@ int ObMetaPointerMap::load_and_hook_meta_obj( } } else { if (OB_FAIL(meta_pointer->hook_obj(t, guard))) { - STORAGE_LOG(ERROR, "fail to hook object", K(ret), KP(meta_pointer)); + STORAGE_LOG(WARN, "fail to hook object", K(ret), KP(meta_pointer)); } else if (OB_FAIL(guard.get_obj()->assign_pointer_handle(ptr_hdl))) { STORAGE_LOG(WARN, "fail to assign pointer handle", K(ret)); } @@ -511,13 +511,13 @@ int ObMetaPointerMap::load_meta_obj( } else if (OB_FAIL(ResourceMap::hash_func_(key, hash_val))) { STORAGE_LOG(WARN, "fail to calc hash", K(ret), K(key)); } else { - common::ObArenaAllocator arena_allocator; + common::ObArenaAllocator arena_allocator(common::ObMemAttr(MTL_ID(), "LoadMetaObj")); char *buf = nullptr; int64_t buf_len = 0; { common::ObBucketHashRLockGuard lock_guard(ResourceMap::bucket_lock_, hash_val); if (OB_FAIL(meta_pointer->read_from_disk(arena_allocator, buf, buf_len, load_addr))) { - STORAGE_LOG(ERROR, "fail to read from disk", K(ret), KPC(meta_pointer)); + STORAGE_LOG(WARN, "fail to read from disk", K(ret), KPC(meta_pointer)); } } if (OB_SUCC(ret)) { @@ -550,13 +550,13 @@ int ObMetaPointerMap::load_meta_obj( } else if (OB_FAIL(ResourceMap::hash_func_(key, hash_val))) { STORAGE_LOG(WARN, "fail to calc hash", K(ret), K(key)); } else { - common::ObArenaAllocator arena_allocator; + common::ObArenaAllocator arena_allocator(common::ObMemAttr(MTL_ID(), "LoadMetaObj")); char *buf = nullptr; int64_t buf_len = 0; { common::ObBucketHashRLockGuard lock_guard(ResourceMap::bucket_lock_, hash_val); if (OB_FAIL(meta_pointer->read_from_disk(arena_allocator, buf, buf_len, load_addr))) { - STORAGE_LOG(ERROR, "fail to read from disk", K(ret), KPC(meta_pointer)); + STORAGE_LOG(WARN, "fail to read from disk", K(ret), KPC(meta_pointer)); } } if (OB_SUCC(ret)) { @@ -632,7 +632,7 @@ int ObMetaPointerMap::get_meta_obj_with_external_memory( } } else if (!force_alloc_new && t_ptr->is_in_memory()) { if (OB_FAIL(t_ptr->get_in_memory_obj(guard))) { - STORAGE_LOG(ERROR, "fail to get meta object", K(ret), KP(t_ptr)); + STORAGE_LOG(WARN, "fail to get meta object", K(ret), KP(t_ptr)); } else { need_free_obj = true; } @@ -904,7 +904,7 @@ int ObMetaPointerMap::wash_meta_obj(const Key &key, ObMetaObjGuarddump_meta_obj(guard, free_obj))) { - STORAGE_LOG(ERROR, "fail to dump meta obj", K(ret), K(key)); + STORAGE_LOG(WARN, "fail to dump meta obj", K(ret), K(key)); } } return ret; diff --git a/src/storage/meta_mem/ob_storage_meta_cache.cpp b/src/storage/meta_mem/ob_storage_meta_cache.cpp index 9da7dc457..625de5847 100644 --- a/src/storage/meta_mem/ob_storage_meta_cache.cpp +++ b/src/storage/meta_mem/ob_storage_meta_cache.cpp @@ -252,7 +252,7 @@ int ObStorageMetaValue::process_sstable( { UNUSED(tablet); int ret = OB_SUCCESS; - ObArenaAllocator allocator; + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "ProSStable")); blocksstable::ObSSTable sstable; ObIStorageMetaObj *tiny_meta = nullptr; char *tmp_buf = nullptr; @@ -290,7 +290,7 @@ int ObStorageMetaValue::process_table_store( const ObTablet *tablet) { int ret = OB_SUCCESS; - ObArenaAllocator allocator("ProcMetaVaule"); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "ProcMetaVaule")); ObTabletTableStore table_store; ObIStorageMetaObj *tiny_meta = nullptr; char *tmp_buf = nullptr; @@ -327,7 +327,7 @@ int ObStorageMetaValue::process_autoinc_seq( { UNUSED(tablet); // tablet pointer has no use here int ret = OB_SUCCESS; - ObArenaAllocator allocator; + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "AutoIncSeq")); share::ObTabletAutoincSeq autoinc_seq; ObIStorageMetaObj *tiny_meta = nullptr; char *tmp_buf = nullptr; diff --git a/src/storage/meta_mem/ob_storage_meta_cache.h b/src/storage/meta_mem/ob_storage_meta_cache.h index 345fd28a6..b31ac8121 100644 --- a/src/storage/meta_mem/ob_storage_meta_cache.h +++ b/src/storage/meta_mem/ob_storage_meta_cache.h @@ -288,7 +288,7 @@ int ObStorageMetaValue::bypass_process_storage_meta( const int64_t size) { int ret = OB_SUCCESS; - ObArenaAllocator tmp_allocator("ProcMetaVaule"); + ObArenaAllocator tmp_allocator(common::ObMemAttr(MTL_ID(), "ProcMetaVaule")); int64_t pos = 0; T t; char *buff = nullptr; diff --git a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp index 26a627396..490b6258a 100755 --- a/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp +++ b/src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp @@ -798,7 +798,7 @@ int ObTenantMetaMemMgr::get_min_end_scn_for_ls( SCN &min_end_scn_from_old) { int ret = OB_SUCCESS; - ObArenaAllocator allocator; + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "GetMinScn")); ObTabletHandle handle; min_end_scn_from_latest.set_max(); min_end_scn_from_old.set_max(); @@ -881,7 +881,7 @@ int ObTenantMetaMemMgr::get_min_mds_ckpt_scn(const ObTabletMapKey &key, share::S int ret = OB_SUCCESS; SCN min_scn_from_old_tablets = SCN::max_scn(); SCN min_scn_from_cur_tablet = SCN::max_scn(); - ObArenaAllocator allocator; + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "GetMinMdsScn")); ObTabletHandle handle; if (OB_UNLIKELY(!is_inited_)) { @@ -2170,7 +2170,7 @@ int ObTenantMetaMemMgr::try_wash_tablet(const std::type_info &type_info, void *& LOG_WARN("fail to acquire tablet", K(ret)); } else { tablet_handle.set_wash_priority(WashTabletPriority::WTP_LOW); - ObArenaAllocator allocator("WashTablet"); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "WashTablet")); CandidateTabletInfo info; time_guard.click("prepare"); SpinWLockGuard guard(wash_lock_); diff --git a/src/storage/tablet/ob_tablet.cpp b/src/storage/tablet/ob_tablet.cpp index 161d366f6..fa75ad3f1 100755 --- a/src/storage/tablet/ob_tablet.cpp +++ b/src/storage/tablet/ob_tablet.cpp @@ -97,7 +97,7 @@ namespace storage #define IO_AND_DESERIALIZE(allocator, meta_addr, meta_ptr, args...) \ do { \ if (OB_SUCC(ret)) { \ - ObArenaAllocator io_allocator; \ + ObArenaAllocator io_allocator(common::ObMemAttr(MTL_ID(), "TmpIO")); \ char *io_buf = nullptr; \ int64_t buf_len = -1; \ int64_t io_pos = 0; \ @@ -270,7 +270,7 @@ int ObTablet::init( int ret = OB_SUCCESS; int64_t max_sync_schema_version = 0; int64_t input_max_sync_schema_version = 0; - common::ObArenaAllocator tmp_arena_allocator("InitTablet"); + common::ObArenaAllocator tmp_arena_allocator(common::ObMemAttr(MTL_ID(), "InitTablet")); ObTabletMemberWrapper old_table_store_wrapper; const ObTabletTableStore *old_table_store = nullptr; const ObStorageSchema *old_storage_schema = nullptr; @@ -376,7 +376,7 @@ int ObTablet::init( TIMEGUARD_INIT(STORAGE, 10_ms, 5_s); int ret = OB_SUCCESS; allocator_ = &allocator; - common::ObArenaAllocator tmp_arena_allocator("InitTabletMDS"); + common::ObArenaAllocator tmp_arena_allocator(common::ObMemAttr(MTL_ID(), "InitTabletMDS")); ObTabletMemberWrapper old_table_store_wrapper; const ObTabletTableStore *old_table_store = nullptr; const ObStorageSchema *old_storage_schema = nullptr; @@ -532,7 +532,7 @@ int ObTablet::init( const ObTablet &old_tablet) { int ret = OB_SUCCESS; - common::ObArenaAllocator tmp_arena_allocator("InitTablet"); + common::ObArenaAllocator tmp_arena_allocator(common::ObMemAttr(MTL_ID(), "InitTablet")); ObTabletMemberWrapper old_table_store_wrapper; const ObTabletTableStore *old_table_store = nullptr; const ObStorageSchema *old_storage_schema = nullptr; @@ -612,7 +612,7 @@ int ObTablet::init( int ret = OB_SUCCESS; allocator_ = &allocator; SCN max_clog_checkpoint_scn; - common::ObArenaAllocator tmp_arena_allocator("InitTablet"); + common::ObArenaAllocator tmp_arena_allocator(common::ObMemAttr(MTL_ID(), "InitTablet")); ObTabletMemberWrapper old_table_store_wrapper; const ObTabletTableStore *old_table_store = nullptr; const ObStorageSchema *old_storage_schema = nullptr; @@ -988,7 +988,7 @@ int ObTablet::init_empty_shell( int ObTablet::check_sstable_column_checksum() const { int ret = OB_SUCCESS; - common::ObArenaAllocator allocator; + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "CKColCKS")); const ObStorageSchema *storage_schema = nullptr; ObTableStoreIterator iter; int64_t schema_col_cnt = 0; @@ -1174,7 +1174,7 @@ int ObTablet::deserialize( if (OB_SUCC(ret)) { pos = new_pos; - ObArenaAllocator arena_allocator; + ObArenaAllocator arena_allocator(common::ObMemAttr(MTL_ID(), "TmpSchema")); const ObStorageSchema *schema = nullptr; if (!is_empty_shell()) { if (OB_FAIL(load_storage_schema(allocator, schema))) { @@ -2226,7 +2226,7 @@ int ObTablet::lock_row( LOG_WARN("fail to protect table", K(ret), "tablet_id", tablet_meta_.tablet_id_); } if (OB_SUCC(ret)) { - ObArenaAllocator allocator(ObModIds::OB_STORE_ROW_LOCK_CHECKER); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_STORE_ROW_LOCK_CHECKER)); ObMemtable *write_memtable = nullptr; ObTableIterParam param; ObTableAccessContext context; @@ -2270,7 +2270,7 @@ int ObTablet::lock_row( } else if (OB_FAIL(guard.refresh_and_protect_table(relative_table))) { LOG_WARN("fail to protect table", K(ret)); } else { - ObArenaAllocator allocator(ObModIds::OB_STORE_ROW_LOCK_CHECKER); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_STORE_ROW_LOCK_CHECKER)); ObMemtable *write_memtable = nullptr; ObTableIterParam param; ObTableAccessContext context; @@ -2295,7 +2295,7 @@ int ObTablet::check_row_locked_by_myself( bool &locked) { int ret = OB_SUCCESS; - ObArenaAllocator allocator(ObModIds::OB_STORE_ROW_LOCK_CHECKER); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_STORE_ROW_LOCK_CHECKER)); ObMemtable *write_memtable = nullptr; ObTableIterParam param; ObTableAccessContext context; @@ -2791,7 +2791,7 @@ int ObTablet::update_row( } else if (OB_FAIL(prepare_memtable(relative_table, store_ctx, write_memtable))) { LOG_WARN("prepare write memtable fail", K(ret), K(relative_table)); } else { - ObArenaAllocator allocator(ObModIds::OB_STORE_ROW_EXISTER); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_STORE_ROW_EXISTER)); ObTableIterParam param; ObTableAccessContext context; if (OB_FAIL(prepare_param_ctx(allocator, relative_table, store_ctx, param, context))) { @@ -2841,7 +2841,7 @@ int ObTablet::insert_row_without_rowkey_check( } else if (OB_FAIL(prepare_memtable(relative_table, store_ctx, write_memtable))) { LOG_WARN("prepare write memtable fail", K(ret), K(relative_table)); } else { - ObArenaAllocator allocator(ObModIds::OB_STORE_ROW_EXISTER); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_STORE_ROW_EXISTER)); ObTableIterParam param; ObTableAccessContext context; if (OB_FAIL(prepare_param_ctx(allocator, relative_table, store_ctx, param, context))) { @@ -2994,7 +2994,7 @@ int ObTablet::rowkey_exists( ObStoreRowkey rowkey; ObDatumRowkey datum_rowkey; ObDatumRowkeyHelper rowkey_helper; - ObArenaAllocator allocator(ObModIds::OB_STORE_ROW_EXISTER); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), ObModIds::OB_STORE_ROW_EXISTER)); ObTableIterParam param; ObTableAccessContext context; @@ -3261,7 +3261,7 @@ int ObTablet::get_schema_version_from_storage_schema(int64_t &schema_version) co int ret = OB_SUCCESS; const common::ObTabletID &tablet_id = tablet_meta_.tablet_id_; const ObStorageSchema *storage_schema = nullptr; - ObArenaAllocator arena_allocator; + ObArenaAllocator arena_allocator(common::ObMemAttr(MTL_ID(), "TmpSchema")); if (IS_NOT_INIT) { ret = OB_NOT_INIT; LOG_WARN("not inited", K(ret), K_(is_inited), K(tablet_id)); @@ -3596,7 +3596,7 @@ int ObTablet::build_read_info(common::ObArenaAllocator &allocator, const ObTable { int ret = OB_SUCCESS; int64_t full_stored_col_cnt = 0; - common::ObArenaAllocator tmp_allocator; + common::ObArenaAllocator tmp_allocator(common::ObMemAttr(MTL_ID(), "TmpSchema")); const ObStorageSchema *storage_schema = nullptr; ObSEArray cols_desc; tablet = (tablet == nullptr) ? this : tablet; @@ -3714,7 +3714,7 @@ int ObTablet::build_migration_tablet_param( mig_tablet_param.transfer_info_ = tablet_meta_.transfer_info_; mig_tablet_param.is_empty_shell_ = is_empty_shell(); - ObArenaAllocator arena_allocator("BuildMigParam"); + ObArenaAllocator arena_allocator(common::ObMemAttr(MTL_ID(), "BuildMigParam")); const ObStorageSchema *storage_schema = nullptr; const ObTabletAutoincSeq *tablet_autoinc_seq = nullptr; if (!is_empty_shell()) { @@ -3842,7 +3842,7 @@ int ObTablet::fetch_tablet_autoinc_seq_cache( share::ObTabletAutoincInterval &result) { int ret = OB_SUCCESS; - ObArenaAllocator allocator; + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "FetchAutoSeq")); ObTabletAutoincSeq autoinc_seq; uint64_t auto_inc_seqvalue = 0; if (OB_UNLIKELY(!is_inited_)) { @@ -3888,7 +3888,7 @@ int ObTablet::get_kept_multi_version_start( const common::ObTabletID &tablet_id = tablet.get_tablet_meta().tablet_id_; ObTabletMemberWrapper table_store_wrapper; const ObTabletTableStore *table_store = nullptr; - common::ObArenaAllocator arena_allocator("reader"); + common::ObArenaAllocator arena_allocator(common::ObMemAttr(MTL_ID(), "reader")); if (OB_FAIL(tablet.fetch_table_store(table_store_wrapper))) { LOG_WARN("fail to fetch table store", K(ret)); @@ -4024,7 +4024,7 @@ int ObTablet::write_sync_tablet_seq_log(ObTabletAutoincSeq &autoinc_seq, int ObTablet::update_tablet_autoinc_seq(const uint64_t autoinc_seq) { int ret = OB_SUCCESS; - ObArenaAllocator allocator("UpdAutoincSeq"); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "UpdAutoincSeq")); ObTabletAutoincSeq curr_autoinc_seq; uint64_t curr_auto_inc_seqvalue; SCN scn; diff --git a/src/storage/tablet/ob_tablet_persister.cpp b/src/storage/tablet/ob_tablet_persister.cpp index f291195d0..676121078 100644 --- a/src/storage/tablet/ob_tablet_persister.cpp +++ b/src/storage/tablet/ob_tablet_persister.cpp @@ -92,7 +92,7 @@ int ObTabletPersister::persist_and_transform_tablet( { TIMEGUARD_INIT(STORAGE, 10_ms, 5_s); int ret = OB_SUCCESS; - common::ObArenaAllocator allocator; + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "PesistTranf")); common::ObSEArray tablet_meta_write_ctxs; common::ObSEArray sstable_meta_write_ctxs; @@ -427,7 +427,7 @@ int ObTabletPersister::transform( TIMEGUARD_INIT(STORAGE, 10_ms, 5_s); int ret = OB_SUCCESS; ObTablet *tiny_tablet = reinterpret_cast(buf); - ObArenaAllocator allocator("TmpPullMemTbl"); + ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "TmpPullMemTbl")); if (len <= sizeof(ObTablet) || OB_ISNULL(buf)) { ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid arguments", K(ret), KP(buf), K(len)); @@ -437,7 +437,7 @@ int ObTabletPersister::transform( // buf related int64_t start_pos = sizeof(ObTablet); int64_t remain = len - start_pos; - common::ObArenaAllocator allocator("Transform"); + common::ObArenaAllocator allocator(common::ObMemAttr(MTL_ID(), "Transform")); LOG_DEBUG("TINY TABLET: tablet", KP(buf), K(start_pos), K(remain)); // rowkey read info related @@ -567,7 +567,7 @@ int ObTabletPersister::fetch_and_persist_sstable( } else { ObMetaDiskAddr addr; ObSSTable *sstable = nullptr; - ObArenaAllocator tmp_allocator("PersistSSTable"); + ObArenaAllocator tmp_allocator(common::ObMemAttr(MTL_ID(), "PersistSSTable")); // The sstable by cache in table store, the address is also valid. But, here we hope that all // members of the sstable are serialized. So, we deep copy the sstable and set mem address. addr.set_mem_addr(0, sizeof(ObSSTable)); @@ -717,7 +717,7 @@ int ObTabletPersister::link_write_medium_info_list( int ret = OB_SUCCESS; ObTenantCheckpointSlogHandler *ckpt_slog_hanlder = MTL(ObTenantCheckpointSlogHandler*); ObSharedBlockReaderWriter &reader_writer = ckpt_slog_hanlder->get_shared_block_reader_writer(); - common::ObArenaAllocator arena_allocator("serializer"); + common::ObArenaAllocator arena_allocator(common::ObMemAttr(MTL_ID(), "serializer")); ObSharedBlockWriteInfo write_info; ObSharedBlockLinkHandle write_handle; @@ -786,7 +786,7 @@ int ObTabletPersister::load_table_store( { int ret = OB_SUCCESS; void *ptr = nullptr; - ObArenaAllocator io_allocator("PersisterTmpIO"); + ObArenaAllocator io_allocator(common::ObMemAttr(MTL_ID(), "PersisterTmpIO")); if (OB_UNLIKELY(!addr.is_block())) { ret = OB_INVALID_ARGUMENT; LOG_WARN("address type isn't disk", K(ret), K(addr)); diff --git a/src/storage/tablet/ob_tablet_table_store.cpp b/src/storage/tablet/ob_tablet_table_store.cpp index b5a0449ef..ad94a2029 100755 --- a/src/storage/tablet/ob_tablet_table_store.cpp +++ b/src/storage/tablet/ob_tablet_table_store.cpp @@ -1659,7 +1659,7 @@ int ObTabletTableStore::batch_cache_sstable_meta( const int64_t remain_size) { int ret = OB_SUCCESS; - common::ObArenaAllocator tmp_allocator("CacheSSTable"); + common::ObArenaAllocator tmp_allocator(common::ObMemAttr(MTL_ID(), "CacheSSTable")); ObSafeArenaAllocator safe_allocator(tmp_allocator); common::ObSEArray cache_keys; common::ObSEArray sstables;