ignore schema version when load ddl error message
This commit is contained in:
@ -966,8 +966,8 @@ int ObDDLTask::report_error_code(const ObString &forward_user_message, const int
|
||||
const bool is_ddl_retry_task = is_drop_schema_block_concurrent_trans(task_type_);
|
||||
if (OB_SUCCESS != ret_code_) {
|
||||
if (OB_FAIL(ObDDLErrorMessageTableOperator::load_ddl_user_error(tenant_id_, task_id_, object_id_,
|
||||
schema_version_, *GCTX.sql_proxy_, error_message))) {
|
||||
LOG_WARN("load ddl user error failed", K(ret), K(object_id_), K(schema_version_), K(error_message));
|
||||
*GCTX.sql_proxy_, error_message))) {
|
||||
LOG_WARN("load ddl user error failed", K(ret), K(tenant_id_), K(task_id_), K(object_id_));
|
||||
if (OB_ITER_END == ret) { // no single replica error message found, use ret_code_
|
||||
ret = OB_SUCCESS;
|
||||
if (is_oracle_mode && DDL_CREATE_INDEX != task_type_ && OB_ERR_DUPLICATED_UNIQUE_KEY == ret_code_) {
|
||||
|
@ -145,31 +145,30 @@ int ObDDLErrorMessageTableOperator::extract_index_key(const ObTableSchema &index
|
||||
int ObDDLErrorMessageTableOperator::load_ddl_user_error(const uint64_t tenant_id,
|
||||
const int64_t task_id,
|
||||
const uint64_t table_id,
|
||||
const int64_t schema_version,
|
||||
ObMySQLProxy &sql_proxy,
|
||||
ObBuildDDLErrorMessage &error_message)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObSqlString sql;
|
||||
LOG_INFO("begin to load ddl user error", K(tenant_id), K(task_id), K(table_id), K(schema_version));
|
||||
LOG_INFO("begin to load ddl user error", K(tenant_id), K(task_id), K(table_id));
|
||||
SMART_VAR(ObMySQLProxy::MySQLResult, res) {
|
||||
const uint64_t exec_tenant_id = ObSchemaUtils::get_exec_tenant_id(tenant_id);
|
||||
sqlclient::ObMySQLResult *result = NULL;
|
||||
if (OB_UNLIKELY(OB_INVALID_ID == tenant_id || task_id <= 0 || OB_INVALID_ID == table_id
|
||||
|| OB_INVALID_VERSION == schema_version || nullptr != error_message.user_message_)) {
|
||||
|| nullptr != error_message.user_message_)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid arguments", K(ret), K(tenant_id), K(task_id), K(table_id), K(schema_version));
|
||||
LOG_WARN("invalid arguments", K(ret), K(tenant_id), K(task_id), K(table_id));
|
||||
} else if (OB_FAIL(sql.assign_fmt(
|
||||
"SELECT ret_code, ddl_type, affected_rows, user_message, dba_message from %s WHERE tenant_id = %ld AND "
|
||||
"task_id = %ld AND object_id = %ld AND schema_version = %ld", OB_ALL_DDL_ERROR_MESSAGE_TNAME,
|
||||
"task_id = %ld AND object_id = %ld", OB_ALL_DDL_ERROR_MESSAGE_TNAME,
|
||||
ObSchemaUtils::get_extract_tenant_id(exec_tenant_id, tenant_id),
|
||||
task_id, ObSchemaUtils::get_extract_schema_id(exec_tenant_id, table_id), schema_version))) {
|
||||
task_id, ObSchemaUtils::get_extract_schema_id(exec_tenant_id, table_id)))) {
|
||||
LOG_WARN("fail to assign sql", K(ret));
|
||||
} else if (OB_FAIL(sql_proxy.read(res, tenant_id, sql.ptr()))) {
|
||||
LOG_WARN("fail to execute sql", K(ret), K(sql));
|
||||
} else if (OB_ISNULL(result = res.get_result())) {
|
||||
ret = OB_ITER_END;
|
||||
LOG_INFO("single replica has not reported before", K(ret), K(table_id), K(schema_version));
|
||||
LOG_INFO("single replica has not reported before", K(ret), K(table_id));
|
||||
} else {
|
||||
while (OB_SUCC(ret)) {
|
||||
if (OB_FAIL(result->next())) {
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
static int extract_index_key(const share::schema::ObTableSchema &index_schema, const common::ObStoreRowkey &index_key,
|
||||
char *buffer, const int64_t buffer_len);
|
||||
static int load_ddl_user_error(const uint64_t tenant_id, const int64_t task_id, const uint64_t table_id,
|
||||
const int64_t schema_version, common::ObMySQLProxy &sql_proxy, ObBuildDDLErrorMessage &error_message);
|
||||
common::ObMySQLProxy &sql_proxy, ObBuildDDLErrorMessage &error_message);
|
||||
static int get_ddl_error_message(const uint64_t tenant_id, const int64_t task_id, const int64_t target_object_id,
|
||||
const common::ObAddr &addr, const bool is_ddl_retry_task, common::ObMySQLProxy &sql_proxy, ObBuildDDLErrorMessage &error_message,
|
||||
int64_t &forward_user_msg_len);
|
||||
|
Reference in New Issue
Block a user