diff --git a/be/src/storage/compaction.cpp b/be/src/storage/compaction.cpp index 05e559a4dd07a..3531bd652e89c 100644 --- a/be/src/storage/compaction.cpp +++ b/be/src/storage/compaction.cpp @@ -251,10 +251,6 @@ Status Compaction::_merge_rowsets_vertically(size_t segment_iterator_num, Statis int64_t total_num_rows = 0; int64_t total_mem_footprint = 0; for (auto& rowset : _input_rowsets) { - if (rowset->rowset_meta()->rowset_type() != BETA_ROWSET) { - continue; - } - total_num_rows += rowset->num_rows(); auto* beta_rowset = down_cast(rowset.get()); for (auto& segment : beta_rowset->segments()) { diff --git a/be/src/storage/compaction_utils.cpp b/be/src/storage/compaction_utils.cpp index c2d6eff79fe29..7de9f8b1798c4 100644 --- a/be/src/storage/compaction_utils.cpp +++ b/be/src/storage/compaction_utils.cpp @@ -48,7 +48,6 @@ Status CompactionUtils::construct_output_rowset_writer(Tablet* tablet, uint32_t context.tablet_id = tablet->tablet_id(); context.partition_id = tablet->partition_id(); context.tablet_schema_hash = tablet->schema_hash(); - context.rowset_type = BETA_ROWSET; context.rowset_path_prefix = tablet->schema_hash_path(); context.tablet_schema = &(tablet->tablet_schema()); context.rowset_state = VISIBLE; diff --git a/be/src/storage/data_dir.cpp b/be/src/storage/data_dir.cpp index 3916d602f9e0c..88c058d6f46c1 100644 --- a/be/src/storage/data_dir.cpp +++ b/be/src/storage/data_dir.cpp @@ -243,10 +243,6 @@ Status DataDir::load() { // return false will break meta iterator, return true to skip this error return true; } - LOG_IF(FATAL, rowset_meta->rowset_type() == ALPHA_ROWSET) - << "must change V1 format to V2 format." - << "tablet_id: " << rowset_meta->tablet_id() << ", tablet_uid:" << rowset_meta->tablet_uid() - << ", schema_hash: " << rowset_meta->tablet_schema_hash() << ", rowset_id:" << rowset_meta->rowset_id(); dir_rowset_metas.push_back(rowset_meta); return true; }; @@ -319,8 +315,7 @@ Status DataDir::load() { rowset_meta, &rowset); if (!create_status.ok()) { LOG(WARNING) << "Fail to create rowset from rowsetmeta," - << " rowset=" << rowset_meta->rowset_id() << " type=" << rowset_meta->rowset_type() - << " state=" << rowset_meta->rowset_state(); + << " rowset=" << rowset_meta->rowset_id() << " state=" << rowset_meta->rowset_state(); continue; } if (rowset_meta->rowset_state() == RowsetStatePB::COMMITTED && diff --git a/be/src/storage/delta_writer.cpp b/be/src/storage/delta_writer.cpp index 4f8158baf4236..af224e5bb43fa 100644 --- a/be/src/storage/delta_writer.cpp +++ b/be/src/storage/delta_writer.cpp @@ -175,7 +175,6 @@ Status DeltaWriter::_init() { writer_context.tablet_id = _opt.tablet_id; writer_context.partition_id = _opt.partition_id; writer_context.tablet_schema_hash = _opt.schema_hash; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = _tablet->schema_hash_path(); writer_context.rowset_state = PREPARED; writer_context.txn_id = _opt.txn_id; diff --git a/be/src/storage/lake/tablet_manager.cpp b/be/src/storage/lake/tablet_manager.cpp index dfb418b1ac41a..20b75c281742f 100644 --- a/be/src/storage/lake/tablet_manager.cpp +++ b/be/src/storage/lake/tablet_manager.cpp @@ -146,7 +146,6 @@ Status TabletManager::create_tablet(const TCreateTabletReq& req) { col_idx_to_unique_id[col_idx] = col_idx; } RETURN_IF_ERROR(starrocks::convert_t_schema_to_pb_schema(req.tablet_schema, next_unique_id, col_idx_to_unique_id, - RowsetTypePB::BETA_ROWSET, tablet_metadata_pb.mutable_schema())); // get shard group diff --git a/be/src/storage/metadata_util.cpp b/be/src/storage/metadata_util.cpp index b7d2b5157fa0d..d94c3b186da68 100644 --- a/be/src/storage/metadata_util.cpp +++ b/be/src/storage/metadata_util.cpp @@ -199,7 +199,7 @@ static Status t_column_to_pb_column(int32_t unique_id, const TColumn& t_column, Status convert_t_schema_to_pb_schema(const TTabletSchema& tablet_schema, uint32_t next_unique_id, const std::unordered_map& col_ordinal_to_unique_id, - RowsetTypePB rowset_type, TabletSchemaPB* schema) { + TabletSchemaPB* schema) { if (tablet_schema.__isset.id) { schema->set_id(tablet_schema.id); } @@ -224,7 +224,7 @@ Status convert_t_schema_to_pb_schema(const TTabletSchema& tablet_schema, uint32_ schema->set_compress_kind(COMPRESS_LZ4); FieldTypeVersion field_version = FieldTypeVersion::kV1; - if ((rowset_type == BETA_ROWSET) && (config::storage_format_version == 2)) { + if (config::storage_format_version == 2) { field_version = FieldTypeVersion::kV2; } diff --git a/be/src/storage/metadata_util.h b/be/src/storage/metadata_util.h index 1ca069634e161..f1a586500853f 100644 --- a/be/src/storage/metadata_util.h +++ b/be/src/storage/metadata_util.h @@ -14,6 +14,6 @@ enum RowsetTypePB : int; Status convert_t_schema_to_pb_schema(const TTabletSchema& tablet_schema, uint32_t next_unique_id, const std::unordered_map& col_ordinal_to_unique_id, - RowsetTypePB rowset_type, TabletSchemaPB* schema); + TabletSchemaPB* schema); } // namespace starrocks \ No newline at end of file diff --git a/be/src/storage/push_handler.cpp b/be/src/storage/push_handler.cpp index 5b34d53007f28..b8dd448f9d026 100644 --- a/be/src/storage/push_handler.cpp +++ b/be/src/storage/push_handler.cpp @@ -463,7 +463,6 @@ Status PushHandler::_delete_convert(const TabletSharedPtr& cur_tablet, RowsetSha context.tablet_id = cur_tablet->tablet_id(); context.partition_id = _request.partition_id; context.tablet_schema_hash = cur_tablet->schema_hash(); - context.rowset_type = BETA_ROWSET; context.rowset_path_prefix = cur_tablet->schema_hash_path(); context.tablet_schema = &cur_tablet->tablet_schema(); context.rowset_state = PREPARED; @@ -520,7 +519,6 @@ Status PushHandler::_load_convert(const TabletSharedPtr& cur_tablet, RowsetShare context.tablet_id = cur_tablet->tablet_id(); context.partition_id = _request.partition_id; context.tablet_schema_hash = cur_tablet->schema_hash(); - context.rowset_type = BETA_ROWSET; context.rowset_path_prefix = cur_tablet->schema_hash_path(); context.tablet_schema = &(cur_tablet->tablet_schema()); context.rowset_state = PREPARED; diff --git a/be/src/storage/rowset/beta_rowset_writer.cpp b/be/src/storage/rowset/beta_rowset_writer.cpp index ff6abb634db52..1996b9c3b2e3f 100644 --- a/be/src/storage/rowset/beta_rowset_writer.cpp +++ b/be/src/storage/rowset/beta_rowset_writer.cpp @@ -79,7 +79,6 @@ Status BetaRowsetWriter::init() { _rowset_meta->set_partition_id(_context.partition_id); _rowset_meta->set_tablet_id(_context.tablet_id); _rowset_meta->set_tablet_schema_hash(_context.tablet_schema_hash); - _rowset_meta->set_rowset_type(_context.rowset_type); _rowset_meta->set_rowset_state(_context.rowset_state); _rowset_meta->set_segments_overlap(_context.segments_overlap); if (_context.rowset_state == PREPARED || _context.rowset_state == COMMITTED) { @@ -370,7 +369,6 @@ Status HorizontalBetaRowsetWriter::flush_chunk_with_deletes(const vectorized::Ch } Status HorizontalBetaRowsetWriter::add_rowset(RowsetSharedPtr rowset) { - assert(rowset->rowset_meta()->rowset_type() == BETA_ROWSET); RETURN_IF_ERROR(rowset->link_files_to(_context.rowset_path_prefix, _context.rowset_id)); _num_rows_written += rowset->num_rows(); _total_row_size += static_cast(rowset->total_row_size()); diff --git a/be/src/storage/rowset/rowset_factory.cpp b/be/src/storage/rowset/rowset_factory.cpp index 677007ec619a0..7f57a1d904dcc 100644 --- a/be/src/storage/rowset/rowset_factory.cpp +++ b/be/src/storage/rowset/rowset_factory.cpp @@ -35,20 +35,12 @@ namespace starrocks { Status RowsetFactory::create_rowset(const TabletSchema* schema, const std::string& rowset_path, const RowsetMetaSharedPtr& rowset_meta, RowsetSharedPtr* rowset) { - if (rowset_meta->rowset_type() == BETA_ROWSET) { - *rowset = - BetaRowset::create(ExecEnv::GetInstance()->tablet_meta_mem_tracker(), schema, rowset_path, rowset_meta); - RETURN_IF_ERROR((*rowset)->init()); - return Status::OK(); - } - return Status::NotSupported("unsupported rowset type"); + *rowset = BetaRowset::create(ExecEnv::GetInstance()->tablet_meta_mem_tracker(), schema, rowset_path, rowset_meta); + RETURN_IF_ERROR((*rowset)->init()); + return Status::OK(); } Status RowsetFactory::create_rowset_writer(const RowsetWriterContext& context, std::unique_ptr* output) { - if (UNLIKELY(context.rowset_type != BETA_ROWSET)) { - return Status::NotSupported("unsupported rowset type"); - } - auto tablet_schema = context.tablet_schema; auto memory_format_version = context.memory_format_version; auto storage_format_version = context.storage_format_version; diff --git a/be/src/storage/rowset/rowset_meta.h b/be/src/storage/rowset/rowset_meta.h index 0b8edcd80b457..88423d9de4606 100644 --- a/be/src/storage/rowset/rowset_meta.h +++ b/be/src/storage/rowset/rowset_meta.h @@ -107,10 +107,6 @@ class RowsetMeta { _rowset_meta_pb.set_tablet_schema_hash(tablet_schema_hash); } - RowsetTypePB rowset_type() const { return _rowset_meta_pb.rowset_type(); } - - void set_rowset_type(RowsetTypePB rowset_type) { _rowset_meta_pb.set_rowset_type(rowset_type); } - RowsetStatePB rowset_state() const { return _rowset_meta_pb.rowset_state(); } void set_rowset_state(RowsetStatePB rowset_state) { _rowset_meta_pb.set_rowset_state(rowset_state); } diff --git a/be/src/storage/rowset/rowset_writer_context.h b/be/src/storage/rowset/rowset_writer_context.h index 098f5e0fce04d..3f639abb8de8b 100644 --- a/be/src/storage/rowset/rowset_writer_context.h +++ b/be/src/storage/rowset/rowset_writer_context.h @@ -62,7 +62,6 @@ class RowsetWriterContext { bool write_tmp = false; RowsetStatePB rowset_state = PREPARED; - RowsetTypePB rowset_type = BETA_ROWSET; SegmentsOverlapPB segments_overlap = OVERLAP_UNKNOWN; // segment file use uint32 to represent row number, therefore the maximum is UINT32_MAX. diff --git a/be/src/storage/schema_change.cpp b/be/src/storage/schema_change.cpp index ea89d9249b807..42cad4d6e78a8 100644 --- a/be/src/storage/schema_change.cpp +++ b/be/src/storage/schema_change.cpp @@ -1506,7 +1506,6 @@ Status SchemaChangeHandler::_convert_historical_rowsets(SchemaChangeParams& sc_p writer_context.tablet_id = new_tablet->tablet_id(); writer_context.partition_id = new_tablet->partition_id(); writer_context.tablet_schema_hash = new_tablet->schema_hash(); - writer_context.rowset_type = sc_params.new_tablet->tablet_meta()->preferred_rowset_type(); writer_context.rowset_path_prefix = new_tablet->schema_hash_path(); writer_context.tablet_schema = &new_tablet->tablet_schema(); writer_context.rowset_state = VISIBLE; @@ -1729,11 +1728,6 @@ Status SchemaChangeHandler::_parse_request( *sc_directly = true; } - if (base_tablet->tablet_meta()->preferred_rowset_type() != new_tablet->tablet_meta()->preferred_rowset_type()) { - // If the base_tablet and new_tablet rowset types are different, just use directly type - *sc_directly = true; - } - return Status::OK(); } diff --git a/be/src/storage/snapshot_manager.cpp b/be/src/storage/snapshot_manager.cpp index 3255425b78271..bfa7d5a83c83c 100644 --- a/be/src/storage/snapshot_manager.cpp +++ b/be/src/storage/snapshot_manager.cpp @@ -192,14 +192,6 @@ Status SnapshotManager::convert_rowset_ids(const string& clone_dir, int64_t tabl std::unordered_map rs_version_map; for (const auto& visible_rowset : cloned_tablet_meta_pb.rs_metas()) { - if (visible_rowset.rowset_type() == ALPHA_ROWSET) { - LOG(WARNING) << "must change V1 format to V2 format. " - << "tablet_id: " << visible_rowset.tablet_id() - << ", tablet_uid: " << visible_rowset.tablet_uid() - << ", schema_hash: " << visible_rowset.tablet_schema_hash() - << ", rowset_id:" << visible_rowset.rowset_id(); - return Status::RuntimeError("unknown rowset type"); - } RowsetMetaPB* rowset_meta = new_tablet_meta_pb.add_rs_metas(); RowsetId rowset_id = StorageEngine::instance()->next_rowset_id(); RETURN_IF_ERROR(_rename_rowset_id(visible_rowset, clone_dir, tablet_schema, rowset_id, rowset_meta)); @@ -210,13 +202,6 @@ Status SnapshotManager::convert_rowset_ids(const string& clone_dir, int64_t tabl } for (const auto& inc_rowset : cloned_tablet_meta_pb.inc_rs_metas()) { - if (inc_rowset.rowset_type() == ALPHA_ROWSET) { - LOG(WARNING) << "must change V1 format to V2 format. " - << "tablet_id: " << inc_rowset.tablet_id() << ", tablet_uid: " << inc_rowset.tablet_uid() - << ", schema_hash: " << inc_rowset.tablet_schema_hash() - << ", rowset_id:" << inc_rowset.rowset_id(); - return Status::RuntimeError("unknown rowset type"); - } Version rowset_version = {inc_rowset.start_version(), inc_rowset.end_version()}; auto exist_rs = rs_version_map.find(rowset_version); if (exist_rs != rs_version_map.end()) { @@ -254,7 +239,6 @@ Status SnapshotManager::_rename_rowset_id(const RowsetMetaPB& rs_meta_pb, const context.tablet_id = org_rowset_meta->tablet_id(); context.partition_id = org_rowset_meta->partition_id(); context.tablet_schema_hash = org_rowset_meta->tablet_schema_hash(); - context.rowset_type = org_rowset_meta->rowset_type(); context.rowset_path_prefix = new_path; context.tablet_schema = &tablet_schema; context.rowset_state = org_rowset_meta->rowset_state(); diff --git a/be/src/storage/tablet_manager.cpp b/be/src/storage/tablet_manager.cpp index 52294884e986c..c1aeeaf79463a 100644 --- a/be/src/storage/tablet_manager.cpp +++ b/be/src/storage/tablet_manager.cpp @@ -690,12 +690,6 @@ Status TabletManager::load_tablet_from_meta(DataDir* data_dir, TTabletId tablet_ return Status::InternalError("Invalid serialized tablet meta"); } - for (const auto& rs : tablet_meta->all_rs_metas()) { - LOG_IF(FATAL, rs->rowset_type() != BETA_ROWSET) - << "Unsupported rowset type " << rs->rowset_type() << " tablet_id=" << tablet_meta->tablet_id() - << " tablet_uid=" << rs->tablet_uid() << " schema_hash=" << tablet_meta->schema_hash() - << " rowset_id=" << rs->rowset_id(); - } if (tablet_meta->tablet_id() != tablet_id) { LOG(WARNING) << "Mismatched tablet_id. expect=" << tablet_id << " real=" << tablet_meta->tablet_id(); return Status::InternalError("mismatched tablet_id"); @@ -1115,7 +1109,6 @@ Status TabletManager::_create_inital_rowset_unlocked(const TCreateTabletReq& req context.tablet_id = tablet->tablet_id(); context.partition_id = tablet->partition_id(); context.tablet_schema_hash = tablet->schema_hash(); - context.rowset_type = RowsetTypePB::BETA_ROWSET; context.rowset_path_prefix = tablet->schema_hash_path(); context.tablet_schema = &tablet->tablet_schema(); context.rowset_state = VISIBLE; @@ -1210,7 +1203,7 @@ Status TabletManager::_create_tablet_meta_unlocked(const TCreateTabletReq& reque } // We generate a new tablet_uid for this new tablet. return TabletMeta::create(_mem_tracker, normal_request, TabletUid::gen_uid(), shard_id, next_unique_id, - col_idx_to_unique_id, RowsetTypePB::BETA_ROWSET, tablet_meta); + col_idx_to_unique_id, tablet_meta); } Status TabletManager::_drop_tablet_directly_unlocked(TTabletId tablet_id, TabletDropFlag flag) { diff --git a/be/src/storage/tablet_meta.cpp b/be/src/storage/tablet_meta.cpp index df39bd3529df5..fedce33c9c270 100644 --- a/be/src/storage/tablet_meta.cpp +++ b/be/src/storage/tablet_meta.cpp @@ -63,14 +63,13 @@ Status AlterTabletTask::set_alter_state(AlterTabletState alter_state) { Status TabletMeta::create(MemTracker* mem_tracker, const TCreateTabletReq& request, const TabletUid& tablet_uid, uint64_t shard_id, uint32_t next_unique_id, const std::unordered_map& col_ordinal_to_unique_id, - RowsetTypePB rowset_type, TabletMetaSharedPtr* tablet_meta) { + TabletMetaSharedPtr* tablet_meta) { *tablet_meta = std::shared_ptr( new TabletMeta(request.table_id, request.partition_id, request.tablet_id, request.tablet_schema.schema_hash, shard_id, request.tablet_schema, next_unique_id, request.__isset.enable_persistent_index ? request.enable_persistent_index : false, col_ordinal_to_unique_id, tablet_uid, - request.__isset.tablet_type ? request.tablet_type : TTabletType::TABLET_TYPE_DISK, - rowset_type), + request.__isset.tablet_type ? request.tablet_type : TTabletType::TABLET_TYPE_DISK), DeleterWithMemTracker(mem_tracker)); mem_tracker->consume((*tablet_meta)->mem_usage()); return Status::OK(); @@ -86,8 +85,8 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t partition_id, int64_t tablet_id uint64_t shard_id, const TTabletSchema& tablet_schema, uint32_t next_unique_id, bool enable_persistent_index, const std::unordered_map& col_ordinal_to_unique_id, - const TabletUid& tablet_uid, TTabletType::type tabletType, RowsetTypePB rowset_type) - : _tablet_uid(0, 0), _preferred_rowset_type(rowset_type) { + const TabletUid& tablet_uid, TTabletType::type tabletType) + : _tablet_uid(0, 0) { TabletMetaPB tablet_meta_pb; tablet_meta_pb.set_table_id(table_id); tablet_meta_pb.set_partition_id(partition_id); @@ -104,7 +103,7 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t partition_id, int64_t tablet_id tablet_meta_pb.set_in_restore_mode(false); TabletSchemaPB* schema = tablet_meta_pb.mutable_schema(); - convert_t_schema_to_pb_schema(tablet_schema, next_unique_id, col_ordinal_to_unique_id, rowset_type, schema); + convert_t_schema_to_pb_schema(tablet_schema, next_unique_id, col_ordinal_to_unique_id, schema); init_from_pb(&tablet_meta_pb); } @@ -273,9 +272,6 @@ void TabletMeta::init_from_pb(TabletMetaPB* ptablet_meta_pb) { _in_restore_mode = tablet_meta_pb.in_restore_mode(); } - if (tablet_meta_pb.has_preferred_rowset_type()) { - _preferred_rowset_type = tablet_meta_pb.preferred_rowset_type(); - } if (tablet_meta_pb.has_updates()) { _updatesPB.reset(tablet_meta_pb.release_updates()); } @@ -326,9 +322,6 @@ void TabletMeta::to_meta_pb(TabletMetaPB* tablet_meta_pb) { tablet_meta_pb->set_in_restore_mode(in_restore_mode()); // to avoid modify tablet meta to the greatest extend - if (_preferred_rowset_type == BETA_ROWSET) { - tablet_meta_pb->set_preferred_rowset_type(_preferred_rowset_type); - } if (_updates != nullptr) { _updates->to_updates_pb(tablet_meta_pb->mutable_updates()); } else if (_updatesPB) { @@ -604,7 +597,6 @@ bool operator==(const TabletMeta& a, const TabletMeta& b) { } if (a._alter_task != b._alter_task) return false; if (a._in_restore_mode != b._in_restore_mode) return false; - if (a._preferred_rowset_type != b._preferred_rowset_type) return false; return true; } diff --git a/be/src/storage/tablet_meta.h b/be/src/storage/tablet_meta.h index 91cd93ea4daf4..ea8e3d6e7d1b3 100644 --- a/be/src/storage/tablet_meta.h +++ b/be/src/storage/tablet_meta.h @@ -113,7 +113,7 @@ class TabletMeta { static Status create(MemTracker* mem_tracker, const TCreateTabletReq& request, const TabletUid& tablet_uid, uint64_t shard_id, uint32_t next_unique_id, const std::unordered_map& col_ordinal_to_unique_id, - RowsetTypePB rowset_type, TabletMetaSharedPtr* tablet_meta); + TabletMetaSharedPtr* tablet_meta); static TabletMetaSharedPtr create(MemTracker* mem_tracker); @@ -121,7 +121,7 @@ class TabletMeta { TabletMeta(int64_t table_id, int64_t partition_id, int64_t tablet_id, int32_t schema_hash, uint64_t shard_id, const TTabletSchema& tablet_schema, uint32_t next_unique_id, bool enable_persistent_index, const std::unordered_map& col_ordinal_to_unique_id, const TabletUid& tablet_uid, - TTabletType::type tabletType, RowsetTypePB roset_type); + TTabletType::type tabletType); virtual ~TabletMeta() {} @@ -203,12 +203,6 @@ class TabletMeta { Status set_partition_id(int64_t partition_id); - RowsetTypePB preferred_rowset_type() const { return _preferred_rowset_type; } - - void set_preferred_rowset_type(RowsetTypePB preferred_rowset_type) { - _preferred_rowset_type = preferred_rowset_type; - } - // used when create new tablet void create_inital_updates_meta(); // _updates will become empty after release @@ -266,7 +260,6 @@ class TabletMeta { DelPredicateArray _del_pred_array; AlterTabletTaskSharedPtr _alter_task; bool _in_restore_mode = false; - RowsetTypePB _preferred_rowset_type = BETA_ROWSET; // This meta is used for TabletUpdates' load process, // to save memory it will be passed to TabletUpdates for usage diff --git a/be/src/storage/tablet_updates.cpp b/be/src/storage/tablet_updates.cpp index 2633f9229ff85..5a91d6eec1fd3 100644 --- a/be/src/storage/tablet_updates.cpp +++ b/be/src/storage/tablet_updates.cpp @@ -151,8 +151,7 @@ Status TabletUpdates::_load_from_pb(const TabletUpdatesPB& tablet_updates_pb) { _pending_commits.emplace(version, rowset); } else { LOG(WARNING) << "Fail to create rowset from pending rowset meta. rowset=" - << rowset_meta->rowset_id() << " type=" << rowset_meta->rowset_type() - << " state=" << rowset_meta->rowset_state(); + << rowset_meta->rowset_id() << " state=" << rowset_meta->rowset_state(); } return true; })); @@ -174,7 +173,7 @@ Status TabletUpdates::_load_from_pb(const TabletUpdatesPB& tablet_updates_pb) { _rowsets[rowset_meta->get_rowset_seg_id()] = std::move(rowset); } else { LOG(WARNING) << "Fail to create rowset from rowset meta. rowset=" << rowset_meta->rowset_id() - << " type=" << rowset_meta->rowset_type() << " state=" << rowset_meta->rowset_state(); + << " state=" << rowset_meta->rowset_state(); } all_rowsets.insert(rowset_meta->get_rowset_seg_id()); return true; @@ -1098,7 +1097,6 @@ Status TabletUpdates::_do_compaction(std::unique_ptr* pinfo, boo context.tablet_id = _tablet.tablet_id(); context.partition_id = _tablet.partition_id(); context.tablet_schema_hash = _tablet.schema_hash(); - context.rowset_type = BETA_ROWSET; context.rowset_path_prefix = _tablet.schema_hash_path(); context.tablet_schema = &(_tablet.tablet_schema()); context.rowset_state = COMMITTED; @@ -2260,7 +2258,6 @@ Status TabletUpdates::convert_from(const std::shared_ptr& base_tablet, i writer_context.tablet_id = _tablet.tablet_id(); writer_context.partition_id = _tablet.partition_id(); writer_context.tablet_schema_hash = _tablet.schema_hash(); - writer_context.rowset_type = _tablet.tablet_meta()->preferred_rowset_type(); writer_context.rowset_path_prefix = _tablet.schema_hash_path(); writer_context.tablet_schema = &_tablet.tablet_schema(); writer_context.rowset_state = VISIBLE; diff --git a/be/src/storage/vertical_compaction_task.cpp b/be/src/storage/vertical_compaction_task.cpp index 078e598b12686..e19ed5b2d043c 100644 --- a/be/src/storage/vertical_compaction_task.cpp +++ b/be/src/storage/vertical_compaction_task.cpp @@ -152,11 +152,6 @@ StatusOr VerticalCompactionTask::_calculate_chunk_size_for_column_group int64_t total_num_rows = 0; int64_t total_mem_footprint = 0; for (auto& rowset : _input_rowsets) { - if (rowset->rowset_meta()->rowset_type() != BETA_ROWSET) { - LOG(WARNING) << "unsupported rowset type:" << rowset->rowset_meta()->rowset_type(); - return Status::InternalError("unsupported rowset type"); - } - total_num_rows += rowset->num_rows(); auto* beta_rowset = down_cast(rowset.get()); for (auto& segment : beta_rowset->segments()) { diff --git a/be/test/storage/base_compaction_test.cpp b/be/test/storage/base_compaction_test.cpp index f642edb5f0caa..fe6a2d6c6a326 100644 --- a/be/test/storage/base_compaction_test.cpp +++ b/be/test/storage/base_compaction_test.cpp @@ -32,7 +32,6 @@ class BaseCompactionTest : public testing::Test { rowset_writer_context->tablet_id = 12345; rowset_writer_context->tablet_schema_hash = 1111; rowset_writer_context->partition_id = 10; - rowset_writer_context->rowset_type = _rowset_type; rowset_writer_context->rowset_path_prefix = config::storage_root_path + "/data/0/12345/1111"; rowset_writer_context->rowset_state = VISIBLE; rowset_writer_context->tablet_schema = _tablet_schema.get(); @@ -230,7 +229,6 @@ class BaseCompactionTest : public testing::Test { protected: std::unique_ptr _tablet_schema; - RowsetTypePB _rowset_type = BETA_ROWSET; std::string _schema_hash_path; std::unique_ptr _compaction_mem_tracker; std::unique_ptr _mem_pool; diff --git a/be/test/storage/cumulative_compaction_test.cpp b/be/test/storage/cumulative_compaction_test.cpp index 6aaec823ff216..45b3571a8ab76 100644 --- a/be/test/storage/cumulative_compaction_test.cpp +++ b/be/test/storage/cumulative_compaction_test.cpp @@ -33,7 +33,6 @@ class CumulativeCompactionTest : public testing::Test { rowset_writer_context->tablet_id = 12345; rowset_writer_context->tablet_schema_hash = 1111; rowset_writer_context->partition_id = 10; - rowset_writer_context->rowset_type = _rowset_type; rowset_writer_context->rowset_path_prefix = config::storage_root_path + "/data/0/12345/1111"; rowset_writer_context->rowset_state = VISIBLE; rowset_writer_context->tablet_schema = _tablet_schema.get(); @@ -213,7 +212,6 @@ class CumulativeCompactionTest : public testing::Test { protected: std::unique_ptr _tablet_schema; - RowsetTypePB _rowset_type = BETA_ROWSET; std::string _schema_hash_path; std::unique_ptr _tablet_meta_mem_tracker; std::unique_ptr _compaction_mem_tracker; diff --git a/be/test/storage/memtable_test.cpp b/be/test/storage/memtable_test.cpp index 2a9168cd802e9..ee924f23703e0 100644 --- a/be/test/storage/memtable_test.cpp +++ b/be/test/storage/memtable_test.cpp @@ -197,7 +197,6 @@ class MemTableTest : public ::testing::Test { writer_context.tablet_id = rand() % 1000000; writer_context.tablet_schema_hash = 1111; writer_context.partition_id = 10; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = _root_path; writer_context.rowset_state = VISIBLE; writer_context.tablet_schema = _schema.get(); diff --git a/be/test/storage/persistent_index_test.cpp b/be/test/storage/persistent_index_test.cpp index fdfeff39fa3e1..b8dcbe73d6f49 100644 --- a/be/test/storage/persistent_index_test.cpp +++ b/be/test/storage/persistent_index_test.cpp @@ -309,7 +309,6 @@ RowsetSharedPtr create_rowset(const TabletSharedPtr& tablet, const vectortablet_id(); writer_context.tablet_schema_hash = tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; writer_context.tablet_schema = &tablet->tablet_schema(); diff --git a/be/test/storage/rowset/beta_rowset_test.cpp b/be/test/storage/rowset/beta_rowset_test.cpp index 84cc0d2c9dbf7..f3951522f6276 100644 --- a/be/test/storage/rowset/beta_rowset_test.cpp +++ b/be/test/storage/rowset/beta_rowset_test.cpp @@ -190,7 +190,6 @@ class BetaRowsetTest : public testing::Test { rowset_writer_context->tablet_id = 12345; rowset_writer_context->tablet_schema_hash = 1111; rowset_writer_context->partition_id = 10; - rowset_writer_context->rowset_type = BETA_ROWSET; rowset_writer_context->rowset_path_prefix = config::storage_root_path + "/data/beta_rowset_test"; rowset_writer_context->rowset_state = VISIBLE; rowset_writer_context->tablet_schema = tablet_schema; diff --git a/be/test/storage/rowset_merger_test.cpp b/be/test/storage/rowset_merger_test.cpp index afe1d4c80a7eb..a33468e777867 100644 --- a/be/test/storage/rowset_merger_test.cpp +++ b/be/test/storage/rowset_merger_test.cpp @@ -104,7 +104,6 @@ class RowsetMergerTest : public testing::Test { writer_context.tablet_id = tablet->tablet_id(); writer_context.tablet_schema_hash = tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; writer_context.tablet_schema = &tablet->tablet_schema(); diff --git a/be/test/storage/rowset_update_state_test.cpp b/be/test/storage/rowset_update_state_test.cpp index a7572525fcf54..3756d8cd46934 100644 --- a/be/test/storage/rowset_update_state_test.cpp +++ b/be/test/storage/rowset_update_state_test.cpp @@ -50,7 +50,6 @@ class RowsetUpdateStateTest : public ::testing::Test { writer_context.tablet_id = tablet->tablet_id(); writer_context.tablet_schema_hash = tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; writer_context.tablet_schema = &tablet->tablet_schema(); @@ -119,7 +118,6 @@ class RowsetUpdateStateTest : public ::testing::Test { writer_context.tablet_id = tablet->tablet_id(); writer_context.tablet_schema_hash = tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; @@ -280,7 +278,6 @@ TEST_F(RowsetUpdateStateTest, check_conflict) { writer_context.tablet_id = _tablet->tablet_id(); writer_context.tablet_schema_hash = _tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = _tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; writer_context.tablet_schema = &_tablet->tablet_schema(); diff --git a/be/test/storage/tablet_meta_test.cpp b/be/test/storage/tablet_meta_test.cpp index eaaeaa267eb21..b9d2c8ebc4f16 100644 --- a/be/test/storage/tablet_meta_test.cpp +++ b/be/test/storage/tablet_meta_test.cpp @@ -108,8 +108,7 @@ TEST(TabletMetaTest, test_create) { std::unique_ptr mem_tracker = std::make_unique(-1); TabletMetaSharedPtr tablet_meta; Status st = TabletMeta::create(mem_tracker.get(), request, TabletUid(321, 456), 987 /*shared_id*/, - 20000 /*next_unique_id*/, col_ordinal_to_unique_id, RowsetTypePB::BETA_ROWSET, - &tablet_meta); + 20000 /*next_unique_id*/, col_ordinal_to_unique_id, &tablet_meta); ASSERT_TRUE(st.ok()); ASSERT_TRUE(tablet_meta != nullptr); diff --git a/be/test/storage/tablet_updates_test.cpp b/be/test/storage/tablet_updates_test.cpp index 893913f19bcf8..7aa729e7c3e34 100644 --- a/be/test/storage/tablet_updates_test.cpp +++ b/be/test/storage/tablet_updates_test.cpp @@ -54,7 +54,6 @@ class TabletUpdatesTest : public testing::Test { writer_context.tablet_id = tablet->tablet_id(); writer_context.tablet_schema_hash = tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; writer_context.tablet_schema = &tablet->tablet_schema(); @@ -99,10 +98,8 @@ class TabletUpdatesTest : public testing::Test { writer_context.tablet_id = tablet->tablet_id(); writer_context.tablet_schema_hash = tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; - writer_context.partial_update_tablet_schema = partial_schema; writer_context.referenced_column_ids = column_indexes; writer_context.tablet_schema = partial_schema.get(); @@ -134,7 +131,6 @@ class TabletUpdatesTest : public testing::Test { writer_context.tablet_id = tablet->tablet_id(); writer_context.tablet_schema_hash = tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; writer_context.tablet_schema = &tablet->tablet_schema(); diff --git a/be/test/storage/task/engine_storage_migration_task_test.cpp b/be/test/storage/task/engine_storage_migration_task_test.cpp index ff48008dc2c11..1fcba05ff1905 100644 --- a/be/test/storage/task/engine_storage_migration_task_test.cpp +++ b/be/test/storage/task/engine_storage_migration_task_test.cpp @@ -111,7 +111,6 @@ class EngineStorageMigrationTaskTest : public testing::Test { rowset_writer_context->tablet_id = 12345; rowset_writer_context->tablet_schema_hash = 1111; rowset_writer_context->partition_id = 10; - rowset_writer_context->rowset_type = BETA_ROWSET; rowset_writer_context->rowset_path_prefix = schema_hash_path; rowset_writer_context->rowset_state = VISIBLE; rowset_writer_context->tablet_schema = tablet_schema; diff --git a/be/test/storage/update_manager_test.cpp b/be/test/storage/update_manager_test.cpp index 765dfc89aa4d1..26544138e4b21 100644 --- a/be/test/storage/update_manager_test.cpp +++ b/be/test/storage/update_manager_test.cpp @@ -42,7 +42,6 @@ class UpdateManagerTest : public testing::Test { writer_context.tablet_id = _tablet->tablet_id(); writer_context.tablet_schema_hash = _tablet->schema_hash(); writer_context.partition_id = 0; - writer_context.rowset_type = BETA_ROWSET; writer_context.rowset_path_prefix = _tablet->schema_hash_path(); writer_context.rowset_state = COMMITTED; writer_context.tablet_schema = &_tablet->tablet_schema(); diff --git a/fe/fe-core/src/main/java/com/starrocks/alter/SchemaChangeHandler.java b/fe/fe-core/src/main/java/com/starrocks/alter/SchemaChangeHandler.java index 18a26ba09fe32..ac30bcd612c0f 100644 --- a/fe/fe-core/src/main/java/com/starrocks/alter/SchemaChangeHandler.java +++ b/fe/fe-core/src/main/java/com/starrocks/alter/SchemaChangeHandler.java @@ -959,10 +959,6 @@ private void createJob(long dbId, OlapTable olapTable, Map