diff --git a/src/storage/ls/ob_ls_tablet_service.cpp b/src/storage/ls/ob_ls_tablet_service.cpp index 5d566b4d83..74952ddfe2 100644 --- a/src/storage/ls/ob_ls_tablet_service.cpp +++ b/src/storage/ls/ob_ls_tablet_service.cpp @@ -7039,6 +7039,7 @@ int ObLSTabletService::get_tablet_without_memtables( common::ObArenaAllocator &allocator, ObTabletHandle &handle) { + TIMEGUARD_INIT(GetStaticTablet, 1_s); int ret = OB_SUCCESS; ObTablet *tablet = nullptr; ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); @@ -7049,14 +7050,14 @@ int ObLSTabletService::get_tablet_without_memtables( } else if (OB_ISNULL(t3m)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("tenant meta mem mgr should not be null", K(ret), KP(t3m)); - } else if (OB_FAIL(t3m->get_tablet_with_allocator( + } else if (CLICK_FAIL(t3m->get_tablet_with_allocator( priority, key, allocator, handle, force_alloc_new))) { if (OB_ENTRY_NOT_EXIST == ret) { ret = OB_TABLET_NOT_EXIST; } else { LOG_WARN("failed to get tablet with allocator", K(ret), K(priority), K(key)); } - } else if (OB_FAIL(handle.get_obj()->clear_memtables_on_table_store())) { + } else if (CLICK_FAIL(handle.get_obj()->clear_memtables_on_table_store())) { LOG_WARN("failed to clear memtables on table store", K(ret), K(key)); } return ret; diff --git a/src/storage/meta_mem/ob_tablet_pointer_map.cpp b/src/storage/meta_mem/ob_tablet_pointer_map.cpp index 04dd7be2e4..2eb398c49f 100644 --- a/src/storage/meta_mem/ob_tablet_pointer_map.cpp +++ b/src/storage/meta_mem/ob_tablet_pointer_map.cpp @@ -590,6 +590,7 @@ int ObTabletPointerMap::get_meta_obj_with_external_memory( const bool force_alloc_new, ObITabletFilterOp *op) { + TIMEGUARD_INIT(T3mGetStaticTablet, 1_s); int ret = common::OB_SUCCESS; uint64_t hash_val = 0; ObTabletPointerHandle ptr_hdl(*this); @@ -599,19 +600,19 @@ int ObTabletPointerMap::get_meta_obj_with_external_memory( if (OB_UNLIKELY(!key.is_valid() || (force_alloc_new && nullptr != op))) { /*only support filter when not force new*/ ret = common::OB_INVALID_ARGUMENT; STORAGE_LOG(WARN, "invalid argument", K(ret), K(key)); - } else if (OB_FAIL(ResourceMap::hash_func_(key, hash_val))) { + } else if (CLICK_FAIL(ResourceMap::hash_func_(key, hash_val))) { STORAGE_LOG(WARN, "fail to calc hash", K(ret), K(key)); } else if (force_alloc_new) { common::ObBucketHashRLockGuard lock_guard(ResourceMap::bucket_lock_, hash_val); - if (OB_FAIL(ResourceMap::get_without_lock(key, ptr_hdl))) { + if (CLICK_FAIL(ResourceMap::get_without_lock(key, ptr_hdl))) { if (common::OB_ENTRY_NOT_EXIST != ret) { STORAGE_LOG(WARN, "fail to get pointer handle", K(ret)); } } else if (!ptr_hdl.get_resource_ptr()->get_addr().is_disked()) { ret = OB_EAGAIN; // For non-disked addr tablet, please wait for persist. } - } else if ((nullptr == op && OB_FAIL(try_get_in_memory_meta_obj(key, ptr_hdl, guard, is_in_memory))) - || (nullptr != op && OB_FAIL(try_get_in_memory_meta_obj_with_filter(key, *op, ptr_hdl, guard, is_in_memory)))) { + } else if ((nullptr == op && CLICK_FAIL(try_get_in_memory_meta_obj(key, ptr_hdl, guard, is_in_memory))) + || (nullptr != op && CLICK_FAIL(try_get_in_memory_meta_obj_with_filter(key, *op, ptr_hdl, guard, is_in_memory)))) { if (OB_ENTRY_NOT_EXIST == ret) { STORAGE_LOG(DEBUG, "meta obj does not exist", K(ret), K(key)); } else { @@ -624,7 +625,7 @@ int ObTabletPointerMap::get_meta_obj_with_external_memory( t_ptr = ptr_hdl.get_resource_ptr(); ObMetaDiskAddr disk_addr; void *buf = nullptr; - if (OB_FAIL(ret)) { + if (CLICK_FAIL(ret)) { // do nothing } else if (OB_ISNULL(buf = allocator.alloc(sizeof(ObTablet)))) { ret = OB_ALLOCATE_MEMORY_FAILED; @@ -634,19 +635,19 @@ int ObTabletPointerMap::get_meta_obj_with_external_memory( ObTablet *t = new (buf) ObTablet(true /*is_external_tablet*/); do { t->reset(); - if (OB_FAIL(load_meta_obj(key, t_ptr, allocator, disk_addr, t))) { + if (CLICK_FAIL(load_meta_obj(key, t_ptr, allocator, disk_addr, t))) { STORAGE_LOG(WARN, "load obj from disk fail", K(ret), K(key), KPC(t_ptr), K(lbt())); } else { ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*); ObTabletPointerHandle tmp_ptr_hdl(*this); common::ObBucketHashWLockGuard lock_guard(ResourceMap::bucket_lock_, hash_val); // some other thread finish loading - if (OB_FAIL(ResourceMap::get_without_lock(key, tmp_ptr_hdl))) { + if (CLICK_FAIL(ResourceMap::get_without_lock(key, tmp_ptr_hdl))) { if (OB_ENTRY_NOT_EXIST != ret) { STORAGE_LOG(WARN, "fail to get pointer handle", K(ret)); } } else if (!force_alloc_new && t_ptr->is_in_memory()) { - if (OB_FAIL(t_ptr->get_in_memory_obj(guard))) { + if (CLICK_FAIL(t_ptr->get_in_memory_obj(guard))) { STORAGE_LOG(WARN, "fail to get meta object", K(ret), KP(t_ptr)); } else { need_free_obj = true; @@ -665,9 +666,9 @@ int ObTabletPointerMap::get_meta_obj_with_external_memory( if (REACH_TIME_INTERVAL(1000000)) { STORAGE_LOG(WARN, "disk address change", K(ret), K(disk_addr), KPC(t_ptr)); } - } else if (OB_FAIL(t->deserialize_post_work(allocator))) { + } else if (CLICK_FAIL(t->deserialize_post_work(allocator))) { STORAGE_LOG(WARN, "fail to deserialize post work", K(ret), KP(t)); - } else if (OB_FAIL(t3m->inc_external_tablet_cnt(t->get_tablet_id().id(), t->get_transfer_seq()))) { + } else if (CLICK_FAIL(t3m->inc_external_tablet_cnt(t->get_tablet_id().id(), t->get_transfer_seq()))) { // TODO FEIDU t->pointer_hdl_.reset(); (external tablet should not hold tablet_pointer) // !CAUTION: t3m->inc_external_tablet_cnt must be the last step which can modify ret; or, we have to dec_external_tablet_cnt in the failure process STORAGE_LOG(WARN, "fail to inc external tablet cnt", K(ret), KP(t), KPC(t)); @@ -675,11 +676,11 @@ int ObTabletPointerMap::get_meta_obj_with_external_memory( guard.set_obj(t, &allocator, t3m); } } // write lock end - if ((OB_FAIL(ret) && OB_NOT_NULL(t)) || need_free_obj) { + if ((CLICK_FAIL(ret) && OB_NOT_NULL(t)) || need_free_obj) { t->dec_macro_ref_cnt(); } } while (OB_ITEM_NOT_MATCH == ret); - if ((OB_FAIL(ret) && OB_NOT_NULL(t)) || need_free_obj) { + if ((CLICK_FAIL(ret) && OB_NOT_NULL(t)) || need_free_obj) { t->~ObTablet(); allocator.free(t); t = nullptr;