[CP] fix drop column using wrong index.
This commit is contained in:
@ -147,38 +147,6 @@ int ObColumnRedefinitionTask::init(const ObDDLTaskRecord &task_record)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObColumnRedefinitionTask::wait_data_complement(const ObDDLTaskStatus next_task_status)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
bool is_build_replica_end = false;
|
||||
if (OB_UNLIKELY(!is_inited_)) {
|
||||
ret = OB_NOT_INIT;
|
||||
LOG_WARN("ObColumnRedefinitionTask is not inited", K(ret));
|
||||
} else if (ObDDLTaskStatus::REDEFINITION != task_status_) {
|
||||
ret = OB_STATE_NOT_MATCH;
|
||||
LOG_WARN("task status not match", K(ret), K(task_status_));
|
||||
} else if (OB_UNLIKELY(snapshot_version_ <= 0)) {
|
||||
is_build_replica_end = true; // switch to fail.
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected snapshot", K(ret), KPC(this));
|
||||
} else if (!is_sstable_complete_task_submitted_ && OB_FAIL(send_build_single_replica_request())) {
|
||||
LOG_WARN("fail to send build single replica request", K(ret));
|
||||
} else if (is_sstable_complete_task_submitted_ && OB_FAIL(check_build_single_replica(is_build_replica_end))) {
|
||||
LOG_WARN("fail to check build single replica", K(ret), K(is_build_replica_end));
|
||||
}
|
||||
DEBUG_SYNC(COLUMN_REDEFINITION_REPLICA_BUILD);
|
||||
if (is_build_replica_end) {
|
||||
ret = complete_sstable_job_ret_code_;
|
||||
if (OB_SUCC(ret) && OB_FAIL(check_data_dest_tables_columns_checksum(get_execution_id()))) {
|
||||
LOG_WARN("fail to check the columns checkum between data table and hidden one", K(ret));
|
||||
}
|
||||
if (OB_FAIL(switch_status(next_task_status, true, ret))) {
|
||||
LOG_WARN("fail to swith task status", K(ret));
|
||||
}
|
||||
LOG_INFO("wait data complement finished", K(ret), K(*this));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// update sstable complement status for all leaders
|
||||
int ObColumnRedefinitionTask::update_complete_sstable_job_status(const common::ObTabletID &tablet_id,
|
||||
|
@ -55,7 +55,6 @@ public:
|
||||
INHERIT_TO_STRING_KV("ObDDLRedefinitionTask", ObDDLRedefinitionTask,
|
||||
K(has_rebuild_index_), K(has_rebuild_constraint_), K(has_rebuild_foreign_key_), K(is_sstable_complete_task_submitted_));
|
||||
private:
|
||||
int wait_data_complement(const share::ObDDLTaskStatus next_task_status);
|
||||
int copy_table_dependent_objects(const share::ObDDLTaskStatus next_task_status);
|
||||
int take_effect(const share::ObDDLTaskStatus next_task_status);
|
||||
int copy_table_indexes();
|
||||
|
@ -94,7 +94,7 @@ int ObDDLSingleReplicaExecutor::schedule_task()
|
||||
ObDDLBuildSingleReplicaRequestProxy proxy(*rpc_proxy,
|
||||
&obrpc::ObSrvRpcProxy::build_ddl_single_replica_request);
|
||||
common::ObIArray<ObPartitionBuildInfo> &build_infos = partition_build_stat_;
|
||||
ObArray<int64_t> idxs;
|
||||
ObArray<int64_t> idxs; // to record the tablets position in build_infos that need to be scheduled.
|
||||
const int64_t current_time = ObTimeUtility::current_time();
|
||||
int64_t rpc_timeout = ObDDLUtil::get_default_ddl_rpc_timeout();
|
||||
const bool force_renew = true;
|
||||
@ -119,6 +119,8 @@ int ObDDLSingleReplicaExecutor::schedule_task()
|
||||
LOG_WARN("push back failed", K(ret));
|
||||
} else if (OB_FAIL(request_tablet_task_ids.push_back(tablet_task_ids_.at(i)))) {
|
||||
LOG_WARN("push back failed", K(ret));
|
||||
} else if (OB_FAIL(idxs.push_back(i))) {
|
||||
LOG_WARN("fail to push back idx", K(ret));
|
||||
} else {
|
||||
build_info.stat_ = ObPartitionBuildStat::BUILD_INIT;
|
||||
}
|
||||
@ -165,8 +167,6 @@ int ObDDLSingleReplicaExecutor::schedule_task()
|
||||
} else if (FALSE_IT(arg.dest_ls_id_ = dest_ls_id)) {
|
||||
} else if (OB_FAIL(proxy.call(dest_leader_addr, rpc_timeout, dest_tenant_id_, arg))) {
|
||||
LOG_WARN("fail to send rpc", K(ret), K(rpc_timeout));
|
||||
} else if (OB_FAIL(idxs.push_back(i))) {
|
||||
LOG_WARN("fail to push back idx", K(ret));
|
||||
} else {
|
||||
LOG_INFO("send build single replica request", K(arg), K(dest_leader_addr));
|
||||
}
|
||||
|
Reference in New Issue
Block a user