From 25f70ff29f9a09fe23d7060834cab6ea4f47a53f Mon Sep 17 00:00:00 2001 From: tushicheng <18829573815@163.com> Date: Wed, 17 May 2023 16:16:48 +0000 Subject: [PATCH] fix .wf missing error_log --- deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp | 2 +- src/share/config/ob_server_config.cpp | 11 +++++++++++ src/share/ob_tenant_mgr.cpp | 11 ----------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp b/deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp index ddc10f5ff..95592b135 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp +++ b/deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp @@ -482,7 +482,7 @@ void ObMallocAllocator::print_tenant_memory_usage(uint64_t tenant_id) const char *buf = (char *)ctxalp(BUFLEN); if (OB_ISNULL(buf)) { ret = OB_ALLOCATE_MEMORY_FAILED; - LIB_LOG(ERROR, "no memory", K(ret)); + LIB_LOG(WARN, "no memory", K(ret)); } else { int64_t ctx_pos = 0; const volatile int64_t *ctx_hold_bytes = mgr->get_ctx_hold_bytes(); diff --git a/src/share/config/ob_server_config.cpp b/src/share/config/ob_server_config.cpp index af459f1c2..38ed9539e 100644 --- a/src/share/config/ob_server_config.cpp +++ b/src/share/config/ob_server_config.cpp @@ -276,6 +276,17 @@ int ObServerMemoryConfig::reload_config(const ObServerConfig& server_config) LOG_ERROR("update memory_limit or system_memory failed", K(memory_limit), K(system_memory)); } + + int64_t observer_tenant_hold = lib::get_tenant_memory_hold(OB_SERVER_TENANT_ID); + if (observer_tenant_hold > system_memory_) { + if (server_config._ignore_system_memory_over_limit_error) { + LOG_WARN("the hold of observer tenant is over the system_memory", + K(observer_tenant_hold), K_(system_memory)); + } else { + LOG_ERROR("the hold of observer tenant is over the system_memory", + K(observer_tenant_hold), K_(system_memory)); + } + } return ret; } diff --git a/src/share/ob_tenant_mgr.cpp b/src/share/ob_tenant_mgr.cpp index bab4d054a..34a66245a 100644 --- a/src/share/ob_tenant_mgr.cpp +++ b/src/share/ob_tenant_mgr.cpp @@ -405,17 +405,6 @@ int ObVirtualTenantManager::print_tenant_usage_( mallocator->print_tenant_memory_usage(node.tenant_id_); mallocator->print_tenant_ctx_memory_usage(node.tenant_id_); } - if (OB_SERVER_TENANT_ID == node.tenant_id_) { - int64_t observer_tenant_hold = lib::get_tenant_memory_hold(node.tenant_id_); - int64_t system_memory = GMEMCONF.get_reserved_server_memory(); - if (observer_tenant_hold > system_memory) { - if (GCONF._ignore_system_memory_over_limit_error) { - COMMON_LOG(WARN, "the hold of observer tenant is over the system_memory", K(observer_tenant_hold), K(system_memory)); - } else { - COMMON_LOG(ERROR, "the hold of observer tenant is over the system_memory", K(observer_tenant_hold), K(system_memory)); - } - } - } return ret; }