modify error code for buf_not_enough before deep copy ddl_kvs in tablet deserialization.

This commit is contained in:
gaishun
2024-02-06 04:47:14 +00:00
committed by ob-robot
parent 27d303cd3d
commit 7203787e74
2 changed files with 15 additions and 3 deletions

View File

@ -588,7 +588,7 @@ int ObTenantStorageCheckpointWriter::batch_compare_and_swap_tablet(const bool is
bool ObTenantStorageCheckpointWriter::ignore_ret(int ret)
{
return OB_ALLOCATE_MEMORY_FAILED == ret || OB_DISK_HUNG == ret || OB_TIMEOUT == ret;
return OB_ALLOCATE_MEMORY_FAILED == ret || OB_DISK_HUNG == ret || OB_TIMEOUT == ret || OB_BUF_NOT_ENOUGH == ret;
}
int ObTenantStorageCheckpointWriter::rollback()
@ -641,6 +641,7 @@ int ObTenantStorageCheckpointWriter::get_tablet_with_addr(
int64_t buf_len;
char *buf = nullptr;
read_info.addr_ = addr_info.new_addr_;
ObTabletPoolType tablet_pool_type = addr_info.tablet_pool_type_;
// only need load first-level meta
if (addr_info.new_addr_.is_raw_block()) {
if (addr_info.new_addr_.size() > ObTabletCommon::MAX_TABLET_FIRST_LEVEL_META_SIZE) {
@ -653,7 +654,7 @@ int ObTenantStorageCheckpointWriter::get_tablet_with_addr(
ObSharedBlockReadHandle block_handle(allocator);
int64_t pos = 0;
if (OB_FAIL(MTL(ObTenantMetaMemMgr*)->acquire_tablet_from_pool(
addr_info.tablet_pool_type_,
tablet_pool_type,
WashTabletPriority::WTP_LOW,
addr_info.tablet_key_,
tablet_handle))) {
@ -671,6 +672,17 @@ int ObTenantStorageCheckpointWriter::get_tablet_with_addr(
} else if (OB_FAIL(tablet_handle.get_obj()->deserialize(buf, buf_len, pos))) {
LOG_WARN("fail to deserialize tiny tablet", K(ret), K(block_handle), K(addr_info), K(pos));
}
if (OB_FAIL(ret)) {
if ((OB_BUF_NOT_ENOUGH == ret) && (ObTabletPoolType::TP_NORMAL == tablet_pool_type)) {
tablet_pool_type = ObTabletPoolType::TP_LARGE;
} else if ((OB_BUF_NOT_ENOUGH == ret) && (ObTabletPoolType::TP_NORMAL != tablet_pool_type)) {
ret = OB_ERR_UNEXPECTED;
} else {
// do nothing
}
}
} while (ignore_ret(ret));
return ret;

View File

@ -1986,7 +1986,7 @@ int ObTablet::deserialize(
if (OB_NOT_NULL(ddl_kvs_addr)) {
const int64_t ddl_kv_size = sizeof(ObDDLKV *) * DDL_KV_ARRAY_SIZE;
if (remain < ddl_kv_size) {
ret = OB_ERR_UNEXPECTED;
ret = OB_BUF_NOT_ENOUGH;
LOG_WARN("fail to deep copy ddl kv to tablet", K(ret), K(remain), K(ddl_kv_size), K(ddl_kv_count));
} else {
ddl_kv_count_ = ddl_kv_count;