[CP] fix show trace not show in standby database
This commit is contained in:
@ -84,7 +84,6 @@ int ObVirtualShowTrace::retrive_all_span_info()
|
|||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
ObMySQLTransaction trans;
|
ObMySQLTransaction trans;
|
||||||
bool with_snap_shot = true;
|
|
||||||
ObMySQLProxy *mysql_proxy = GCTX.sql_proxy_;
|
ObMySQLProxy *mysql_proxy = GCTX.sql_proxy_;
|
||||||
ObString trace_id;
|
ObString trace_id;
|
||||||
if (OB_ISNULL(mysql_proxy)) {
|
if (OB_ISNULL(mysql_proxy)) {
|
||||||
@ -93,8 +92,6 @@ int ObVirtualShowTrace::retrive_all_span_info()
|
|||||||
} else if (OB_ISNULL(session_)) {
|
} else if (OB_ISNULL(session_)) {
|
||||||
ret = OB_NOT_INIT;
|
ret = OB_NOT_INIT;
|
||||||
SERVER_LOG(WARN, "session is null", K(ret));
|
SERVER_LOG(WARN, "session is null", K(ret));
|
||||||
} else if (OB_FAIL(trans.start(mysql_proxy, effective_tenant_id_, with_snap_shot))) {
|
|
||||||
SERVER_LOG(WARN, "failed to start transaction", K(ret), K(effective_tenant_id_));
|
|
||||||
} else {
|
} else {
|
||||||
int sql_len = 0;
|
int sql_len = 0;
|
||||||
is_row_format_ = session_->is_row_traceformat();
|
is_row_format_ = session_->is_row_traceformat();
|
||||||
@ -123,7 +120,7 @@ int ObVirtualShowTrace::retrive_all_span_info()
|
|||||||
{ // make sure %res destructed before execute other sql in the same transaction
|
{ // make sure %res destructed before execute other sql in the same transaction
|
||||||
SMART_VAR(ObMySQLProxy::MySQLResult, res) {
|
SMART_VAR(ObMySQLProxy::MySQLResult, res) {
|
||||||
common::sqlclient::ObMySQLResult *result = NULL;
|
common::sqlclient::ObMySQLResult *result = NULL;
|
||||||
ObISQLClient *sql_client = &trans;
|
ObISQLClient *sql_client = mysql_proxy;
|
||||||
uint64_t table_id = OB_ALL_VIRTUAL_TRACE_SPAN_INFO_TID;
|
uint64_t table_id = OB_ALL_VIRTUAL_TRACE_SPAN_INFO_TID;
|
||||||
ObSQLClientRetryWeak sql_client_retry_weak(sql_client,
|
ObSQLClientRetryWeak sql_client_retry_weak(sql_client,
|
||||||
exec_tenant_id,
|
exec_tenant_id,
|
||||||
|
|||||||
@ -243,6 +243,11 @@ void PxWorkerFunctor::operator ()(bool need_exec)
|
|||||||
LOG_WARN("already interrupted");
|
LOG_WARN("already interrupted");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OB_ISNULL(sqc_handler)) {
|
||||||
|
// do nothing
|
||||||
|
} else if (sqc_handler->get_flt_ctx().trace_id_.is_inited()) {
|
||||||
|
OBTRACE->reset();
|
||||||
|
}
|
||||||
PxWorkerFinishFunctor on_func_finish;
|
PxWorkerFinishFunctor on_func_finish;
|
||||||
on_func_finish();
|
on_func_finish();
|
||||||
ObCurTraceId::reset();
|
ObCurTraceId::reset();
|
||||||
@ -343,9 +348,25 @@ int ObPxThreadWorker::exit()
|
|||||||
|
|
||||||
int ObPxLocalWorker::run(ObPxRpcInitTaskArgs &task_arg)
|
int ObPxLocalWorker::run(ObPxRpcInitTaskArgs &task_arg)
|
||||||
{
|
{
|
||||||
FLTSpanGuard(px_task);
|
int ret = OB_SUCCESS;
|
||||||
ObPxTaskProcess task_proc(gctx_, task_arg);
|
ObPxSqcHandler *h = task_arg.get_sqc_handler();
|
||||||
return task_proc.process();
|
|
||||||
|
if (OB_ISNULL(h)) {
|
||||||
|
} else if (h->get_flt_ctx().trace_id_.is_inited()) {
|
||||||
|
OBTRACE->init(h->get_flt_ctx());
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
FLTSpanGuard(px_task);
|
||||||
|
ObPxTaskProcess task_proc(gctx_, task_arg);
|
||||||
|
ret = task_proc.process();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OB_ISNULL(h)) {
|
||||||
|
} else if (h->get_flt_ctx().trace_id_.is_inited()) {
|
||||||
|
OBTRACE->reset();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user