fix ddl rpc timeout out

This commit is contained in:
Charles0429
2022-12-13 07:37:54 +00:00
committed by ob-robot
parent 700ed322cd
commit 9f87d6fb3b
11 changed files with 43 additions and 28 deletions

View File

@ -1076,14 +1076,15 @@ int ObConstraintTask::set_foreign_key_constraint_validated()
ObSArray<uint64_t> unused_ids;
alter_table_arg.ddl_task_type_ = share::MODIFY_FOREIGN_KEY_STATE_TASK;
alter_table_arg.hidden_table_id_ = object_id_;
if (OB_FAIL(root_service->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).
if (OB_FAIL(root_service->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
execute_ddl_task(alter_table_arg, unused_ids))) {
LOG_WARN("fail to alter table", K(ret), K(alter_table_arg), K(fk_arg));
}
} else {
if (OB_FAIL(ObDDLUtil::refresh_alter_table_arg(tenant_id_, object_id_, alter_table_arg))) {
LOG_WARN("failed to refresh name for alter table schema", K(ret));
} else if (OB_FAIL(root_service->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).alter_table(alter_table_arg, res))) {
} else if (OB_FAIL(root_service->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
alter_table(alter_table_arg, res))) {
LOG_WARN("alter table failed", K(ret));
}
}
@ -1146,7 +1147,8 @@ int ObConstraintTask::set_check_constraint_validated()
ObSArray<uint64_t> unused_ids;
alter_table_arg.ddl_task_type_ = share::MODIFY_NOT_NULL_COLUMN_STATE_TASK;
alter_table_arg.hidden_table_id_ = object_id_;
if (OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).execute_ddl_task(alter_table_arg, unused_ids))) {
if (OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
execute_ddl_task(alter_table_arg, unused_ids))) {
LOG_WARN("alter table failed", K(ret));
if (OB_TABLE_NOT_EXIST == ret) {
ret = OB_NO_NEED_UPDATE;
@ -1189,7 +1191,8 @@ int ObConstraintTask::set_check_constraint_validated()
}
DEBUG_SYNC(CONSTRAINT_BEFORE_SET_CHECK_CONSTRAINT_VALIDATED_BEFORE_ALTER_TABLE);
if (OB_FAIL(ret)) {
} else if (OB_FAIL(root_service->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).alter_table(alter_table_arg, res))) {
} else if (OB_FAIL(root_service->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
alter_table(alter_table_arg, res))) {
LOG_WARN("alter table failed", K(ret));
}
}
@ -1247,7 +1250,8 @@ int ObConstraintTask::set_new_not_null_column_validate()
}
}
if (OB_FAIL(ret)) {
} else if (OB_FAIL(root_service->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).alter_table(alter_table_arg, res))) {
} else if (OB_FAIL(root_service->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
alter_table(alter_table_arg, res))) {
LOG_WARN("alter table failed", K(ret));
} else {
LOG_TRACE("set new not null column validate", K(alter_table_arg));
@ -1339,7 +1343,8 @@ int ObConstraintTask::rollback_failed_check_constraint()
alter_table_arg.is_alter_columns_ = false;
alter_table_arg.index_arg_list_.reset();
alter_table_arg.foreign_key_arg_list_.reset();
if (OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).alter_table(alter_table_arg, tmp_res))) {
if (OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
alter_table(alter_table_arg, tmp_res))) {
LOG_WARN("alter table failed", K(ret));
if (OB_TABLE_NOT_EXIST == ret || OB_ERR_CANT_DROP_FIELD_OR_KEY == ret || OB_ERR_CONTRAINT_NOT_FOUND == ret) {
ret = OB_NO_NEED_UPDATE;
@ -1400,7 +1405,8 @@ int ObConstraintTask::rollback_failed_foregin_key()
ObSArray<uint64_t> unused_ids;
alter_table_arg.ddl_task_type_ = share::MODIFY_FOREIGN_KEY_STATE_TASK;
alter_table_arg.hidden_table_id_ = object_id_;
if (OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).execute_ddl_task(alter_table_arg, unused_ids))) {
if (OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
execute_ddl_task(alter_table_arg, unused_ids))) {
LOG_WARN("alter table failed", K(ret));
if (OB_TABLE_NOT_EXIST == ret || OB_ERR_CANT_DROP_FIELD_OR_KEY == ret) {
ret = OB_NO_NEED_UPDATE;
@ -1413,7 +1419,8 @@ int ObConstraintTask::rollback_failed_foregin_key()
} else {
LOG_WARN("failed to refresh name for alter table schema", K(ret));
}
} else if (OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).alter_table(alter_table_arg, tmp_res))) {
} else if (OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
alter_table(alter_table_arg, tmp_res))) {
LOG_WARN("alter table failed", K(ret));
if (OB_TABLE_NOT_EXIST == ret || OB_ERR_CANT_DROP_FIELD_OR_KEY == ret) {
ret = OB_NO_NEED_UPDATE;
@ -1495,7 +1502,7 @@ int ObConstraintTask::rollback_failed_add_not_null_columns()
}
}
if (OB_SUCC(ret)
&& OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).
&& OB_FAIL(root_service_->get_ddl_service().get_common_rpc()->to(obrpc::ObRpcProxy::myaddr_).timeout(ObDDLUtil::get_ddl_rpc_timeout()).
execute_ddl_task(alter_table_arg, objs))) {
LOG_WARN("alter table failed", K(ret));
if (OB_TABLE_NOT_EXIST == ret || OB_ERR_CANT_DROP_FIELD_OR_KEY == ret) {