From e0f019dd835f4afb789b8043921f03fde7aa1e3b Mon Sep 17 00:00:00 2001 From: Nikolay Shestakov Date: Mon, 1 Apr 2024 13:06:39 +0500 Subject: [PATCH] Fix test TTopicApiDescribes.DescribeTopic (#3288) --- .github/config/muted_ya.txt | 1 - ydb/core/persqueue/pq_impl.cpp | 23 +++++++++++++++-------- ydb/core/persqueue/pq_impl.h | 3 +++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/config/muted_ya.txt b/.github/config/muted_ya.txt index fb7dc7bc8193..2451352ee927 100644 --- a/.github/config/muted_ya.txt +++ b/.github/config/muted_ya.txt @@ -52,7 +52,6 @@ ydb/services/fq/ut_integration Yq_1.* ydb/services/keyvalue/ut KeyValueGRPCService.SimpleWriteRead ydb/services/keyvalue/ut KeyValueGRPCService.SimpleCopyUnexistedKey ydb/services/keyvalue/ut sole* -ydb/services/persqueue_v1/ut/describes_ut TTopicApiDescribes.DescribeTopic ydb/services/persqueue_v1/ut TPersQueueTest.CheckACLForGrpcWrite ydb/services/persqueue_v1/ut TPersQueueTest.SetupLockSession ydb/services/persqueue_v1/ut TPersQueueTest.TopicServiceCommitOffsetBadOffsets diff --git a/ydb/core/persqueue/pq_impl.cpp b/ydb/core/persqueue/pq_impl.cpp index 2f0fdd98b834..aeced7ea3dc4 100644 --- a/ydb/core/persqueue/pq_impl.cpp +++ b/ydb/core/persqueue/pq_impl.cpp @@ -1424,6 +1424,10 @@ void TPersQueue::Handle(TEvPQ::TEvInitComplete::TPtr& ev, const TActorContext& c if (!partitionId.IsSupportivePartition()) { ProcessCheckPartitionStatusRequests(partitionId); } + + if (allInitialized) { + ProcessStatusRequests(ctx); + } } void TPersQueue::Handle(TEvPQ::TEvError::TPtr& ev, const TActorContext& ctx) @@ -1789,18 +1793,20 @@ void TPersQueue::Handle(TEvPersQueue::TEvPartitionClientInfo::TPtr& ev, const TA } } +void TPersQueue::ProcessStatusRequests(const TActorContext &ctx) { + for (auto& ev : StatusRequests) { + Handle(ev, ctx); + } + StatusRequests.clear(); +} void TPersQueue::Handle(TEvPersQueue::TEvStatus::TPtr& ev, const TActorContext& ctx) { ReadBalancerActorId = ev->Sender; - if (!ConfigInited) { - THolder res = MakeHolder(); - auto& resp = res->Record; - resp.SetTabletId(TabletID()); - - ctx.Send(ev->Sender, res.Release()); - return; + if (!ConfigInited || !AllOriginalPartitionsInited()) { + StatusRequests.push_back(ev); + return; } ui32 cnt = 0; @@ -1810,8 +1816,9 @@ void TPersQueue::Handle(TEvPersQueue::TEvStatus::TPtr& ev, const TActorContext& TActorId ans = CreateStatusProxyActor(TabletID(), ev->Sender, cnt, ev->Cookie, ctx); for (auto& p : Partitions) { - if (!p.second.InitDone) + if (!p.second.InitDone) { continue; + } THolder event; if (ev->Get()->Record.GetConsumers().empty()) { event = MakeHolder(ans, ev->Get()->Record.HasClientId() ? ev->Get()->Record.GetClientId() : "", diff --git a/ydb/core/persqueue/pq_impl.h b/ydb/core/persqueue/pq_impl.h index c91fb71e7071..791ef7378ac5 100644 --- a/ydb/core/persqueue/pq_impl.h +++ b/ydb/core/persqueue/pq_impl.h @@ -429,6 +429,9 @@ class TPersQueue : public NKeyValue::TKeyValueFlat { void DestroySession(TPipeInfo& pipeInfo); bool UseMediatorTimeCast = true; + TVector StatusRequests; + void ProcessStatusRequests(const TActorContext &ctx); + THashMap> CheckPartitionStatusRequests; TMaybe TabletGeneration;