platoneko commented on code in PR #31483: URL: https://github.com/apache/doris/pull/31483#discussion_r1504105272
########## be/src/olap/rowset/rowset_meta.cpp: ########## @@ -103,15 +103,20 @@ void RowsetMeta::set_fs(io::FileSystemSPtr fs) { _fs = std::move(fs); } +bool RowsetMeta::has_variant_type_in_schema() const { + return _schema->num_variant_columns() > 0; +} + void RowsetMeta::to_rowset_pb(RowsetMetaPB* rs_meta_pb, bool skip_schema) const { *rs_meta_pb = _rowset_meta_pb; if (_schema) [[likely]] { rs_meta_pb->set_schema_version(_schema->schema_version()); - if (!skip_schema) { + if (!skip_schema || has_variant_type_in_schema()) { Review Comment: 这个 `skip_schema` 参数是给 `prepare_rowset` 的优化,prepare rowset 阶段只需要记录 rowset 在共享存储的路径即可不需要 schema 信息,所以这里应该不需要增加判断条件 ########## cloud/src/meta-service/meta_service.cpp: ########## @@ -1248,6 +1256,28 @@ std::vector<std::pair<int64_t, int64_t>> calc_sync_versions(int64_t req_bc_cnt, return versions; } +static bool try_fetch_and_parse_schema( + const std::unique_ptr<Transaction>& txn, RowsetMetaCloudPB& rowset_meta, Review Comment: ```suggestion Transaction* txn, RowsetMetaCloudPB& rowset_meta, ``` ########## cloud/src/recycler/recycler.cpp: ########## @@ -1542,6 +1554,10 @@ int InstanceRecycler::recycle_tmp_rowsets() { LOG(WARNING) << "failed to delete tmp rowset kv, instance_id=" << instance_id_; return -1; } + if (txn_remove(txn_kv_.get(), tmp_rowset_schema_keys) != 0) { Review Comment: 必须在删除 `tmp_rowset_keys` 之前删除 `tmp_rowset_schema_keys`,否则如果删除前者成功但是删除 后者失败,后者将会泄漏 ########## cloud/src/recycler/recycler.cpp: ########## Review Comment: `recycle_rowsets` 也要去删 meta rowset schema,类似 `recycle_tmp_rowsets` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org