提交 89b27014 编写于 作者: J JiahuaChen 提交者: LINGuanRen

Fix ob_admin parse partition macro meta slog fail

上级 188224d7
...@@ -451,14 +451,23 @@ int ObPartitionMetaRedoModule::parse(const int64_t subcmd, const char* buf, cons ...@@ -451,14 +451,23 @@ int ObPartitionMetaRedoModule::parse(const int64_t subcmd, const char* buf, cons
ObPGKey pgkey; ObPGKey pgkey;
ObITable::TableKey table_key; ObITable::TableKey table_key;
blocksstable::ObMacroBlockMetaV2 meta; blocksstable::ObMacroBlockMetaV2 meta;
common::ObObj *endkey = static_cast<common::ObObj *>(ob_malloc(sizeof(ObObj) * common::OB_MAX_COLUMN_NUMBER));
MacroBlockId macro_block_id; MacroBlockId macro_block_id;
ObPGMacroBlockMetaLogEntry entry(pgkey, table_key, 0, 0, macro_block_id, meta); ObPGMacroBlockMetaLogEntry entry(pgkey, table_key, 0, 0, macro_block_id, meta);
if (OB_FAIL(entry.deserialize(buf, len, pos))) { if (OB_UNLIKELY(nullptr == endkey)) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("alloc memory fail", K(ret));
} else if (FALSE_IT(meta.endkey_ = endkey)) {
} else if (OB_FAIL(entry.deserialize(buf, len, pos))) {
LOG_WARN("Fail to deserialize ObPGMacroBlockMetaLogEntry", K(ret)); LOG_WARN("Fail to deserialize ObPGMacroBlockMetaLogEntry", K(ret));
} else if (0 > fprintf(stream, "ObPGMacroBlockMetaLogEntry\n%s\n", to_cstring(entry))) { } else if (0 > fprintf(stream, "ObPGMacroBlockMetaLogEntry\n%s\n", to_cstring(entry))) {
ret = OB_IO_ERROR; ret = OB_IO_ERROR;
LOG_WARN("failed to print ObPGMacroBlockMetaLogEntry", K(ret), K(entry)); LOG_WARN("failed to print ObPGMacroBlockMetaLogEntry", K(ret), K(entry));
} }
if (nullptr != endkey) {
ob_free(endkey);
}
break; break;
} }
case REDO_LOG_UPDATE_TENANT_FILE_INFO: { case REDO_LOG_UPDATE_TENANT_FILE_INFO: {
......
...@@ -34,7 +34,7 @@ int main(int argc, char *argv[]) ...@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
{ {
int ret = 0; int ret = 0;
OB_LOGGER.set_log_level("INFO"); OB_LOGGER.set_log_level("INFO");
OB_LOGGER.set_file_name("ob_admin.log", true, false); OB_LOGGER.set_file_name("ob_admin.log", true, false, "ob_admin_rs.log");
const char *log_level = getenv("OB_ADMIN_LOG_LEVEL"); const char *log_level = getenv("OB_ADMIN_LOG_LEVEL");
if (NULL != log_level) { if (NULL != log_level) {
OB_LOGGER.set_log_level(log_level); OB_LOGGER.set_log_level(log_level);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册