Revert “fix show trace cannot find root span while adaptting upstream”

This commit is contained in:
obdev
2023-03-03 07:11:13 +00:00
committed by ob-robot
parent 158dedccd8
commit e84f946374

View File

@ -133,6 +133,7 @@ namespace sql
session.set_auto_flush_trace(false);
session.set_trace_enable(false);
}
OZ(ObFLTUtils::init_flt_show_trace_env(session));
return ret;
}
@ -411,13 +412,7 @@ namespace sql
sid.deserialize(span_id.ptr(), span_id.length(), pos);
OBTRACE->init(tid, sid);
FLT_SET_TRACE_LEVEL(sess.get_control_info().level_);
if (sess.is_use_trace_log()) {
sess.set_auto_flush_trace(true);
}
FLT_SET_AUTO_FLUSH(sess.is_auto_flush_trace());
char last_trace_id[OB_MAX_UUID_STR_LENGTH + 1];
pos = 0;
sid.tostring(last_trace_id, OB_MAX_UUID_STR_LENGTH + 1, pos);
}
// update trace_id by server self
} else {
@ -434,9 +429,6 @@ namespace sql
}
}
FLT_SET_TRACE_LEVEL(sess.get_control_info().level_);
if (sess.is_use_trace_log()) {
sess.set_auto_flush_trace(true);
}
FLT_SET_AUTO_FLUSH(sess.is_auto_flush_trace());
}
@ -575,22 +567,14 @@ namespace sql
// record span
if (OB_FAIL(ret)) {
// do nothing
} else {
while (true) {
if (OB_FAIL(flt_span_manager->record_span(data))) {
if (OB_SIZE_OVERFLOW == ret || OB_ALLOCATE_MEMORY_FAILED == ret) {
LOG_TRACE("cannot allocate mem for record", K(ret));
ret = OB_SUCCESS;
} else {
if (REACH_TIME_INTERVAL(100 * 1000)) { // in case logging is too frequent
LOG_WARN("failed to record request info in request manager", K(ret));
}
}
} else if (OB_FAIL(flt_span_manager->record_span(data))) {
if (OB_SIZE_OVERFLOW == ret || OB_ALLOCATE_MEMORY_FAILED == ret) {
LOG_TRACE("cannot allocate mem for record", K(ret));
ret = OB_SUCCESS;
} else {
if (REACH_TIME_INTERVAL(100 * 1000)) { // in case logging is too frequent
LOG_WARN("failed to record request info in request manager", K(ret));
}
// If the slot is full, a certain amount of
// internal space will be released,
// and it needs to be added again
if (ret != OB_ENTRY_NOT_EXIST) break;
}
}
}