add parent_task_id for table_redefinition_task
This commit is contained in:
@ -1028,6 +1028,7 @@ int ObDDLScheduler::create_ddl_task(const ObCreateDDLTaskParam ¶m,
|
||||
param.dest_table_schema_,
|
||||
param.parallelism_,
|
||||
param.consumer_group_id_,
|
||||
param.parent_task_id_,
|
||||
param.task_id_,
|
||||
param.sub_task_trace_id_,
|
||||
static_cast<const obrpc::ObAlterTableArg *>(param.ddl_arg_),
|
||||
@ -1636,6 +1637,7 @@ int ObDDLScheduler::create_table_redefinition_task(
|
||||
const share::schema::ObTableSchema *dest_schema,
|
||||
const int64_t parallelism,
|
||||
const int64_t consumer_group_id,
|
||||
const int64_t parent_task_id,
|
||||
const int64_t task_id,
|
||||
const int32_t sub_task_trace_id,
|
||||
const obrpc::ObAlterTableArg *alter_table_arg,
|
||||
@ -1656,6 +1658,7 @@ int ObDDLScheduler::create_table_redefinition_task(
|
||||
LOG_WARN("fail to get target_cg_cnt", K(ret), K(dest_schema));
|
||||
} else if (OB_FAIL(redefinition_task.init(src_schema,
|
||||
dest_schema,
|
||||
parent_task_id,
|
||||
task_id,
|
||||
type,
|
||||
parallelism,
|
||||
|
||||
@ -393,6 +393,7 @@ private:
|
||||
const share::schema::ObTableSchema *dest_schema,
|
||||
const int64_t parallelism,
|
||||
const int64_t consumer_group_id,
|
||||
const int64_t parent_task_id,
|
||||
const int64_t task_id,
|
||||
const int32_t sub_task_trace_id,
|
||||
const obrpc::ObAlterTableArg *alter_table_arg,
|
||||
|
||||
@ -45,7 +45,7 @@ int ObDropPrimaryKeyTask::init(const ObTableSchema* src_table_schema, const ObTa
|
||||
const int64_t task_status,const int64_t snapshot_version )
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(ObTableRedefinitionTask::init(src_table_schema, dst_table_schema, task_id, ddl_type, parallelism, consumer_group_id,
|
||||
if (OB_FAIL(ObTableRedefinitionTask::init(src_table_schema, dst_table_schema, 0, task_id, ddl_type, parallelism, consumer_group_id,
|
||||
sub_task_trace_id, alter_table_arg, tenant_data_version, task_status, snapshot_version))) {
|
||||
LOG_WARN("fail to init ObDropPrimaryKeyTask", K(ret));
|
||||
} else {
|
||||
|
||||
@ -59,7 +59,7 @@ int ObRecoverRestoreTableTask::init(
|
||||
} else if (OB_UNLIKELY(ObDDLType::DDL_TABLE_RESTORE != ddl_type)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid arg", K(ret), K(ddl_type), KPC(src_table_schema), KPC(dst_table_schema));
|
||||
} else if (OB_FAIL(ObTableRedefinitionTask::init(src_table_schema, dst_table_schema, task_id, ddl_type, parallelism, consumer_group_id,
|
||||
} else if (OB_FAIL(ObTableRedefinitionTask::init(src_table_schema, dst_table_schema, 0, task_id, ddl_type, parallelism, consumer_group_id,
|
||||
sub_task_trace_id, alter_table_arg, tenant_data_version, task_status, 0/*snapshot*/))) {
|
||||
LOG_WARN("fail to init ObDropPrimaryKeyTask", K(ret));
|
||||
} else {
|
||||
|
||||
@ -47,9 +47,18 @@ ObTableRedefinitionTask::~ObTableRedefinitionTask()
|
||||
{
|
||||
}
|
||||
|
||||
int ObTableRedefinitionTask::init(const ObTableSchema* src_table_schema, const ObTableSchema* dst_table_schema, const int64_t task_id,
|
||||
const share::ObDDLType &ddl_type, const int64_t parallelism, const int64_t consumer_group_id, const int32_t sub_task_trace_id,
|
||||
const ObAlterTableArg &alter_table_arg, const uint64_t tenant_data_version, const int64_t task_status, const int64_t snapshot_version)
|
||||
int ObTableRedefinitionTask::init(const ObTableSchema* src_table_schema,
|
||||
const ObTableSchema* dst_table_schema,
|
||||
const int64_t parent_task_id,
|
||||
const int64_t task_id,
|
||||
const share::ObDDLType &ddl_type,
|
||||
const int64_t parallelism,
|
||||
const int64_t consumer_group_id,
|
||||
const int32_t sub_task_trace_id,
|
||||
const ObAlterTableArg &alter_table_arg,
|
||||
const uint64_t tenant_data_version,
|
||||
const int64_t task_status,
|
||||
const int64_t snapshot_version)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_UNLIKELY(is_inited_)) {
|
||||
@ -89,6 +98,7 @@ int ObTableRedefinitionTask::init(const ObTableSchema* src_table_schema, const O
|
||||
snapshot_version_ = snapshot_version;
|
||||
tenant_id_ = src_table_schema->get_tenant_id();
|
||||
task_version_ = OB_TABLE_REDEFINITION_TASK_VERSION;
|
||||
parent_task_id_ = parent_task_id;
|
||||
task_id_ = task_id;
|
||||
parallelism_ = parallelism;
|
||||
data_format_version_ = tenant_data_version;
|
||||
@ -154,6 +164,7 @@ int ObTableRedefinitionTask::init(const ObDDLTaskRecord &task_record)
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected err", K(ret), K(task_record), K(src_tenant_id), K(dst_tenant_id), K(src_schema_version), K(dst_schema_version));
|
||||
} else {
|
||||
parent_task_id_ = task_record.parent_task_id_;
|
||||
task_id_ = task_record.task_id_;
|
||||
object_id_ = data_table_id;
|
||||
target_object_id_ = dest_table_id;
|
||||
|
||||
@ -34,6 +34,7 @@ public:
|
||||
int init(
|
||||
const ObTableSchema* src_table_schema,
|
||||
const ObTableSchema* dst_table_schema,
|
||||
const int64_t parent_task_id,
|
||||
const int64_t task_id,
|
||||
const share::ObDDLType &ddl_type,
|
||||
const int64_t parallelism,
|
||||
|
||||
Reference in New Issue
Block a user