From 4c2d565222309ec820d5d89750eb776008ce2502 Mon Sep 17 00:00:00 2001 From: bobhan1 Date: Mon, 15 Jul 2024 17:45:06 +0800 Subject: [PATCH 1/4] tmp --- be/src/olap/push_handler.cpp | 4 ++++ .../org/apache/doris/master/MasterImpl.java | 3 ++- .../test_delete_from_timeout.out | 8 +++++++ .../test_delete_from_timeout.groovy | 21 ++++++++++++++++--- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 regression-test/data/fault_injection_p0/test_delete_from_timeout.out diff --git a/be/src/olap/push_handler.cpp b/be/src/olap/push_handler.cpp index 248ed10d05cc00..feb7d24dda2705 100644 --- a/be/src/olap/push_handler.cpp +++ b/be/src/olap/push_handler.cpp @@ -117,6 +117,10 @@ Status PushHandler::_do_streaming_ingestion(TabletSharedPtr tablet, const TPushR } std::shared_lock base_migration_rlock(tablet->get_migration_lock(), std::try_to_lock); + DBUG_EXECUTE_IF("PushHandler::_do_streaming_ingestion.try_lock_fail", { + return Status::Error( + "PushHandler::_do_streaming_ingestion get lock failed"); + }) if (!base_migration_rlock.owns_lock()) { return Status::Error( "PushHandler::_do_streaming_ingestion get lock failed"); diff --git a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java index 47e6f1cb30362e..8c6930452d9d9d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java +++ b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java @@ -314,7 +314,8 @@ private void finishRealtimePush(AgentTask task, TFinishTaskRequest request) thro // DeleteHandler may return status code DELETE_INVALID_CONDITION and DELETE_INVALID_PARAMETERS, // we don't need to retry if meet them. // note that they will be converted to TStatusCode.INTERNAL_ERROR when being sent from be to fe - if (request.getTaskStatus().getStatusCode() == TStatusCode.INTERNAL_ERROR) { + if (request.getTaskStatus().getStatusCode() == TStatusCode.INTERNAL_ERROR + && !request.getTaskStatus().getErrorMsgs().toString().contains("get lock failed")) { pushTask.countDownToZero(request.getTaskStatus().getStatusCode(), task.getBackendId() + ": " + request.getTaskStatus().getErrorMsgs().toString()); AgentTaskQueue.removeTask(backendId, TTaskType.REALTIME_PUSH, signature); diff --git a/regression-test/data/fault_injection_p0/test_delete_from_timeout.out b/regression-test/data/fault_injection_p0/test_delete_from_timeout.out new file mode 100644 index 00000000000000..1703506a5af17b --- /dev/null +++ b/regression-test/data/fault_injection_p0/test_delete_from_timeout.out @@ -0,0 +1,8 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !sql -- +false -9999782574499444.2 -25 +true 99.9 234 + +-- !sql -- +true 99.9 234 + diff --git a/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy b/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy index 2d5bf41b3db34f..9681387d260403 100644 --- a/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy +++ b/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy @@ -34,7 +34,8 @@ suite("test_delete_from_timeout","nonConcurrent") { GetDebugPoint().clearDebugPointsForAllBEs() try { - sql "insert into ${tableName} values(1, 99.9, 234);" + sql "insert into ${tableName} values(1, 99.9, 234), (false, -9999782574499444.2, -25);" + qt_sql "select * from ${tableName} order by col1, col2, col3;" GetDebugPoint().enableDebugPointForAllBEs("DeleteHandler::generate_delete_predicate.inject_failure", [error_code: -1900 /* DELETE_INVALID_CONDITION */, error_msg: "data type is float or double."]) test { @@ -50,10 +51,24 @@ suite("test_delete_from_timeout","nonConcurrent") { sql """delete from ${tableName} where col1 = "false" and col2 = "-9999782574499444.2" and col3 = "-25"; """ exception "invalid parameters for store_cond. condition_size=1" } + + GetDebugPoint().clearDebugPointsForAllBEs() + + GetDebugPoint().enableDebugPointForAllBEs("PushHandler::_do_streaming_ingestion.try_lock_fail") + + t1 = Thread.start { + sleep(15000) + GetDebugPoint().disableDebugPointForAllBEs("PushHandler::_do_streaming_ingestion.try_lock_fail") + } + + sql """delete from ${tableName} where col1 = "false" and col2 = "-9999782574499444.2" and col3 = "-25"; """ + t1.join() + qt_sql "select * from ${tableName} order by col1, col2, col3;" + } catch (Exception e) { logger.info(e.getMessage()) - AssertTrue(false) + assertTrue(false) } finally { - GetDebugPoint().disableDebugPointForAllBEs("DeleteHandler::generate_delete_predicate.inject_failure") + GetDebugPoint().clearDebugPointsForAllBEs() } } \ No newline at end of file From 27a870281d1bfb2b60c5ab44d772df3d8e05d887 Mon Sep 17 00:00:00 2001 From: bobhan1 Date: Tue, 16 Jul 2024 10:35:38 +0800 Subject: [PATCH 2/4] fix --- be/src/olap/delete_handler.cpp | 37 +++++++++++-------- .../org/apache/doris/master/MasterImpl.java | 18 +++++---- .../test_delete_from_timeout.groovy | 4 +- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/be/src/olap/delete_handler.cpp b/be/src/olap/delete_handler.cpp index d40e7faafc23e0..5d62ba5dd7234e 100644 --- a/be/src/olap/delete_handler.cpp +++ b/be/src/olap/delete_handler.cpp @@ -97,7 +97,8 @@ Status DeleteHandler::generate_delete_predicate(const TabletSchema& schema, }) if (conditions.empty()) { return Status::Error( - "invalid parameters for store_cond. condition_size={}", conditions.size()); + "DELETE_INVALID_PARAMETERS: invalid parameters for store_cond. condition_size={}", + conditions.size()); } // Check whether the delete condition meets the requirements @@ -128,7 +129,8 @@ Status DeleteHandler::generate_delete_predicate(const TabletSchema& schema, LOG(WARNING) << "failed to parse condition_str, condtion=" << ThriftDebugString(condition); return Status::Error( - "failed to parse condition_str, condtion={}", ThriftDebugString(condition)); + "DELETE_INVALID_CONDITION: failed to parse condition_str, condtion={}", + ThriftDebugString(condition)); } VLOG_NOTICE << __PRETTY_FUNCTION__ << " condition_str: " << condition_str; del_pred->add_sub_predicates(condition_str); @@ -235,8 +237,8 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC // Check whether the column exists int32_t field_index = schema.field_index(cond.column_name); if (field_index < 0) { - return Status::Error("field is not existent. [field_index={}]", - field_index); + return Status::Error( + "DELETE_INVALID_CONDITION: field is not existent. [field_index={}]", field_index); } // Delete condition should only applied on key columns or duplicate key table, and @@ -245,21 +247,24 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC if (column.type() == FieldType::OLAP_FIELD_TYPE_DOUBLE || column.type() == FieldType::OLAP_FIELD_TYPE_FLOAT) { - return Status::Error("data type is float or double."); + return Status::Error( + "DELETE_INVALID_CONDITION: data type is float or double."); } // Check operator and operands size are matched. if ("*=" != cond.condition_op && "!*=" != cond.condition_op && cond.condition_values.size() != 1) { - return Status::Error("invalid condition value size. [size={}]", - cond.condition_values.size()); + return Status::Error( + "DELETE_INVALID_CONDITION: invalid condition value size. [size={}]", + cond.condition_values.size()); } // Check each operand is valid for (const auto& condition_value : cond.condition_values) { if (!is_condition_value_valid(column, cond.condition_op, condition_value)) { - return Status::Error("invalid condition value. [value={}]", - condition_value); + return Status::Error( + "DELETE_INVALID_CONDITION: invalid condition value. [value={}]", + condition_value); } } @@ -270,14 +275,16 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC return Status::OK(); } if (schema.field_index(cond.column_unique_id) == -1) { - const auto& err_msg = - fmt::format("column id does not exists in table={}, schema version={},", - schema.table_id(), schema.schema_version()); + const auto& err_msg = fmt::format( + "DELETE_INVALID_CONDITION: column id does not exists in table={}, schema " + "version={},", + schema.table_id(), schema.schema_version()); return Status::Error(err_msg); } if (!iequal(schema.column_by_uid(cond.column_unique_id).name(), cond.column_name)) { const auto& err_msg = fmt::format( - "colum name={} does not belongs to column uid={}, which column name={}, " + "DELETE_INVALID_CONDITION: colum name={} does not belongs to column uid={}, which " + "column name={}, " "delete_cond.column_name ={}", cond.column_name, cond.column_unique_id, schema.column_by_uid(cond.column_unique_id).name(), cond.column_name); @@ -290,8 +297,8 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC Status DeleteHandler::parse_condition(const DeleteSubPredicatePB& sub_cond, TCondition* condition) { if (!sub_cond.has_column_name() || !sub_cond.has_op() || !sub_cond.has_cond_value()) { return Status::Error( - "fail to parse condition. condition={} {} {}", sub_cond.column_name(), - sub_cond.op(), sub_cond.cond_value()); + "DELETE_INVALID_PARAMETERS: fail to parse condition. condition={} {} {}", + sub_cond.column_name(), sub_cond.op(), sub_cond.cond_value()); } if (sub_cond.has_column_unique_id()) { condition->column_unique_id = sub_cond.column_unique_id(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java index 8c6930452d9d9d..39d69047842863 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java +++ b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java @@ -311,15 +311,17 @@ private void finishRealtimePush(AgentTask task, TFinishTaskRequest request) thro if (request.getTaskStatus().getStatusCode() != TStatusCode.OK) { if (pushTask.getPushType() == TPushType.DELETE) { - // DeleteHandler may return status code DELETE_INVALID_CONDITION and DELETE_INVALID_PARAMETERS, - // we don't need to retry if meet them. + // we don't need to retry if the returned status code is DELETE_INVALID_CONDITION + // or DELETE_INVALID_PARAMETERS // note that they will be converted to TStatusCode.INTERNAL_ERROR when being sent from be to fe - if (request.getTaskStatus().getStatusCode() == TStatusCode.INTERNAL_ERROR - && !request.getTaskStatus().getErrorMsgs().toString().contains("get lock failed")) { - pushTask.countDownToZero(request.getTaskStatus().getStatusCode(), - task.getBackendId() + ": " + request.getTaskStatus().getErrorMsgs().toString()); - AgentTaskQueue.removeTask(backendId, TTaskType.REALTIME_PUSH, signature); - LOG.warn("finish push replica error: {}", request.getTaskStatus().getErrorMsgs().toString()); + if (request.getTaskStatus().getStatusCode() == TStatusCode.INTERNAL_ERROR) { + String errMsg = request.getTaskStatus().getErrorMsgs().toString(); + if (errMsg.contains("DELETE_INVALID_CONDITION") || errMsg.contains("DELETE_INVALID_CONDITION")) { + pushTask.countDownToZero(request.getTaskStatus().getStatusCode(), + task.getBackendId() + ": " + request.getTaskStatus().getErrorMsgs().toString()); + AgentTaskQueue.removeTask(backendId, TTaskType.REALTIME_PUSH, signature); + LOG.warn("finish push replica error: {}", request.getTaskStatus().getErrorMsgs().toString()); + } } } return; diff --git a/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy b/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy index 9681387d260403..ac5bd2d93ed7d7 100644 --- a/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy +++ b/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy @@ -37,7 +37,7 @@ suite("test_delete_from_timeout","nonConcurrent") { sql "insert into ${tableName} values(1, 99.9, 234), (false, -9999782574499444.2, -25);" qt_sql "select * from ${tableName} order by col1, col2, col3;" GetDebugPoint().enableDebugPointForAllBEs("DeleteHandler::generate_delete_predicate.inject_failure", - [error_code: -1900 /* DELETE_INVALID_CONDITION */, error_msg: "data type is float or double."]) + [error_code: -1900 /* DELETE_INVALID_CONDITION */, error_msg: "DELETE_INVALID_CONDITION: data type is float or double."]) test { sql """delete from ${tableName} where col1 = "false" and col2 = "-9999782574499444.2" and col3 = "-25"; """ exception "data type is float or double." @@ -46,7 +46,7 @@ suite("test_delete_from_timeout","nonConcurrent") { GetDebugPoint().clearDebugPointsForAllBEs() GetDebugPoint().enableDebugPointForAllBEs("DeleteHandler::generate_delete_predicate.inject_failure", - [error_code: -1903 /* DELETE_INVALID_PARAMETERS */, error_msg: "invalid parameters for store_cond. condition_size=1"]) + [error_code: -1903 /* DELETE_INVALID_PARAMETERS */, error_msg: "DELETE_INVALID_PARAMETERS: invalid parameters for store_cond. condition_size=1"]) test { sql """delete from ${tableName} where col1 = "false" and col2 = "-9999782574499444.2" and col3 = "-25"; """ exception "invalid parameters for store_cond. condition_size=1" From 57aed7306e44a0f052942eea19fc6e9335cba3cd Mon Sep 17 00:00:00 2001 From: bobhan1 Date: Tue, 16 Jul 2024 12:10:02 +0800 Subject: [PATCH 3/4] fix --- be/src/common/status.cpp | 6 +++- be/src/olap/delete_handler.cpp | 31 ++++++++----------- .../org/apache/doris/master/MasterImpl.java | 15 ++++----- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/be/src/common/status.cpp b/be/src/common/status.cpp index d17e18951c5615..4c641c80fd31f5 100644 --- a/be/src/common/status.cpp +++ b/be/src/common/status.cpp @@ -33,7 +33,11 @@ void Status::to_thrift(TStatus* s) const { // DCHECK(_code > 0) // << "The error code has to > 0 because TStatusCode need it > 0, it's actual value is " // << _code; - s->status_code = (int16_t)_code > 0 ? (TStatusCode::type)_code : TStatusCode::INTERNAL_ERROR; + s->status_code = (int16_t)_code > 0 ? (TStatusCode::type)_code + : ((_code == ErrorCode::DELETE_INVALID_CONDITION || + _code == ErrorCode::DELETE_INVALID_PARAMETERS) + ? TStatusCode::INVALID_ARGUMENT + : TStatusCode::INTERNAL_ERROR); s->error_msgs.push_back(fmt::format("({})[{}]{}", BackendOptions::get_localhost(), code_as_string(), _err_msg ? _err_msg->_msg : "")); s->__isset.error_msgs = true; diff --git a/be/src/olap/delete_handler.cpp b/be/src/olap/delete_handler.cpp index 5d62ba5dd7234e..c19f64b3990730 100644 --- a/be/src/olap/delete_handler.cpp +++ b/be/src/olap/delete_handler.cpp @@ -97,8 +97,7 @@ Status DeleteHandler::generate_delete_predicate(const TabletSchema& schema, }) if (conditions.empty()) { return Status::Error( - "DELETE_INVALID_PARAMETERS: invalid parameters for store_cond. condition_size={}", - conditions.size()); + "invalid parameters for store_cond. condition_size={}", conditions.size()); } // Check whether the delete condition meets the requirements @@ -129,8 +128,7 @@ Status DeleteHandler::generate_delete_predicate(const TabletSchema& schema, LOG(WARNING) << "failed to parse condition_str, condtion=" << ThriftDebugString(condition); return Status::Error( - "DELETE_INVALID_CONDITION: failed to parse condition_str, condtion={}", - ThriftDebugString(condition)); + "failed to parse condition_str, condtion={}", ThriftDebugString(condition)); } VLOG_NOTICE << __PRETTY_FUNCTION__ << " condition_str: " << condition_str; del_pred->add_sub_predicates(condition_str); @@ -237,8 +235,8 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC // Check whether the column exists int32_t field_index = schema.field_index(cond.column_name); if (field_index < 0) { - return Status::Error( - "DELETE_INVALID_CONDITION: field is not existent. [field_index={}]", field_index); + return Status::Error("field is not existent. [field_index={}]", + field_index); } // Delete condition should only applied on key columns or duplicate key table, and @@ -247,24 +245,21 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC if (column.type() == FieldType::OLAP_FIELD_TYPE_DOUBLE || column.type() == FieldType::OLAP_FIELD_TYPE_FLOAT) { - return Status::Error( - "DELETE_INVALID_CONDITION: data type is float or double."); + return Status::Error("data type is float or double."); } // Check operator and operands size are matched. if ("*=" != cond.condition_op && "!*=" != cond.condition_op && cond.condition_values.size() != 1) { - return Status::Error( - "DELETE_INVALID_CONDITION: invalid condition value size. [size={}]", - cond.condition_values.size()); + return Status::Error("invalid condition value size. [size={}]", + cond.condition_values.size()); } // Check each operand is valid for (const auto& condition_value : cond.condition_values) { if (!is_condition_value_valid(column, cond.condition_op, condition_value)) { - return Status::Error( - "DELETE_INVALID_CONDITION: invalid condition value. [value={}]", - condition_value); + return Status::Error("invalid condition value. [value={}]", + condition_value); } } @@ -276,14 +271,14 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC } if (schema.field_index(cond.column_unique_id) == -1) { const auto& err_msg = fmt::format( - "DELETE_INVALID_CONDITION: column id does not exists in table={}, schema " + "column id does not exists in table={}, schema " "version={},", schema.table_id(), schema.schema_version()); return Status::Error(err_msg); } if (!iequal(schema.column_by_uid(cond.column_unique_id).name(), cond.column_name)) { const auto& err_msg = fmt::format( - "DELETE_INVALID_CONDITION: colum name={} does not belongs to column uid={}, which " + "colum name={} does not belongs to column uid={}, which " "column name={}, " "delete_cond.column_name ={}", cond.column_name, cond.column_unique_id, @@ -297,8 +292,8 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC Status DeleteHandler::parse_condition(const DeleteSubPredicatePB& sub_cond, TCondition* condition) { if (!sub_cond.has_column_name() || !sub_cond.has_op() || !sub_cond.has_cond_value()) { return Status::Error( - "DELETE_INVALID_PARAMETERS: fail to parse condition. condition={} {} {}", - sub_cond.column_name(), sub_cond.op(), sub_cond.cond_value()); + "fail to parse condition. condition={} {} {}", sub_cond.column_name(), + sub_cond.op(), sub_cond.cond_value()); } if (sub_cond.has_column_unique_id()) { condition->column_unique_id = sub_cond.column_unique_id(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java index 39d69047842863..54a05da9549d1d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java +++ b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java @@ -313,15 +313,12 @@ private void finishRealtimePush(AgentTask task, TFinishTaskRequest request) thro if (pushTask.getPushType() == TPushType.DELETE) { // we don't need to retry if the returned status code is DELETE_INVALID_CONDITION // or DELETE_INVALID_PARAMETERS - // note that they will be converted to TStatusCode.INTERNAL_ERROR when being sent from be to fe - if (request.getTaskStatus().getStatusCode() == TStatusCode.INTERNAL_ERROR) { - String errMsg = request.getTaskStatus().getErrorMsgs().toString(); - if (errMsg.contains("DELETE_INVALID_CONDITION") || errMsg.contains("DELETE_INVALID_CONDITION")) { - pushTask.countDownToZero(request.getTaskStatus().getStatusCode(), - task.getBackendId() + ": " + request.getTaskStatus().getErrorMsgs().toString()); - AgentTaskQueue.removeTask(backendId, TTaskType.REALTIME_PUSH, signature); - LOG.warn("finish push replica error: {}", request.getTaskStatus().getErrorMsgs().toString()); - } + // note that they will be converted to TStatusCode.INVALID_ARGUMENT when being sent from be to fe + if (request.getTaskStatus().getStatusCode() == TStatusCode.INVALID_ARGUMENT) { + pushTask.countDownToZero(request.getTaskStatus().getStatusCode(), + task.getBackendId() + ": " + request.getTaskStatus().getErrorMsgs().toString()); + AgentTaskQueue.removeTask(backendId, TTaskType.REALTIME_PUSH, signature); + LOG.warn("finish push replica error: {}", request.getTaskStatus().getErrorMsgs().toString()); } } return; From 3ffbf3ab4988e4f19d50294ce8ab2199288447b1 Mon Sep 17 00:00:00 2001 From: bobhan1 Date: Tue, 16 Jul 2024 13:58:07 +0800 Subject: [PATCH 4/4] fix --- be/src/common/status.cpp | 6 +--- be/src/olap/delete_handler.cpp | 35 +++++++++---------- .../test_delete_from_timeout.groovy | 10 +----- 3 files changed, 19 insertions(+), 32 deletions(-) diff --git a/be/src/common/status.cpp b/be/src/common/status.cpp index 4c641c80fd31f5..d17e18951c5615 100644 --- a/be/src/common/status.cpp +++ b/be/src/common/status.cpp @@ -33,11 +33,7 @@ void Status::to_thrift(TStatus* s) const { // DCHECK(_code > 0) // << "The error code has to > 0 because TStatusCode need it > 0, it's actual value is " // << _code; - s->status_code = (int16_t)_code > 0 ? (TStatusCode::type)_code - : ((_code == ErrorCode::DELETE_INVALID_CONDITION || - _code == ErrorCode::DELETE_INVALID_PARAMETERS) - ? TStatusCode::INVALID_ARGUMENT - : TStatusCode::INTERNAL_ERROR); + s->status_code = (int16_t)_code > 0 ? (TStatusCode::type)_code : TStatusCode::INTERNAL_ERROR; s->error_msgs.push_back(fmt::format("({})[{}]{}", BackendOptions::get_localhost(), code_as_string(), _err_msg ? _err_msg->_msg : "")); s->__isset.error_msgs = true; diff --git a/be/src/olap/delete_handler.cpp b/be/src/olap/delete_handler.cpp index c19f64b3990730..6819d7d90f3ef7 100644 --- a/be/src/olap/delete_handler.cpp +++ b/be/src/olap/delete_handler.cpp @@ -96,7 +96,7 @@ Status DeleteHandler::generate_delete_predicate(const TabletSchema& schema, dp->param("error_msg")); }) if (conditions.empty()) { - return Status::Error( + return Status::Error( "invalid parameters for store_cond. condition_size={}", conditions.size()); } @@ -127,7 +127,7 @@ Status DeleteHandler::generate_delete_predicate(const TabletSchema& schema, if (TCondition tmp; !DeleteHandler::parse_condition(condition_str, &tmp)) { LOG(WARNING) << "failed to parse condition_str, condtion=" << ThriftDebugString(condition); - return Status::Error( + return Status::Error( "failed to parse condition_str, condtion={}", ThriftDebugString(condition)); } VLOG_NOTICE << __PRETTY_FUNCTION__ << " condition_str: " << condition_str; @@ -235,8 +235,8 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC // Check whether the column exists int32_t field_index = schema.field_index(cond.column_name); if (field_index < 0) { - return Status::Error("field is not existent. [field_index={}]", - field_index); + return Status::Error("field is not existent. [field_index={}]", + field_index); } // Delete condition should only applied on key columns or duplicate key table, and @@ -245,21 +245,21 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC if (column.type() == FieldType::OLAP_FIELD_TYPE_DOUBLE || column.type() == FieldType::OLAP_FIELD_TYPE_FLOAT) { - return Status::Error("data type is float or double."); + return Status::Error("data type is float or double."); } // Check operator and operands size are matched. if ("*=" != cond.condition_op && "!*=" != cond.condition_op && cond.condition_values.size() != 1) { - return Status::Error("invalid condition value size. [size={}]", - cond.condition_values.size()); + return Status::Error("invalid condition value size. [size={}]", + cond.condition_values.size()); } // Check each operand is valid for (const auto& condition_value : cond.condition_values) { if (!is_condition_value_valid(column, cond.condition_op, condition_value)) { - return Status::Error("invalid condition value. [value={}]", - condition_value); + return Status::Error("invalid condition value. [value={}]", + condition_value); } } @@ -270,11 +270,10 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC return Status::OK(); } if (schema.field_index(cond.column_unique_id) == -1) { - const auto& err_msg = fmt::format( - "column id does not exists in table={}, schema " - "version={},", - schema.table_id(), schema.schema_version()); - return Status::Error(err_msg); + const auto& err_msg = + fmt::format("column id does not exists in table={}, schema version={},", + schema.table_id(), schema.schema_version()); + return Status::Error(err_msg); } if (!iequal(schema.column_by_uid(cond.column_unique_id).name(), cond.column_name)) { const auto& err_msg = fmt::format( @@ -283,7 +282,7 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC "delete_cond.column_name ={}", cond.column_name, cond.column_unique_id, schema.column_by_uid(cond.column_unique_id).name(), cond.column_name); - return Status::Error(err_msg); + return Status::Error(err_msg); } return Status::OK(); @@ -291,7 +290,7 @@ Status DeleteHandler::check_condition_valid(const TabletSchema& schema, const TC Status DeleteHandler::parse_condition(const DeleteSubPredicatePB& sub_cond, TCondition* condition) { if (!sub_cond.has_column_name() || !sub_cond.has_op() || !sub_cond.has_cond_value()) { - return Status::Error( + return Status::Error( "fail to parse condition. condition={} {} {}", sub_cond.column_name(), sub_cond.op(), sub_cond.cond_value()); } @@ -337,8 +336,8 @@ Status DeleteHandler::parse_condition(const std::string& condition_str, TConditi << "]"; } if (!matched) { - return Status::Error("fail to sub condition. condition={}", - condition_str); + return Status::Error("fail to sub condition. condition={}", + condition_str); } condition->column_name = what[1].str(); diff --git a/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy b/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy index ac5bd2d93ed7d7..7d1efdc9782812 100644 --- a/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy +++ b/regression-test/suites/fault_injection_p0/test_delete_from_timeout.groovy @@ -36,17 +36,9 @@ suite("test_delete_from_timeout","nonConcurrent") { try { sql "insert into ${tableName} values(1, 99.9, 234), (false, -9999782574499444.2, -25);" qt_sql "select * from ${tableName} order by col1, col2, col3;" - GetDebugPoint().enableDebugPointForAllBEs("DeleteHandler::generate_delete_predicate.inject_failure", - [error_code: -1900 /* DELETE_INVALID_CONDITION */, error_msg: "DELETE_INVALID_CONDITION: data type is float or double."]) - test { - sql """delete from ${tableName} where col1 = "false" and col2 = "-9999782574499444.2" and col3 = "-25"; """ - exception "data type is float or double." - } - - GetDebugPoint().clearDebugPointsForAllBEs() GetDebugPoint().enableDebugPointForAllBEs("DeleteHandler::generate_delete_predicate.inject_failure", - [error_code: -1903 /* DELETE_INVALID_PARAMETERS */, error_msg: "DELETE_INVALID_PARAMETERS: invalid parameters for store_cond. condition_size=1"]) + [error_code: 33 /* INVALID_ARGUMENT */, error_msg: "invalid parameters for store_cond. condition_size=1"]) test { sql """delete from ${tableName} where col1 = "false" and col2 = "-9999782574499444.2" and col3 = "-25"; """ exception "invalid parameters for store_cond. condition_size=1"