fix full link tracing log printed in observer.log
This commit is contained in:
4
deps/oblib/src/lib/oblog/ob_log.cpp
vendored
4
deps/oblib/src/lib/oblog/ob_log.cpp
vendored
@ -82,8 +82,8 @@ ObPLogFDType get_fd_type(const char *mod_name)
|
|||||||
ObPLogFDType type = FD_SVR_FILE;
|
ObPLogFDType type = FD_SVR_FILE;
|
||||||
static const size_t RS_MODULE_LEN = strlen("[RS");
|
static const size_t RS_MODULE_LEN = strlen("[RS");
|
||||||
static const size_t ELEC_MODULE_LEN = strlen("[ELECT");
|
static const size_t ELEC_MODULE_LEN = strlen("[ELECT");
|
||||||
static const size_t OBTRACE_MODULE_LEN = strlen("[OBTRACE");
|
static const size_t FLT_MODULE_LEN = strlen("[FLT");
|
||||||
if (0 == STRNCMP(mod_name, "[OBTRACE", OBTRACE_MODULE_LEN)) {
|
if (0 == STRNCMP(mod_name, "[FLT", FLT_MODULE_LEN)) {
|
||||||
type = FD_TRACE_FILE;
|
type = FD_TRACE_FILE;
|
||||||
} else if (ObThreadFlags::is_rs_thread()
|
} else if (ObThreadFlags::is_rs_thread()
|
||||||
|| 0 == STRNCMP(mod_name, "[RS", RS_MODULE_LEN)) {
|
|| 0 == STRNCMP(mod_name, "[RS", RS_MODULE_LEN)) {
|
||||||
|
|||||||
2
deps/oblib/src/lib/oblog/ob_log.h
vendored
2
deps/oblib/src/lib/oblog/ob_log.h
vendored
@ -1150,7 +1150,7 @@ inline void ObLogger::do_log_message(const bool is_async,
|
|||||||
const int64_t log_size = limited_left_log_size_ + NORMAL_LOG_SIZE;
|
const int64_t log_size = limited_left_log_size_ + NORMAL_LOG_SIZE;
|
||||||
limited_left_log_size_ = 0;
|
limited_left_log_size_ = 0;
|
||||||
const int64_t logging_time_us_begin = get_cur_us();
|
const int64_t logging_time_us_begin = get_cur_us();
|
||||||
if (OB_FAIL(check_tl_log_limiter(location_hash_val, level, errcode, log_size, allow))) {
|
if (FD_TRACE_FILE != fd_type && OB_FAIL(check_tl_log_limiter(location_hash_val, level, errcode, log_size, allow))) {
|
||||||
LOG_STDERR("precheck_tl_log_limiter error, ret=%d\n", ret);
|
LOG_STDERR("precheck_tl_log_limiter error, ret=%d\n", ret);
|
||||||
} else if (OB_UNLIKELY(!allow) && !need_print_log_limit_msg()) {
|
} else if (OB_UNLIKELY(!allow) && !need_print_log_limit_msg()) {
|
||||||
inc_dropped_log_count(level);
|
inc_dropped_log_count(level);
|
||||||
|
|||||||
10
deps/oblib/src/lib/oblog/ob_log_module.h
vendored
10
deps/oblib/src/lib/oblog/ob_log_module.h
vendored
@ -69,7 +69,7 @@ DEFINE_LOG_SUB_MOD(PALF) // palf
|
|||||||
DEFINE_LOG_SUB_MOD(STANDBY) // primary and standby cluster
|
DEFINE_LOG_SUB_MOD(STANDBY) // primary and standby cluster
|
||||||
DEFINE_LOG_SUB_MOD(REASY) // libreasy
|
DEFINE_LOG_SUB_MOD(REASY) // libreasy
|
||||||
DEFINE_LOG_SUB_MOD(COORDINATOR) // leader coordinator
|
DEFINE_LOG_SUB_MOD(COORDINATOR) // leader coordinator
|
||||||
DEFINE_LOG_SUB_MOD(OBTRACE) // trace
|
DEFINE_LOG_SUB_MOD(FLT) // trace
|
||||||
DEFINE_LOG_SUB_MOD(DATA_DICT) // data_dictionary module
|
DEFINE_LOG_SUB_MOD(DATA_DICT) // data_dictionary module
|
||||||
DEFINE_LOG_SUB_MOD(MVCC) // concurrency_control
|
DEFINE_LOG_SUB_MOD(MVCC) // concurrency_control
|
||||||
LOG_MOD_END(ROOT)
|
LOG_MOD_END(ROOT)
|
||||||
@ -444,8 +444,8 @@ LOG_MOD_END(PL)
|
|||||||
#define _STANDBY_LOG(level, _fmt_, args...) _OB_MOD_LOG(STANDBY, level, _fmt_, ##args)
|
#define _STANDBY_LOG(level, _fmt_, args...) _OB_MOD_LOG(STANDBY, level, _fmt_, ##args)
|
||||||
#define COORDINATOR_LOG(level, info_string, args...) OB_MOD_LOG(COORDINATOR, level, info_string, ##args)
|
#define COORDINATOR_LOG(level, info_string, args...) OB_MOD_LOG(COORDINATOR, level, info_string, ##args)
|
||||||
#define _COORDINATOR_LOG(level, _fmt_, args...) _OB_MOD_LOG(COORDINATOR, level, _fmt_, ##args)
|
#define _COORDINATOR_LOG(level, _fmt_, args...) _OB_MOD_LOG(COORDINATOR, level, _fmt_, ##args)
|
||||||
#define OBTRACE_LOG(level, info_string, args...) OB_MOD_LOG(OBTRACE, level, info_string, ##args)
|
#define FLT_LOG(level, info_string, args...) OB_MOD_LOG(FLT, level, info_string, ##args)
|
||||||
#define _OBTRACE_LOG(level, _fmt_, args...) _OB_MOD_LOG(OBTRACE, level, _fmt_, ##args)
|
#define _FLT_LOG(level, _fmt_, args...) _OB_MOD_LOG(FLT, level, _fmt_, ##args)
|
||||||
#define DDLOG(level, info_string, args...) OB_MOD_LOG(DATA_DICT, level, info_string, ##args)
|
#define DDLOG(level, info_string, args...) OB_MOD_LOG(DATA_DICT, level, info_string, ##args)
|
||||||
#define _DDLOG(level, _fmt_, args...) _OB_MOD_LOG(DATA_DICT, level, _fmt_, ##args)
|
#define _DDLOG(level, _fmt_, args...) _OB_MOD_LOG(DATA_DICT, level, _fmt_, ##args)
|
||||||
#define MVCC_LOG(level, info_string, args...) OB_MOD_LOG(MVCC, level, info_string, ##args)
|
#define MVCC_LOG(level, info_string, args...) OB_MOD_LOG(MVCC, level, info_string, ##args)
|
||||||
@ -922,8 +922,8 @@ LOG_MOD_END(PL)
|
|||||||
#define _STANDBY_LOG_RET(level, errcode, args...) { int ret = errcode; _STANDBY_LOG(level, ##args); }
|
#define _STANDBY_LOG_RET(level, errcode, args...) { int ret = errcode; _STANDBY_LOG(level, ##args); }
|
||||||
#define COORDINATOR_LOG_RET(level, errcode, args...) { int ret = errcode; COORDINATOR_LOG(level, ##args); }
|
#define COORDINATOR_LOG_RET(level, errcode, args...) { int ret = errcode; COORDINATOR_LOG(level, ##args); }
|
||||||
#define _COORDINATOR_LOG_RET(level, errcode, args...) { int ret = errcode; _COORDINATOR_LOG(level, ##args); }
|
#define _COORDINATOR_LOG_RET(level, errcode, args...) { int ret = errcode; _COORDINATOR_LOG(level, ##args); }
|
||||||
#define OBTRACE_LOG_RET(level, errcode, args...) { int ret = errcode; OBTRACE_LOG(level, ##args); }
|
#define FLT_LOG_RET(level, errcode, args...) { int ret = errcode; FLT_LOG(level, ##args); }
|
||||||
#define _OBTRACE_LOG_RET(level, errcode, args...) { int ret = errcode; _OBTRACE_LOG(level, ##args); }
|
#define _FLT_LOG_RET(level, errcode, args...) { int ret = errcode; _FLT_LOG(level, ##args); }
|
||||||
#define MVCC_LOG_RET(level, errcode, args...) { int ret = errcode; MVCC_LOG(level, ##args); }
|
#define MVCC_LOG_RET(level, errcode, args...) { int ret = errcode; MVCC_LOG(level, ##args); }
|
||||||
#define _MVCC_LOG_RET(level, errcode, args...) { int ret = errcode; _MVCC_LOG(level, ##args); }
|
#define _MVCC_LOG_RET(level, errcode, args...) { int ret = errcode; _MVCC_LOG(level, ##args); }
|
||||||
#define WRS_CLUSTER_LOG_RET(level, errcode, args...) { int ret = errcode; WRS_CLUSTER_LOG(level, ##args); }
|
#define WRS_CLUSTER_LOG_RET(level, errcode, args...) { int ret = errcode; WRS_CLUSTER_LOG(level, ##args); }
|
||||||
|
|||||||
4
deps/oblib/src/lib/trace/ob_trace.cpp
vendored
4
deps/oblib/src/lib/trace/ob_trace.cpp
vendored
@ -90,7 +90,7 @@ void flush_trace()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
INIT_SPAN(span->source_span_);
|
INIT_SPAN(span->source_span_);
|
||||||
_OBTRACE_LOG(INFO,
|
_FLT_LOG(INFO,
|
||||||
TRACE_PATTERN "%s}",
|
TRACE_PATTERN "%s}",
|
||||||
UUID_TOSTRING(trace.get_trace_id()),
|
UUID_TOSTRING(trace.get_trace_id()),
|
||||||
__span_type_mapper[span->span_type_],
|
__span_type_mapper[span->span_type_],
|
||||||
@ -111,7 +111,7 @@ void flush_trace()
|
|||||||
span = next;
|
span = next;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
PRINT_WITH_TRACE_MODE(OBTRACE, INFO, func());
|
PRINT_WITH_TRACE_MODE(FLT, INFO, func());
|
||||||
trace.offset_ = trace.buffer_size_ / 2;
|
trace.offset_ = trace.buffer_size_ / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
deps/oblib/src/lib/trace/ob_trace_def.h
vendored
5
deps/oblib/src/lib/trace/ob_trace_def.h
vendored
@ -75,13 +75,11 @@ FLT_DEF_SPAN(com_query_process, "com_query process")
|
|||||||
// for ps end
|
// for ps end
|
||||||
|
|
||||||
// for das
|
// for das
|
||||||
FLT_DEF_SPAN(get_das_id, "fetch das task id")
|
|
||||||
FLT_DEF_SPAN(do_local_das_task, "execute local das task")
|
FLT_DEF_SPAN(do_local_das_task, "execute local das task")
|
||||||
FLT_DEF_SPAN(do_async_remote_das_task, "execute async remote das task")
|
FLT_DEF_SPAN(do_async_remote_das_task, "execute async remote das task")
|
||||||
FLT_DEF_SPAN(das_async_rpc_process, "das task async rpc process")
|
FLT_DEF_SPAN(das_async_rpc_process, "das task async rpc process")
|
||||||
FLT_DEF_SPAN(do_sync_remote_das_task, "execute sync remote das task")
|
FLT_DEF_SPAN(do_sync_remote_das_task, "execute sync remote das task")
|
||||||
FLT_DEF_SPAN(das_sync_rpc_process, "das task sync rpc process")
|
FLT_DEF_SPAN(das_sync_rpc_process, "das task sync rpc process")
|
||||||
FLT_DEF_SPAN(rescan_das_task, "rescan das task")
|
|
||||||
FLT_DEF_SPAN(close_das_task, "close das task")
|
FLT_DEF_SPAN(close_das_task, "close das task")
|
||||||
FLT_DEF_SPAN(fetch_das_extra_result, "fetch das extra result")
|
FLT_DEF_SPAN(fetch_das_extra_result, "fetch das extra result")
|
||||||
FLT_DEF_SPAN(fetch_das_result_process, "fetch das result process")
|
FLT_DEF_SPAN(fetch_das_result_process, "fetch das result process")
|
||||||
@ -131,6 +129,9 @@ FLT_DEF_SPAN(com_query_process, "com_query process")
|
|||||||
#endif // __HIGH_LEVEL_SPAN
|
#endif // __HIGH_LEVEL_SPAN
|
||||||
|
|
||||||
#ifdef __MIDDLE_LEVEL_SPAN
|
#ifdef __MIDDLE_LEVEL_SPAN
|
||||||
|
// for das
|
||||||
|
FLT_DEF_SPAN(get_das_id, "fetch das task id")
|
||||||
|
FLT_DEF_SPAN(rescan_das_task, "rescan das task")
|
||||||
#endif // __MIDDLE_LEVEL_SPAN
|
#endif // __MIDDLE_LEVEL_SPAN
|
||||||
|
|
||||||
#ifdef __LOW_LEVEL_SPAN
|
#ifdef __LOW_LEVEL_SPAN
|
||||||
|
|||||||
@ -72,7 +72,7 @@ void ObLogTestThread::run1()
|
|||||||
_OB_LOG(WARN, "oblog test %ld", i);
|
_OB_LOG(WARN, "oblog test %ld", i);
|
||||||
OB_LOG(ERROR, "trace error log also would print lbt");
|
OB_LOG(ERROR, "trace error log also would print lbt");
|
||||||
}
|
}
|
||||||
PRINT_OB_LOG_TRACE_BUF(OBTRACE, INFO);
|
PRINT_OB_LOG_TRACE_BUF(FLT, INFO);
|
||||||
CANCLE_OB_LOG_TRACE_MODE();
|
CANCLE_OB_LOG_TRACE_MODE();
|
||||||
int64_t e_time = ::oceanbase::common::ObTimeUtility::current_time();
|
int64_t e_time = ::oceanbase::common::ObTimeUtility::current_time();
|
||||||
OB_LOG(WARN, "yangze one thread time","u_time", e_time - b_time);
|
OB_LOG(WARN, "yangze one thread time","u_time", e_time - b_time);
|
||||||
|
|||||||
@ -265,7 +265,9 @@ namespace sql
|
|||||||
LOG_WARN("failed to deserialize full link trace extra info",
|
LOG_WARN("failed to deserialize full link trace extra info",
|
||||||
KP(buf), K(ret), K(pos), K(v_len));
|
KP(buf), K(ret), K(pos), K(v_len));
|
||||||
} else {
|
} else {
|
||||||
_OBTRACE_LOG(INFO, "%s", drv_span.span_info_.ptr());
|
PRINT_WITH_TRACE_MODE(FLT, INFO, [&] {
|
||||||
|
_FLT_LOG(INFO, "%s", drv_span.span_info_.ptr());
|
||||||
|
}());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user