From 38f55496aa7bd231dc8738b2062c78b3170f5bef Mon Sep 17 00:00:00 2001 From: saltonz Date: Tue, 14 Feb 2023 14:42:35 +0000 Subject: [PATCH] [bugfix] Fix latest_row_store_type for migrate after upgrade from version 4.0 to version 4.1 --- src/storage/tablet/ob_tablet_create_delete_helper.cpp | 5 +++-- src/storage/tablet/ob_tablet_create_sstable_param.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/storage/tablet/ob_tablet_create_delete_helper.cpp b/src/storage/tablet/ob_tablet_create_delete_helper.cpp index 5e84f3e949..9a0c9b81df 100644 --- a/src/storage/tablet/ob_tablet_create_delete_helper.cpp +++ b/src/storage/tablet/ob_tablet_create_delete_helper.cpp @@ -2338,8 +2338,9 @@ int ObTabletCreateDeleteHelper::build_create_sstable_param( + ObMultiVersionRowkeyHelpper::get_extra_rowkey_col_cnt(); param.root_block_addr_.set_none_addr(); param.data_block_macro_meta_addr_.set_none_addr(); - param.root_row_store_type_ = ObRowStoreType::FLAT_ROW_STORE; - param.latest_row_store_type_ = ObRowStoreType::FLAT_ROW_STORE; + param.root_row_store_type_ = (ObRowStoreType::ENCODING_ROW_STORE == table_schema.get_row_store_type() + ? ObRowStoreType::SELECTIVE_ENCODING_ROW_STORE : table_schema.get_row_store_type()); + param.latest_row_store_type_ = table_schema.get_row_store_type(); param.data_index_tree_height_ = 0; param.index_blocks_cnt_ = 0; param.data_blocks_cnt_ = 0; diff --git a/src/storage/tablet/ob_tablet_create_sstable_param.cpp b/src/storage/tablet/ob_tablet_create_sstable_param.cpp index e8a23994df..e71310078a 100644 --- a/src/storage/tablet/ob_tablet_create_sstable_param.cpp +++ b/src/storage/tablet/ob_tablet_create_sstable_param.cpp @@ -85,7 +85,8 @@ bool ObTabletCreateSSTableParam::is_valid() const && create_snapshot_version_ >= 0 && index_type_ < share::schema::ObIndexType::INDEX_TYPE_MAX && root_row_store_type_ < ObRowStoreType::MAX_ROW_STORE - && latest_row_store_type_ < ObRowStoreType::MAX_ROW_STORE + && (latest_row_store_type_ < ObRowStoreType::MAX_ROW_STORE + || ObRowStoreType::DUMMY_ROW_STORE == latest_row_store_type_) && data_index_tree_height_ >= 0 && index_blocks_cnt_ >= 0 && data_blocks_cnt_ >= 0