diff options
author | qyryq <qyryq@ydb.tech> | 2024-02-26 21:01:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-26 21:01:34 +0300 |
commit | 02bbc51aa2e196c3cd71ceed166b01cad667ac4c (patch) | |
tree | 53d942e17c5aaaf6b43974f420993e945ca15e29 | |
parent | f77d126c2df141a270542a0060cddde8eca8d7f0 (diff) | |
download | ydb-02bbc51aa2e196c3cd71ceed166b01cad667ac4c.tar.gz |
persqueue: add WRITE_ERROR_PARTITION_INACTIVE status code (#2241)
5 files changed, 7 insertions, 1 deletions
diff --git a/ydb/core/persqueue/partition_write.cpp b/ydb/core/persqueue/partition_write.cpp index 247f84710a6..9f56c2ca47b 100644 --- a/ydb/core/persqueue/partition_write.cpp +++ b/ydb/core/persqueue/partition_write.cpp @@ -29,7 +29,7 @@ static const ui32 BATCH_UNPACK_SIZE_BORDER = 500_KB; static const ui32 MAX_WRITE_CYCLE_SIZE = 16_MB; static const ui32 MAX_INLINE_SIZE = 1000; -static constexpr NPersQueue::NErrorCode::EErrorCode InactivePartitionErrorCode = NPersQueue::NErrorCode::WRITE_ERROR_PARTITION_IS_FULL; +static constexpr NPersQueue::NErrorCode::EErrorCode InactivePartitionErrorCode = NPersQueue::NErrorCode::WRITE_ERROR_PARTITION_INACTIVE; void TPartition::ReplyOwnerOk(const TActorContext& ctx, const ui64 dst, const TString& cookie, ui64 seqNo) { LOG_DEBUG_S(ctx, NKikimrServices::PERSQUEUE, "TPartition::ReplyOwnerOk. Partition: " << Partition); diff --git a/ydb/core/persqueue/ut/common/pq_ut_common.cpp b/ydb/core/persqueue/ut/common/pq_ut_common.cpp index 1b94c85818e..5aee82f0b91 100644 --- a/ydb/core/persqueue/ut/common/pq_ut_common.cpp +++ b/ydb/core/persqueue/ut/common/pq_ut_common.cpp @@ -589,6 +589,7 @@ void CmdWrite(TTestActorRuntime* runtime, ui64 tabletId, const TActorId& sender, if (error) { UNIT_ASSERT( + result->Record.GetErrorCode() == NPersQueue::NErrorCode::WRITE_ERROR_PARTITION_INACTIVE || result->Record.GetErrorCode() == NPersQueue::NErrorCode::WRITE_ERROR_PARTITION_IS_FULL || result->Record.GetErrorCode() == NPersQueue::NErrorCode::BAD_REQUEST || result->Record.GetErrorCode() == NPersQueue::NErrorCode::WRONG_COOKIE diff --git a/ydb/public/api/protos/draft/persqueue_error_codes.proto b/ydb/public/api/protos/draft/persqueue_error_codes.proto index 2e7e5c03529..8712a3264b1 100644 --- a/ydb/public/api/protos/draft/persqueue_error_codes.proto +++ b/ydb/public/api/protos/draft/persqueue_error_codes.proto @@ -12,6 +12,7 @@ enum EErrorCode { SOURCEID_DELETED = 24; WRITE_ERROR_PARTITION_IS_FULL = 5; + WRITE_ERROR_PARTITION_INACTIVE = 29; WRITE_ERROR_DISK_IS_FULL = 15; WRITE_ERROR_BAD_OFFSET = 19; diff --git a/ydb/public/api/protos/persqueue_error_codes_v1.proto b/ydb/public/api/protos/persqueue_error_codes_v1.proto index 94321dc08ad..b20885a42c5 100644 --- a/ydb/public/api/protos/persqueue_error_codes_v1.proto +++ b/ydb/public/api/protos/persqueue_error_codes_v1.proto @@ -15,6 +15,7 @@ enum ErrorCode { SOURCEID_DELETED = 500024; WRITE_ERROR_PARTITION_IS_FULL = 500005; + WRITE_ERROR_PARTITION_INACTIVE = 500029; WRITE_ERROR_DISK_IS_FULL = 500015; WRITE_ERROR_BAD_OFFSET = 500019; @@ -48,6 +49,8 @@ enum ErrorCode { TABLET_PIPE_DISCONNECTED = 500027; + SCHEMA_ERROR = 500028; + ERROR = 500100; INVALID_ARGUMENT = 500040; diff --git a/ydb/services/persqueue_v1/actors/persqueue_utils.cpp b/ydb/services/persqueue_v1/actors/persqueue_utils.cpp index 1d6ed8a4be1..8ce5b72f9bc 100644 --- a/ydb/services/persqueue_v1/actors/persqueue_utils.cpp +++ b/ydb/services/persqueue_v1/actors/persqueue_utils.cpp @@ -101,6 +101,7 @@ Ydb::StatusIds::StatusCode ConvertPersQueueInternalCodeToStatus(const Ydb::PersQ return Ydb::StatusIds::ABORTED; case OVERLOAD: case WRITE_ERROR_PARTITION_IS_FULL: + case WRITE_ERROR_PARTITION_INACTIVE: case WRITE_ERROR_DISK_IS_FULL: return Ydb::StatusIds::OVERLOADED; case BAD_REQUEST: |