gavinchou commented on code in PR #37293:
URL: https://github.com/apache/doris/pull/37293#discussion_r1694307721
##########
be/src/cloud/cloud_schema_change_job.cpp:
##########
@@ -86,13 +85,54 @@ Status CloudSchemaChangeJob::process_alter_tablet(const
TAlterTabletReqV2& reque
RETURN_IF_ERROR(_base_tablet->sync_rowsets(request.alter_version));
// ATTN: Only convert rowsets of version larger than 1, MUST let the new
tablet cache have rowset [0-1]
_output_cumulative_point = _base_tablet->cumulative_layer_point();
-
std::vector<RowSetSplits> rs_splits;
int64_t base_max_version = _base_tablet->max_version_unlocked();
+ cloud::TabletJobInfoPB job;
+ auto* idx = job.mutable_idx();
+ idx->set_tablet_id(_base_tablet->tablet_id());
+ idx->set_table_id(_base_tablet->table_id());
+ idx->set_index_id(_base_tablet->index_id());
+ idx->set_partition_id(_base_tablet->partition_id());
+ auto* sc_job = job.mutable_schema_change();
+ sc_job->set_id(_job_id);
+ sc_job->set_initiator(BackendOptions::get_localhost() + ':' +
+ std::to_string(config::heartbeat_service_port));
+ sc_job->set_alter_version(base_max_version);
+ auto* new_tablet_idx = sc_job->mutable_new_tablet_idx();
+ new_tablet_idx->set_tablet_id(_new_tablet->tablet_id());
+ new_tablet_idx->set_table_id(_new_tablet->table_id());
+ new_tablet_idx->set_index_id(_new_tablet->index_id());
+ new_tablet_idx->set_partition_id(_new_tablet->partition_id());
+ cloud::StartTabletJobResponse start_resp;
+ auto st = _cloud_storage_engine.meta_mgr().prepare_tablet_job(job,
&start_resp);
+ if (!st.ok()) {
+ if (start_resp.status().code() == cloud::JOB_ALREADY_SUCCESS) {
+ st = _new_tablet->sync_rowsets();
Review Comment:
why do we need to sync rowsets explicitly?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]