diff --git a/be/src/cloud/cloud_meta_mgr.cpp b/be/src/cloud/cloud_meta_mgr.cpp index 7ea501b602cb1d..bf0e777705e7b3 100644 --- a/be/src/cloud/cloud_meta_mgr.cpp +++ b/be/src/cloud/cloud_meta_mgr.cpp @@ -387,8 +387,8 @@ Status retry_rpc(std::string_view op_name, const Request& req, Response* res, res->status().msg()); } else if (res->status().code() == MetaServiceCode::KV_TXN_CONFLICT_RETRY_EXCEEDED_MAX_TIMES) { - return Status::Error("failed to {}: {}", op_name, - res->status().msg()); + return Status::Error( + "failed to {}: {}", op_name, res->status().msg()); } else if (res->status().code() != MetaServiceCode::KV_TXN_CONFLICT) { return Status::Error("failed to {}: {}", op_name, res->status().msg()); @@ -397,6 +397,10 @@ Status retry_rpc(std::string_view op_name, const Request& req, Response* res, } if (++retry_times > config::meta_service_rpc_retry_times) { + if (res->status().code() == MetaServiceCode::LOCK_CONFLICT) { + return Status::Error( + "failed to {}: {}", op_name, res->status().msg()); + } break; } diff --git a/be/src/cloud/cloud_schema_change_job.cpp b/be/src/cloud/cloud_schema_change_job.cpp index 75882aefc58081..81b07ff7e4c843 100644 --- a/be/src/cloud/cloud_schema_change_job.cpp +++ b/be/src/cloud/cloud_schema_change_job.cpp @@ -396,8 +396,7 @@ Status CloudSchemaChangeJob::_convert_historical_rowsets(const SchemaChangeParam std::srand(static_cast(std::time(nullptr))); int random_value = std::rand() % 100; if (random_value < 50) { - LOG(INFO) << "test txn conflict"; - return Status::Error("test txn conflict"); + return Status::Error("test txn conflict"); } }); auto st = _cloud_storage_engine.meta_mgr().commit_tablet_job(job, &finish_resp); diff --git a/be/src/common/status.h b/be/src/common/status.h index 2881878774b85f..0252ec8564feeb 100644 --- a/be/src/common/status.h +++ b/be/src/common/status.h @@ -78,7 +78,6 @@ namespace ErrorCode { TStatusError(NOT_MASTER, true); \ TStatusError(OBTAIN_LOCK_FAILED, false); \ TStatusError(SNAPSHOT_EXPIRED, false); \ - TStatusError(TXN_CONFLICT, false); \ TStatusError(DELETE_BITMAP_LOCK_ERROR, false); // E error_name, error_code, print_stacktrace #define APPLY_FOR_OLAP_ERROR_CODES(E) \ diff --git a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java index 50dfa0103fcf57..e919070b3f2391 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java +++ b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java @@ -580,10 +580,12 @@ protected void runRunningJob() throws AlterCancelException { for (AgentTask task : tasks) { int maxFailedTimes = 0; if (Config.isCloudMode() && Config.enable_schema_change_retry_in_cloud_mode) { - if (task.getErrorCode() != null && task.getErrorCode().equals(TStatusCode.TXN_CONFLICT)) { + if (task.getErrorCode() != null && task.getErrorCode() + .equals(TStatusCode.DELETE_BITMAP_LOCK_ERROR)) { maxFailedTimes = Config.schema_change_max_retry_time; } - LOG.warn("schema change task failed: {}, maxFailedTimes {}", task.getErrorMsg(), maxFailedTimes); + LOG.warn("schema change task failed: {}, set maxFailedTimes {}", task.getErrorMsg(), + maxFailedTimes); } if (task.getFailedTimes() > maxFailedTimes) { task.setFinished(true); diff --git a/gensrc/thrift/Status.thrift b/gensrc/thrift/Status.thrift index 7265ebb2032236..7bdafc59ddb3aa 100644 --- a/gensrc/thrift/Status.thrift +++ b/gensrc/thrift/Status.thrift @@ -108,8 +108,6 @@ enum TStatusCode { SNAPSHOT_EXPIRED = 75, - TXN_CONFLICT = 76, - // used for cloud DELETE_BITMAP_LOCK_ERROR = 100, // Not be larger than 200, see status.h