Handling concurrent situation when table not exist

This commit is contained in:
obdev
2023-05-05 08:38:23 +00:00
committed by ob-robot
parent ca6db06a05
commit 2f20f6b81b
3 changed files with 9 additions and 0 deletions

View File

@ -16149,6 +16149,12 @@ int ObDDLService::check_db_and_table_is_exist(const obrpc::ObTruncateTableArg &a
LOG_WARN("truncate oracle tmp table not supported", LOG_WARN("truncate oracle tmp table not supported",
KR(ret), K(tenant_id), K(table_name), K(database_name)); KR(ret), K(tenant_id), K(table_name), K(database_name));
} }
} else if (OB_FAIL(ret) && OB_ITER_END == ret) {
ret = OB_TABLE_NOT_EXIST;
LOG_WARN("can not find table",
KR(ret), K(tenant_id), K(table_name), K(database_name));
LOG_USER_ERROR(OB_TABLE_NOT_EXIST, to_cstring(database_name),
to_cstring(table_name));
} }
} }
} }

View File

@ -458,6 +458,7 @@ class ObString;
ACT(MEMBERLIST_CHANGE_MEMBER,)\ ACT(MEMBERLIST_CHANGE_MEMBER,)\
ACT(BEFORE_CHECK_CLEAN_DRTASK,)\ ACT(BEFORE_CHECK_CLEAN_DRTASK,)\
ACT(BEFORE_UNIQ_TASK_RUN,)\ ACT(BEFORE_UNIQ_TASK_RUN,)\
ACT(BEFORE_PARELLEL_TRUNCATE,)\
ACT(MAX_DEBUG_SYNC_POINT,) ACT(MAX_DEBUG_SYNC_POINT,)
DECLARE_ENUM(ObDebugSyncPoint, debug_sync_point, OB_DEBUG_SYNC_POINT_DEF); DECLARE_ENUM(ObDebugSyncPoint, debug_sync_point, OB_DEBUG_SYNC_POINT_DEF);

View File

@ -53,6 +53,7 @@
#include "share/backup/ob_backup_io_adapter.h" #include "share/backup/ob_backup_io_adapter.h"
#include "share/external_table/ob_external_table_file_rpc_processor.h" #include "share/external_table/ob_external_table_file_rpc_processor.h"
#include "share/external_table/ob_external_table_utils.h" #include "share/external_table/ob_external_table_utils.h"
#include "share/ob_debug_sync.h"
namespace oceanbase namespace oceanbase
{ {
using namespace common; using namespace common;
@ -2081,6 +2082,7 @@ int ObTruncateTableExecutor::execute(ObExecContext &ctx, ObTruncateTableStmt &st
} else { } else {
int64_t start_time = ObTimeUtility::current_time(); int64_t start_time = ObTimeUtility::current_time();
while (OB_SUCC(ret)) { while (OB_SUCC(ret)) {
DEBUG_SYNC(BEFORE_PARELLEL_TRUNCATE);
if (OB_FAIL(common_rpc_proxy->truncate_table_v2(truncate_table_arg, res))) { if (OB_FAIL(common_rpc_proxy->truncate_table_v2(truncate_table_arg, res))) {
LOG_WARN("rpc proxy truncate table failed", K(ret)); LOG_WARN("rpc proxy truncate table failed", K(ret));
if ((OB_TRY_LOCK_ROW_CONFLICT == ret || OB_TIMEOUT == ret || OB_NOT_MASTER == ret if ((OB_TRY_LOCK_ROW_CONFLICT == ret || OB_TIMEOUT == ret || OB_NOT_MASTER == ret