diff --git a/deps/oblib/src/lib/alloc/alloc_failed_reason.cpp b/deps/oblib/src/lib/alloc/alloc_failed_reason.cpp index 5f047c5b8f..626bebfbfb 100644 --- a/deps/oblib/src/lib/alloc/alloc_failed_reason.cpp +++ b/deps/oblib/src/lib/alloc/alloc_failed_reason.cpp @@ -126,7 +126,9 @@ char *alloc_failed_msg() return msg; } -void print_alloc_failed_msg() +void print_alloc_failed_msg(uint64_t tenant_id, uint64_t ctx_id, + int64_t ctx_hold, int64_t ctx_limit, + int64_t tenant_hold, int64_t tenant_limit) { if (TC_REACH_TIME_INTERVAL(1 * 1000 * 1000)) { #ifdef FATAL_ERROR_HANG @@ -136,7 +138,12 @@ void print_alloc_failed_msg() } #endif const char *msg = alloc_failed_msg(); - LOG_DBA_WARN_V2(OB_LIB_ALLOCATE_MEMORY_FAIL, OB_ALLOCATE_MEMORY_FAILED, "[OOPS]: alloc failed reason is that ", msg); + LOG_DBA_WARN_V2(OB_LIB_ALLOCATE_MEMORY_FAIL, OB_ALLOCATE_MEMORY_FAILED, "[oops]: alloc failed reason is that ", msg); + _OB_LOG_RET(WARN, OB_ALLOCATE_MEMORY_FAILED, "[OOPS]: alloc failed reason is that %s. " + "detailed info: tenant_id=%lu, ctx_id=%lu, ctx_name=%s, ctx_hold=%ld, " + "ctx_limit=%ld, tenant_hold=%ld, tenant_limit=%ld, backtrace=%s", + msg, tenant_id, ctx_id, get_global_ctx_info().get_ctx_name(ctx_id), + ctx_hold, ctx_limit, tenant_hold, tenant_limit, lbt()); // 49 is the user defined signal to dump memory raise(49); } diff --git a/deps/oblib/src/lib/alloc/alloc_failed_reason.h b/deps/oblib/src/lib/alloc/alloc_failed_reason.h index 8a93f0f53c..1914f57b16 100644 --- a/deps/oblib/src/lib/alloc/alloc_failed_reason.h +++ b/deps/oblib/src/lib/alloc/alloc_failed_reason.h @@ -71,7 +71,9 @@ public: char *alloc_failed_msg(); AllocFailedCtx &g_alloc_failed_ctx(); -void print_alloc_failed_msg(); +void print_alloc_failed_msg(uint64_t tenant_id, uint64_t ctx_id, + int64_t ctx_hold, int64_t ctx_limit, + int64_t tenant_hold, int64_t tenant_limit); } // end of namespace lib } // end of namespace oceanbase diff --git a/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h b/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h index e970755dcd..880779cec4 100644 --- a/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h +++ b/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h @@ -412,7 +412,9 @@ public: } } if (NULL == nptr) { - print_alloc_failed_msg(); + print_alloc_failed_msg(ta.get_tenant_id(), ta.get_ctx_id(), + ta.get_hold(), ta.get_limit(), + ta.get_tenant_hold(), ta.get_tenant_limit()); } return nptr; }