diff options
author | Nikolay Shestakov <tesseract@ydb.tech> | 2023-12-21 10:45:39 +0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-21 10:45:39 +0500 |
commit | 90031c183941d6dfedd3e2efef7809641fc90223 (patch) | |
tree | 01328cb8a3ef4a16c6db0229cac80383c4793507 | |
parent | 2f0b10a6842a50ce0577d7a41b83581310c1203e (diff) | |
download | ydb-90031c183941d6dfedd3e2efef7809641fc90223.tar.gz |
Replace Y_ABORT_UNLESS #2 (#603)
-rw-r--r-- | ydb/core/persqueue/partition_read.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ydb/core/persqueue/partition_read.cpp b/ydb/core/persqueue/partition_read.cpp index 12d7877153..7173ebbf2a 100644 --- a/ydb/core/persqueue/partition_read.cpp +++ b/ydb/core/persqueue/partition_read.cpp @@ -709,7 +709,8 @@ void TPartition::DoRead(TEvPQ::TEvRead::TPtr ev, TDuration waitQuotaTime, const const TString& user = read->ClientId; auto userInfo = UsersInfoStorage->GetIfExists(user); if(!userInfo) { - ReplyError(ctx, read->Cookie, NPersQueue::NErrorCode::BAD_REQUEST, TStringBuilder() << "cannot finish read request. Consumer " << read->ClientId << " is gone from partition"); + ReplyError(ctx, read->Cookie, NPersQueue::NErrorCode::BAD_REQUEST, + TStringBuilder() << "cannot finish read request. Consumer " << read->ClientId << " is gone from partition"); Send(ReadQuotaTrackerActor, new TEvPQ::TEvConsumerRemoved(user)); OnReadRequestFinished(read->Cookie, 0, user, ctx); return; @@ -757,7 +758,11 @@ void TPartition::DoRead(TEvPQ::TEvRead::TPtr ev, TDuration waitQuotaTime, const return; } - Y_ABORT_UNLESS(offset < EndOffset); + if (offset > EndOffset) { + ReplyError(ctx, read->Cookie, NPersQueue::NErrorCode::BAD_REQUEST, + TStringBuilder() << "Offset more than EndOffset. Offset=" << offset << ", EndOffset=" << EndOffset); + return; + } ProcessRead(ctx, std::move(info), cookie, false); } |