Skip to content

Commit

Permalink
Fix test TTopicApiDescribes.DescribeTopic (ydb-platform#3288)
Browse files Browse the repository at this point in the history
  • Loading branch information
nshestakov authored Apr 1, 2024
1 parent 05cd065 commit e0f019d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/config/muted_ya.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 15 additions & 8 deletions ydb/core/persqueue/pq_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<TEvPersQueue::TEvStatusResponse> res = MakeHolder<TEvPersQueue::TEvStatusResponse>();
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;
Expand All @@ -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<TEvPQ::TEvPartitionStatus> event;
if (ev->Get()->Record.GetConsumers().empty()) {
event = MakeHolder<TEvPQ::TEvPartitionStatus>(ans, ev->Get()->Record.HasClientId() ? ev->Get()->Record.GetClientId() : "",
Expand Down
3 changes: 3 additions & 0 deletions ydb/core/persqueue/pq_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ class TPersQueue : public NKeyValue::TKeyValueFlat {
void DestroySession(TPipeInfo& pipeInfo);
bool UseMediatorTimeCast = true;

TVector<TEvPersQueue::TEvStatus::TPtr> StatusRequests;
void ProcessStatusRequests(const TActorContext &ctx);

THashMap<ui32, TVector<TEvPQ::TEvCheckPartitionStatusRequest::TPtr>> CheckPartitionStatusRequests;
TMaybe<ui64> TabletGeneration;

Expand Down

0 comments on commit e0f019d

Please sign in to comment.