From 7beb4f16690a718213ae8d0535a070b62757954e Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 14 Feb 2023 11:12:36 +0000 Subject: [PATCH] Fix refresh schema hang caused by mock fk parent table --- src/rootserver/ob_root_service.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rootserver/ob_root_service.cpp b/src/rootserver/ob_root_service.cpp index a77017ed7..abec431a1 100644 --- a/src/rootserver/ob_root_service.cpp +++ b/src/rootserver/ob_root_service.cpp @@ -3248,7 +3248,11 @@ int ObRootService::create_table(const ObCreateTableArg &arg, ObCreateTableRes &r if (OB_SUCC(ret)) { if (foreign_key_arg.is_parent_table_mock_) { uint64_t dup_name_mock_fk_parent_table_count = 0; - if (OB_FAIL(mock_fk_parent_table_map.get_refactored(foreign_key_arg.parent_table_, dup_name_mock_fk_parent_table_count))) { + if (NULL != parent_schema) { + ret = OB_ERR_PARALLEL_DDL_CONFLICT; + LOG_WARN("the mock parent table is conflict with the real parent table, need retry", + K(ret), K(foreign_key_arg), K(parent_schema->get_table_id())); + } else if (OB_FAIL(mock_fk_parent_table_map.get_refactored(foreign_key_arg.parent_table_, dup_name_mock_fk_parent_table_count))) { if (OB_HASH_NOT_EXIST == ret) { ret = OB_SUCCESS; if (OB_FAIL(mock_fk_parent_table_map.set_refactored(foreign_key_arg.parent_table_, ++dup_name_mock_fk_parent_table_count))) {