[FIX] deserialize undo action core

This commit is contained in:
ZenoWang 2023-02-21 02:42:02 +00:00 committed by ob-robot
parent 115cb6cece
commit 1b36e30d96

View File

@ -112,12 +112,12 @@ int ObUndoStatusList::deserialize_(const char *buf,
LST_DO_CODE(OB_UNIS_DECODE, action);
// allcate new undo status node if needed
if (OB_ISNULL(cur_node) || cur_node->size_ >= TX_DATA_UNDO_ACT_MAX_NUM_PER_NODE) {
void *buf = nullptr;
if (OB_ISNULL(buf = slice_allocator.alloc())) {
void *undo_node_buf = nullptr;
if (OB_ISNULL(undo_node_buf = slice_allocator.alloc())) {
ret = OB_ALLOCATE_MEMORY_FAILED;
STORAGE_LOG(WARN, "allocate memory when deserialize ObTxData failed.", KR(ret));
} else {
cur_node = new (buf) ObUndoStatusNode;
cur_node = new (undo_node_buf) ObUndoStatusNode;
// update undo status list link after allocated new node
ObUndoStatusNode *tmp_node = head_;
@ -126,7 +126,14 @@ int ObUndoStatusList::deserialize_(const char *buf,
}
}
cur_node->undo_actions_[cur_node->size_++] = action;
if (OB_SUCC(ret)) {
if (OB_NOT_NULL(cur_node)) {
cur_node->undo_actions_[cur_node->size_++] = action;
} else {
ret = OB_ERR_UNEXPECTED;
STORAGE_LOG(ERROR, "unexpected nullptr when deserialize undo status list", KR(ret), KP(buf), K(pos), K(data_len));
}
}
}
return ret;