This is an automated email from the ASF dual-hosted git repository.
gavinchou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new b1eb70d727c [fix](delete) Incorrect status handling in
CloudDeleteTask::execute() (#39428)
b1eb70d727c is described below
commit b1eb70d727c3294ec6d3c71f07e33345acedaf83
Author: Gavin Chou <[email protected]>
AuthorDate: Thu Aug 15 21:22:37 2024 +0800
[fix](delete) Incorrect status handling in CloudDeleteTask::execute()
(#39428)
Previous impl. always returns OK to user when commit_rowset for the
delete stmt. It may lead to missing delete predicate.
---
be/src/cloud/cloud_delete_task.cpp | 2 +-
be/src/cloud/cloud_meta_mgr.cpp | 3 +++
cloud/src/meta-service/meta_service_helper.h | 8 +++++---
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/be/src/cloud/cloud_delete_task.cpp
b/be/src/cloud/cloud_delete_task.cpp
index 210e89b838d..9c36e418d93 100644
--- a/be/src/cloud/cloud_delete_task.cpp
+++ b/be/src/cloud/cloud_delete_task.cpp
@@ -105,7 +105,7 @@ Status CloudDeleteTask::execute(CloudStorageEngine& engine,
const TPushReq& requ
request.timeout, nullptr);
}
- return Status::OK();
+ return st;
}
} // namespace doris
diff --git a/be/src/cloud/cloud_meta_mgr.cpp b/be/src/cloud/cloud_meta_mgr.cpp
index 88725b17786..2599a8c7b76 100644
--- a/be/src/cloud/cloud_meta_mgr.cpp
+++ b/be/src/cloud/cloud_meta_mgr.cpp
@@ -329,6 +329,9 @@ Status retry_rpc(std::string_view op_name, const Request&
req, Response* res,
error_msg = cntl.ErrorText();
} else if (res->status().code() == MetaServiceCode::OK) {
return Status::OK();
+ } else if (res->status().code() == MetaServiceCode::INVALID_ARGUMENT) {
+ return Status::Error<ErrorCode::INVALID_ARGUMENT, false>("failed
to {}: {}", op_name,
+
res->status().msg());
} else if (res->status().code() != MetaServiceCode::KV_TXN_CONFLICT) {
return Status::Error<ErrorCode::INTERNAL_ERROR, false>("failed to
{}: {}", op_name,
res->status().msg());
diff --git a/cloud/src/meta-service/meta_service_helper.h
b/cloud/src/meta-service/meta_service_helper.h
index 28958150070..664d400b236 100644
--- a/cloud/src/meta-service/meta_service_helper.h
+++ b/cloud/src/meta-service/meta_service_helper.h
@@ -124,9 +124,6 @@ inline MetaServiceCode cast_as(TxnErrorCode code) {
case TxnErrorCode::TXN_TIMEOUT:
case TxnErrorCode::TXN_INVALID_ARGUMENT:
case TxnErrorCode::TXN_UNIDENTIFIED_ERROR:
- case TxnErrorCode::TXN_KEY_TOO_LARGE:
- case TxnErrorCode::TXN_VALUE_TOO_LARGE:
- case TxnErrorCode::TXN_BYTES_TOO_LARGE:
if constexpr (category == ErrCategory::READ) {
return MetaServiceCode::KV_TXN_GET_ERR;
} else if constexpr (category == ErrCategory::CREATE) {
@@ -134,6 +131,11 @@ inline MetaServiceCode cast_as(TxnErrorCode code) {
} else {
return MetaServiceCode::KV_TXN_COMMIT_ERR;
}
+ [[fallthrough]];
+ case TxnErrorCode::TXN_KEY_TOO_LARGE:
+ case TxnErrorCode::TXN_VALUE_TOO_LARGE:
+ case TxnErrorCode::TXN_BYTES_TOO_LARGE:
+ return MetaServiceCode::INVALID_ARGUMENT;
default:
return MetaServiceCode::UNDEFINED_ERR;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]