fix invalid storage schema version

This commit is contained in:
z404289981
2023-11-02 12:40:33 +00:00
committed by ob-robot
parent 1969e85404
commit 7d9bb52744

View File

@ -465,7 +465,7 @@ int ObStorageSchema::init(
column_group_array_.set_allocator(&allocator);
skip_idx_attr_array_.set_allocator(&allocator);
storage_schema_version_ = STORAGE_SCHEMA_VERSION_V3;
storage_schema_version_ = old_schema.storage_schema_version_;
copy_from(old_schema);
compat_mode_ = old_schema.compat_mode_;
compressor_type_ = old_schema.compressor_type_;
@ -805,13 +805,16 @@ int ObStorageSchema::deserialize(
store_column_cnt_ = get_store_column_count_by_column_array();
}
ObStorageColumnGroupSchema column_group;
uint64_t compat_version = 0;
if (FAILEDx(generate_all_column_group_schema(column_group, row_store_type_))) {
STORAGE_LOG(WARN, "Failed to mock column group for compat", K(ret));
} else if (OB_FAIL(column_group_array_.reserve(1))) {
STORAGE_LOG(WARN, "failed to reserve for column group array", K(ret));
} else if (OB_FAIL(add_column_group(column_group))) {
STORAGE_LOG(WARN, "failed to add column group", K(ret), K(column_group));
} else {
} else if (OB_FAIL(GET_MIN_DATA_VERSION(MTL_ID(), compat_version))) {
STORAGE_LOG(WARN, "failed to add column group", K(ret), K(MTL_ID()));
} else if (compat_version >= DATA_VERSION_4_3_0_0) {
storage_schema_version_ = STORAGE_SCHEMA_VERSION_V3;
}
} else if (OB_FAIL(serialization::decode_i64(buf, data_len, pos, &store_column_cnt_))) {