From d25cc8fb9bcd35875d8ff0be5ed4e0b7b0149c46 Mon Sep 17 00:00:00 2001 From: ZenoWang Date: Thu, 8 Feb 2024 10:25:59 +0000 Subject: [PATCH] [CP] [FIX] make serialize failed when push_back failed --- src/storage/tx/ob_tx_data_define.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/storage/tx/ob_tx_data_define.cpp b/src/storage/tx/ob_tx_data_define.cpp index afe14bda9a..a342edd8a4 100644 --- a/src/storage/tx/ob_tx_data_define.cpp +++ b/src/storage/tx/ob_tx_data_define.cpp @@ -46,13 +46,16 @@ int ObUndoStatusList::serialize(char *buf, const int64_t buf_len, int64_t &pos) int ObUndoStatusList::serialize_(char *buf, const int64_t buf_len, int64_t &pos) const { int ret = OB_SUCCESS; - ObArray node_arr; - node_arr.reset(); + ObSEArray node_arr; + node_arr.reuse(); ObUndoStatusNode *node = head_; // generate undo status node stack while (OB_NOT_NULL(node)) { - node_arr.push_back(node); - node = node->next_; + if (OB_FAIL(node_arr.push_back(node))) { + STORAGE_LOG(WARN, "push back undo status node failed", KR(ret), K(node_arr.count())); + } else { + node = node->next_; + } } LST_DO_CODE(OB_UNIS_ENCODE, undo_node_cnt_);