From 5aa44ebafac50335d9eb01d610eb39bdb1a1ba43 Mon Sep 17 00:00:00 2001 From: Konstantin Melekhov Date: Tue, 11 Nov 2025 19:19:58 +0000 Subject: [PATCH 1/2] Fix LastOffset bug in PQ --- ydb/core/persqueue/pqtablet/partition/partition_read.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ydb/core/persqueue/pqtablet/partition/partition_read.cpp b/ydb/core/persqueue/pqtablet/partition/partition_read.cpp index c7a8b25eaeaf..2ad472310470 100644 --- a/ydb/core/persqueue/pqtablet/partition/partition_read.cpp +++ b/ydb/core/persqueue/pqtablet/partition/partition_read.cpp @@ -504,6 +504,10 @@ TMaybe TReadInfo::AddBlobsFromBody(const TVector= LastOffset) { + needStop = true; + break; + } } else { ++PartNo; } @@ -640,6 +644,9 @@ TReadAnswer TReadInfo::FormAnswer( if (updateUsage(writeBlob)) { break; } + if (LastOffset && Offset >= LastOffset) { + break; + } } } From 8c236580e5ebd0da46db5f14ca06ca1e2223c80d Mon Sep 17 00:00:00 2001 From: Konstantin Melekhov Date: Wed, 12 Nov 2025 06:36:25 +0000 Subject: [PATCH 2/2] Fix test's canonical --- ydb/core/persqueue/ut/counters_ut.cpp | 2 ++ .../persqueue/ut/resources/counters_topics_extended.html | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ydb/core/persqueue/ut/counters_ut.cpp b/ydb/core/persqueue/ut/counters_ut.cpp index ebbe69473f1a..105855f47815 100644 --- a/ydb/core/persqueue/ut/counters_ut.cpp +++ b/ydb/core/persqueue/ut/counters_ut.cpp @@ -815,11 +815,13 @@ Y_UNIT_TEST(PartitionKeyCompaction) { group->GetNamedCounter("name", "topic.partition.write.lag_milliseconds_max", false)->Set(600); group->GetNamedCounter("name", "topic.partition.uptime_milliseconds_min", false)->Set(30000); group->GetNamedCounter("name", "topic.partition.write.lag_milliseconds_max", false)->Set(600); + group->GetNamedCounter("name", "topic.partition.read.throttled_microseconds_max", false)->Set(2000); group = group->GetSubgroup("consumer", "__ydb_compaction_consumer"); group->GetNamedCounter("name", "topic.partition.write.lag_milliseconds_max", false)->Set(200); group->GetNamedCounter("name", "topic.partition.end_to_end_lag_milliseconds_max", false)->Set(30000); group->GetNamedCounter("name", "topic.partition.read.throttled_microseconds_max", false)->Set(2000); group->GetNamedCounter("name", "topic.partition.read.idle_milliseconds_max", false)->Set(300); + group->GetNamedCounter("name", "topic.partition.read.lag_milliseconds_max", false)->Set(300); TStringStream countersStr; dbGroup->OutputHtml(countersStr); diff --git a/ydb/core/persqueue/ut/resources/counters_topics_extended.html b/ydb/core/persqueue/ut/resources/counters_topics_extended.html index 608ba6e9f52b..8c944b539f08 100644 --- a/ydb/core/persqueue/ut/resources/counters_topics_extended.html +++ b/ydb/core/persqueue/ut/resources/counters_topics_extended.html @@ -28,7 +28,7 @@ name=topic.partition.producers_count_max: 1 name=topic.partition.read.inflight_throttled_microseconds_max: 0 name=topic.partition.read.speed_limit_bytes_per_second: 20000000000 - name=topic.partition.read.throttled_microseconds_max: 148 + name=topic.partition.read.throttled_microseconds_max: 2000 name=topic.partition.read_without_consumer.speed_limit_bytes_per_second: 0 name=topic.partition.read_without_consumer.throttled_microseconds_max: 0 name=topic.partition.storage_bytes_max: 7549747200 @@ -53,12 +53,12 @@ name=topic.partition.committed_read_lag_milliseconds_max: 0 name=topic.partition.end_to_end_lag_milliseconds_max: 30000 name=topic.partition.read.idle_milliseconds_max: 300 - name=topic.partition.read.lag_messages_max: 0 - name=topic.partition.read.lag_milliseconds_max: 0 + name=topic.partition.read.lag_messages_max: 1 + name=topic.partition.read.lag_milliseconds_max: 300 name=topic.partition.read.speed_limit_bytes_per_second: 4194304 name=topic.partition.read.throttled_microseconds_max: 2000 name=topic.partition.write.lag_milliseconds_max: 200 - name=topic.read.lag_messages: 0 + name=topic.read.lag_messages: 1 consumer=client: name=topic.partition.alive_count: 0