Fix oceanbase::storage::ObCopyMacroRangeInfo core

This commit is contained in:
godyangfight
2023-05-16 04:46:48 +00:00
committed by ob-robot
parent cdcf35d941
commit 6e5169c713
7 changed files with 17 additions and 8 deletions

View File

@ -248,6 +248,9 @@ const int64_t OB_MAX_NODEGROUP_LENGTH = 12;
//change from 128 to 64, according to production definition document
const int64_t OB_MAX_RESERVED_POINT_TYPE_LENGTH = 32;
const int64_t OB_MAX_RESERVED_POINT_NAME_LENGTH = 128;
const int64_t OB_MAX_EXTRA_ROWKEY_COLUMN_NUMBER = 2; //storage extra rowkey column number, it contains trans version column and sql sequence column
const int64_t OB_INNER_MAX_ROWKEY_COLUMN_NUMBER = OB_MAX_ROWKEY_COLUMN_NUMBER + OB_MAX_EXTRA_ROWKEY_COLUMN_NUMBER;
//for recybin
const int64_t OB_MAX_OBJECT_NAME_LENGTH = 128; //should include index_name

View File

@ -264,11 +264,11 @@ int ObAllVirtualTabletSSTableMacroInfo::get_macro_info(
ObStoreRowkey &end_key = info.store_range_.get_end_key();
if (start_key != ObStoreRowkey::MIN_STORE_ROWKEY
&& OB_FAIL(start_key.assign(start_key.get_obj_ptr(),
start_key.get_obj_cnt() - ObMultiVersionRowkeyHelpper::MAX_EXTRA_ROWKEY_CNT))) {
start_key.get_obj_cnt() - OB_MAX_EXTRA_ROWKEY_COLUMN_NUMBER))) {
SERVER_LOG(WARN, "fail to set start key", K(ret), K(start_key));
} else if (end_key != ObStoreRowkey::MAX_STORE_ROWKEY
&& OB_FAIL(end_key.assign(end_key.get_obj_ptr(),
end_key.get_obj_cnt() - ObMultiVersionRowkeyHelpper::MAX_EXTRA_ROWKEY_CNT))) {
end_key.get_obj_cnt() - OB_MAX_EXTRA_ROWKEY_COLUMN_NUMBER))) {
SERVER_LOG(WARN, "fail to set end key", K(ret), K(end_key));
}
}

View File

@ -144,6 +144,10 @@ OB_DEF_DESERIALIZE(ObDatumRowkey)
STORAGE_LOG(WARN, "datum row key is not init", K(ret), KP(datums_));
} else {
OB_UNIS_DECODE(datum_cnt_);
if (datum_cnt_ > OB_INNER_MAX_ROWKEY_COLUMN_NUMBER) {
ret = OB_ERR_UNEXPECTED;
STORAGE_LOG(ERROR, "table store inner max rowkey column number exceed the limit, too large", K(ret), K(datum_cnt_));
}
OB_UNIS_DECODE_ARRAY(datums_, datum_cnt_);
hash_ = 0;
group_idx_ = 0;

View File

@ -209,7 +209,7 @@ private:
private:
static const int64_t OB_INDEX_BLOCK_MAX_COL_CNT =
common::OB_MAX_ROWKEY_COLUMN_NUMBER+ ObMultiVersionRowkeyHelpper::MAX_EXTRA_ROWKEY_CNT + 1;
common::OB_MAX_ROWKEY_COLUMN_NUMBER + OB_MAX_EXTRA_ROWKEY_COLUMN_NUMBER + 1;
ObIndexBlockTreePath cursor_path_;
ObIndexMicroBlockCache *index_block_cache_;
ObIMicroBlockReader *reader_;

View File

@ -653,7 +653,7 @@ ObCopyMacroRangeInfo::ObCopyMacroRangeInfo()
end_macro_block_id_(),
macro_block_count_(0),
is_leader_restore_(false),
start_macro_block_end_key_(datums_, OB_MAX_ROWKEY_COLUMN_NUMBER),
start_macro_block_end_key_(datums_, OB_INNER_MAX_ROWKEY_COLUMN_NUMBER),
allocator_("CopyMacroRange")
{
}
@ -679,7 +679,7 @@ void ObCopyMacroRangeInfo::reuse()
macro_block_count_ = 0;
is_leader_restore_ = false;
start_macro_block_end_key_.datums_ = datums_;
start_macro_block_end_key_.datum_cnt_ = OB_MAX_ROWKEY_COLUMN_NUMBER;
start_macro_block_end_key_.datum_cnt_ = OB_INNER_MAX_ROWKEY_COLUMN_NUMBER;
start_macro_block_end_key_.reuse();
allocator_.reuse();
}

View File

@ -13,6 +13,7 @@
#ifndef OCEABASE_STORAGE_HA_STRUCT_
#define OCEABASE_STORAGE_HA_STRUCT_
#include "lib/ob_define.h"
#include "share/ob_ls_id.h"
#include "common/ob_member.h"
#include "common/ob_tablet_id.h"
@ -22,6 +23,7 @@
#include "storage/blocksstable/ob_datum_rowkey.h"
#include "storage/blocksstable/ob_logic_macro_id.h"
namespace oceanbase
{
namespace storage
@ -258,14 +260,15 @@ public:
TO_STRING_KV(K_(start_macro_block_id), K_(end_macro_block_id),
K_(macro_block_count), K_(start_macro_block_end_key), K_(is_leader_restore));
public:
blocksstable::ObLogicMacroBlockId start_macro_block_id_;
blocksstable::ObLogicMacroBlockId end_macro_block_id_;
int64_t macro_block_count_;
bool is_leader_restore_;
blocksstable::ObStorageDatum datums_[OB_MAX_ROWKEY_COLUMN_NUMBER];
blocksstable::ObStorageDatum datums_[OB_INNER_MAX_ROWKEY_COLUMN_NUMBER];
blocksstable::ObDatumRowkey start_macro_block_end_key_;
ObArenaAllocator allocator_;
DISALLOW_COPY_AND_ASSIGN(ObCopyMacroRangeInfo);
};

View File

@ -164,7 +164,6 @@ public:
MVRC_VERSION_AFTER_3_0 = 2, // TransVersion | SqlSequence[A]:Use After Version3.0
MVRC_VERSION_MAX = 3,
};
static const int64_t MAX_EXTRA_ROWKEY_CNT = 2;
static int64_t get_trans_version_col_store_index(
const int64_t schema_rowkey_col_cnt,
const bool is_multi_version)