ARM compatibility not properly implemented leading to core issues
This commit is contained in:
@ -411,10 +411,6 @@ int ObMicroBlockHandleMgr::get_micro_block_handle(
|
||||
ObPointerSwizzleNode *ps_node = index_block_info.ps_node_;
|
||||
micro_block_handle.reset();
|
||||
ObIMicroBlockCache *cache = is_data_block ? data_block_cache_ : index_block_cache_;
|
||||
bool is_effective = true;
|
||||
#if defined(__aarch64__)
|
||||
is_effective = false;
|
||||
#endif
|
||||
|
||||
if (IS_NOT_INIT) {
|
||||
ret = OB_NOT_INIT;
|
||||
@ -425,7 +421,7 @@ int ObMicroBlockHandleMgr::get_micro_block_handle(
|
||||
} else if (OB_FAIL(idx_header->fill_micro_des_meta(true /* deep_copy_key */, micro_block_handle.des_meta_))) {
|
||||
LOG_WARN("Fail to fill micro block deserialize meta", K(ret));
|
||||
} else if (FALSE_IT(micro_block_handle.init(tenant_id, macro_id, offset, size, this))) {
|
||||
} else if (OB_LIKELY(nullptr != ps_node) && is_effective
|
||||
} else if (OB_LIKELY(nullptr != ps_node)
|
||||
&& OB_SUCC(ps_node->access_mem_ptr(micro_block_handle.cache_handle_))) {
|
||||
// get data / index block cache with direct memory pointer
|
||||
micro_block_handle.block_state_ = ObSSTableMicroBlockState::IN_BLOCK_CACHE;
|
||||
@ -450,7 +446,7 @@ int ObMicroBlockHandleMgr::get_micro_block_handle(
|
||||
micro_block_handle.block_state_ = ObSSTableMicroBlockState::IN_BLOCK_CACHE;
|
||||
cache_mem_ctrl_.add_hold_size(micro_block_handle.get_handle_size());
|
||||
cache->cache_hit(table_store_stat_->block_cache_hit_cnt_);
|
||||
if (nullptr == ps_node || !is_effective) {
|
||||
if (nullptr == ps_node) {
|
||||
} else if (OB_FAIL(ps_node->swizzle(micro_block_handle.cache_handle_))) {
|
||||
LOG_WARN("Fail to swizzle", K(is_data_block), K(tenant_id), K(macro_id), K(offset), K(size), K(cur_level),
|
||||
K(micro_block_handle), KP(ps_node), KPC(ps_node));
|
||||
|
@ -68,12 +68,14 @@ int ObIndexBlockDataHeader::deep_copy_transformed_index_block(
|
||||
K(header), K(buf_size), K(pos));
|
||||
} else {
|
||||
char *data_buf = buf + pos;
|
||||
ObRowkeyVector *rowkey_vector = new (buf + pos) ObRowkeyVector();
|
||||
pos += sizeof(ObRowkeyVector);
|
||||
ObStorageDatum *index_datum_array = new (buf + pos) ObStorageDatum [header.row_cnt_];
|
||||
pos += sizeof(ObStorageDatum) * header.row_cnt_;
|
||||
const int64_t align_inc = common::upper_align(reinterpret_cast<uint64_t>(buf + pos), ObMicroBlockData::ALIGN_SIZE) - reinterpret_cast<uint64_t>(buf + pos);
|
||||
pos += align_inc;
|
||||
common::ObPointerSwizzleNode *ps_node_arr = new (buf + pos) common::ObPointerSwizzleNode[header.row_cnt_];
|
||||
pos += sizeof(common::ObPointerSwizzleNode) * header.row_cnt_;
|
||||
ObRowkeyVector *rowkey_vector = new (buf + pos) ObRowkeyVector();
|
||||
pos += sizeof(ObRowkeyVector);
|
||||
if (OB_FAIL(rowkey_vector->deep_copy(buf, pos, buf_size, *header.rowkey_vector_))) {
|
||||
LOG_WARN("Failed to deep copy rowkey vector", K(ret));
|
||||
} else {
|
||||
@ -85,6 +87,7 @@ int ObIndexBlockDataHeader::deep_copy_transformed_index_block(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
pos += ObMicroBlockData::ALIGN_REDUNDANCY_SIZE - align_inc;
|
||||
rowkey_vector_ = rowkey_vector;
|
||||
index_datum_array_ = index_datum_array;
|
||||
row_cnt_ = header.row_cnt_;
|
||||
@ -152,6 +155,10 @@ int ObIndexBlockDataTransformer::transform(
|
||||
pos += sizeof(ObIndexBlockDataHeader);
|
||||
ObStorageDatum *index_datum_array = new (block_buf + pos) ObStorageDatum [row_cnt];
|
||||
pos += sizeof(ObStorageDatum) * row_cnt;
|
||||
// The ps_node_arr undergoes atomic operations during usage and thus requires alignment to
|
||||
// ObMicroBlockData::ALIGN_SIZE bytes on ARM architecture for proper functioning.
|
||||
const int64_t align_inc = common::upper_align(reinterpret_cast<uint64_t>(block_buf + pos), ObMicroBlockData::ALIGN_SIZE) - reinterpret_cast<uint64_t>(block_buf + pos);
|
||||
pos += align_inc;
|
||||
common::ObPointerSwizzleNode *ps_node_arr = new (block_buf + pos) common::ObPointerSwizzleNode[row_cnt];
|
||||
pos += sizeof(common::ObPointerSwizzleNode) * row_cnt;
|
||||
ObRowkeyVector *rowkey_vector = nullptr;
|
||||
@ -194,10 +201,12 @@ int ObIndexBlockDataTransformer::transform(
|
||||
idx_header->rowkey_vector_ = rowkey_vector;
|
||||
idx_header->index_datum_array_ = index_datum_array;
|
||||
idx_header->ps_node_array_ = ps_node_arr;
|
||||
idx_header->data_buf_size_ = pos - micro_header_size;
|
||||
idx_header->data_buf_ = block_buf + micro_header_size;
|
||||
// Ensure that extra_buf can at most accommodate ObMicroBlockData::ALIGN_REDUNDANCY_SIZE additional bytes for redundancy.
|
||||
idx_header->data_buf_size_ = pos + (ObMicroBlockData::ALIGN_REDUNDANCY_SIZE - align_inc) - micro_header_size;
|
||||
transformed_data.buf_ = block_buf;
|
||||
transformed_data.size_ = micro_header_size;
|
||||
transformed_data.extra_buf_ = block_buf + micro_header_size;
|
||||
transformed_data.extra_buf_ = idx_header->data_buf_;
|
||||
transformed_data.extra_size_ = idx_header->data_buf_size_;
|
||||
transformed_data.type_ = ObMicroBlockData::INDEX_BLOCK;
|
||||
allocated_buf = block_buf;
|
||||
@ -303,6 +312,7 @@ int ObIndexBlockDataTransformer::get_transformed_upper_mem_size(
|
||||
} else {
|
||||
mem_limit += rowkey_vector_size;
|
||||
mem_limit += micro_header->original_length_;
|
||||
mem_limit += ObMicroBlockData::ALIGN_REDUNDANCY_SIZE;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -75,7 +75,7 @@ struct ObIndexBlockDataHeader
|
||||
K_(row_cnt), K_(col_cnt),
|
||||
KPC_(rowkey_vector),
|
||||
KP_(index_datum_array),
|
||||
KP_(ps_node_array), K_(data_buf_size)
|
||||
KP_(ps_node_array), KP_(data_buf), K_(data_buf_size)
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -462,7 +462,7 @@ int ObRootBlockInfo::deep_copy(
|
||||
const int64_t variable_size = get_variable_size();
|
||||
if (OB_ISNULL(buf) || OB_UNLIKELY(buf_len < variable_size + pos)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid argument", K(ret), KP(buf), K(buf_len), K(variable_size), K(pos));
|
||||
LOG_WARN("invalid argument", K(ret), KP(buf), K(buf_len), K(variable_size), K(pos), K(block_data_));
|
||||
} else if (ObMicroBlockData::DDL_BLOCK_TREE == block_data_.type_) {
|
||||
dest.block_data_ = block_data_;
|
||||
dest.addr_ = addr_;
|
||||
|
@ -162,6 +162,9 @@ public:
|
||||
const char *extra_buf_;
|
||||
int64_t extra_size_;
|
||||
Type type_;
|
||||
|
||||
static const uint64_t ALIGN_SIZE = 8;
|
||||
static const int64_t ALIGN_REDUNDANCY_SIZE = ALIGN_SIZE - 1;
|
||||
};
|
||||
|
||||
class ObMicroBlock
|
||||
|
Reference in New Issue
Block a user