cherry-pick record log

This commit is contained in:
obdev
2022-05-25 20:50:33 +08:00
committed by wangzelin.wzl
parent d22cee91c3
commit 3025edd154
14 changed files with 396 additions and 77 deletions

View File

@ -815,7 +815,23 @@ int ObLogEntryParserImpl::dump_trans_redo_log(const char* data, int64_t len, con
return ret;
}
int ObLogEntryParserImpl::dump_trans_prepare_log(const char* data, int64_t len)
int ObLogEntryParserImpl::dump_trans_record_log(const char *data, int64_t len)
{
int ret = OB_SUCCESS;
ObTransRecordLogHelper helper;
ObTransRecordLog log(helper);
int64_t pos = 0;
if (OB_FAIL(log.deserialize(data, len, pos))) {
CLOG_LOG(WARN, "failed to deserialize log", K(ret));
} else {
fprintf(stdout, " %s|||", to_cstring(log));
}
return ret;
}
int ObLogEntryParserImpl::dump_trans_prepare_log(const char *data, int64_t len)
{
int ret = OB_SUCCESS;
ObTransPrepareLogHelper helper;
@ -2201,6 +2217,12 @@ int ObLogEntryParserImpl::dump_trans_log(const ObStorageLogType log_type, const
}
break;
}
case OB_LOG_TRANS_RECORD : {
if (OB_FAIL(dump_trans_record_log(buf + pos, buf_len - pos))) {
CLOG_LOG(ERROR, "dump_trans_record_log fail", K(ret), K(buf), K(pos), K(buf_len));
}
break;
}
case OB_LOG_TRANS_PREPARE: {
if (OB_FAIL(dump_trans_prepare_log(buf + pos, buf_len - pos))) {
CLOG_LOG(ERROR, "dump_trans_prepare_log fail", K(ret), K(buf), K(pos), K(buf_len));