Skip to content

Commit 21031cd

Browse files
Merge ecad311 into 658eb36
2 parents 658eb36 + ecad311 commit 21031cd

File tree

2 files changed

+49
-46
lines changed

2 files changed

+49
-46
lines changed

ydb/library/persqueue/topic_parser/topic_parser.cpp

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ bool TDiscoveryConverter::BuildFromFederationPath(const TString& rootPrefix) {
320320
auto res = topic.TrySplit("/", fst, snd);
321321
CHECK_SET_VALID(res, TStringBuilder() << "Could not split federation path: " << OriginalTopic, return false);
322322
Account_ = fst;
323-
323+
324324
if (!ParseModernPath(snd))
325325
return false;
326326
if (!BuildFromShortModernName()) {
@@ -341,7 +341,7 @@ bool TDiscoveryConverter::BuildFromFederationPath(const TString& rootPrefix) {
341341

342342
bool TDiscoveryConverter::TryParseModernMirroredPath(TStringBuf path) {
343343
if (!path.Contains("-mirrored-from-")) {
344-
CHECK_SET_VALID(!path.Contains("mirrored-from"), "Federation topics cannot contain 'mirrored-from' in name unless this is a mirrored topic", return false);
344+
CHECK_SET_VALID(!path.Contains("mirrored-from"), "Federation topics cannot contain 'mirrored-from' in name unless this is a mirrored topic", return false);
345345
return false;
346346
}
347347
TStringBuf fst, snd;
@@ -447,7 +447,7 @@ bool TDiscoveryConverter::BuildFromLegacyName(const TString& rootPrefix, bool fo
447447
return false);
448448
}
449449
if (Dc.empty() && !hasDcInName) {
450-
CHECK_SET_VALID(!FstClass, TStringBuilder() << "Internal error: FirstClass mode enabled, but trying to parse Legacy-style name: "
450+
CHECK_SET_VALID(!FstClass, TStringBuilder() << "Internal error: FirstClass mode enabled, but trying to parse Legacy-style name: "
451451
<< OriginalTopic, return false;);
452452
CHECK_SET_VALID(!LocalDc.empty(),
453453
"Cannot determine DC: should specify either in topic name, Dc option or LocalDc option",
@@ -466,7 +466,7 @@ bool TDiscoveryConverter::BuildFromLegacyName(const TString& rootPrefix, bool fo
466466
Dc = fst;
467467
topic = snd;
468468
} else {
469-
CHECK_SET_VALID(!Dc.empty(), TStringBuilder() << "Internal error: Could not determine DC (despite beleiving the name contins one) for topic "
469+
CHECK_SET_VALID(!Dc.empty(), TStringBuilder() << "Internal error: Could not determine DC (despite beleiving the name contins one) for topic "
470470
<< OriginalTopic, return false;);
471471
TStringBuilder builder;
472472
builder << "rt3." << Dc << "--" << topic;
@@ -513,7 +513,7 @@ bool TDiscoveryConverter::BuildFromLegacyName(const TString& rootPrefix, bool fo
513513
topicName = topic;
514514
}
515515
modernName << topicName;
516-
CHECK_SET_VALID(!Dc.empty(), TStringBuilder() << "Internal error: Could not determine DC for topic: "
516+
CHECK_SET_VALID(!Dc.empty(), TStringBuilder() << "Internal error: Could not determine DC for topic: "
517517
<< OriginalTopic, return false);
518518

519519
bool isMirrored = (!LocalDc.empty() && Dc != LocalDc);
@@ -522,7 +522,7 @@ bool TDiscoveryConverter::BuildFromLegacyName(const TString& rootPrefix, bool fo
522522
} else {
523523
fullModernName << topicName;
524524
}
525-
CHECK_SET_VALID(!fullLegacyName.empty(), TStringBuilder() << "Could not form a full legacy name for topic: "
525+
CHECK_SET_VALID(!fullLegacyName.empty(), TStringBuilder() << "Could not form a full legacy name for topic: "
526526
<< OriginalTopic, return false);
527527

528528
ShortLegacyName = shortLegacyName;
@@ -666,24 +666,25 @@ TTopicConverterPtr TTopicNameConverter::ForFederation(
666666
normDir.SkipPrefix("/");
667667
TString fullPath = NKikimr::JoinPath({TString(normDir), schemeName});
668668
auto parsed = res->TryParseModernMirroredPath(fullPath);
669+
Y_UNUSED(parsed);
669670
if (!res->IsValid()) {
670671
return res;
671672
}
672-
if (parsed) {
673-
Y_ABORT_UNLESS(!res->Dc.empty());
674-
if (!localDc.empty() && localDc == res->Dc) {
675-
res->Valid = false;
676-
res->Reason = TStringBuilder() << "Topic in modern mirrored-like style: " << schemeName
677-
<< " cannot be created in the same cluster " << res->Dc;
678-
return res;
679-
}
680-
}
673+
// if (parsed) {
674+
// Y_ABORT_UNLESS(!res->Dc.empty());
675+
// if (!localDc.empty() && localDc == res->Dc) {
676+
// res->Valid = false;
677+
// res->Reason = TStringBuilder() << "Topic in modern mirrored-like style: " << schemeName
678+
// << " cannot be created in the same cluster " << res->Dc;
679+
// return res;
680+
// }
681+
// }
681682
if (isLocal) {
682-
if(parsed) {
683-
res->Valid = false;
684-
res->Reason = TStringBuilder() << "Topic in modern mirrored-like style: " << schemeName << ", created as local";
685-
return res;
686-
}
683+
// if(parsed) {
684+
// res->Valid = false;
685+
// res->Reason = TStringBuilder() << "Topic in modern mirrored-like style: " << schemeName << ", created as local";
686+
// return res;
687+
// }
687688
if (localDc.empty()) {
688689
res->Valid = false;
689690
res->Reason = "Local DC option is mandatory when creating local modern-style topic";
@@ -692,17 +693,18 @@ TTopicConverterPtr TTopicNameConverter::ForFederation(
692693
res->Dc = localDc;
693694
auto ok = res->ParseModernPath(fullPath);
694695
if (!ok) {
695-
return res;
696-
}
697-
} else {
698-
if (!parsed) {
699-
res->Valid = false;
700-
res->Reason = TStringBuilder() << "Topic in modern style with non-mirrored-name: " << schemeName
701-
<< ", created as non-local";
702-
703696
return res;
704697
}
705698
}
699+
// else {
700+
// if (!parsed) {
701+
// res->Valid = false;
702+
// res->Reason = TStringBuilder() << "Topic in modern style with non-mirrored-name: " << schemeName
703+
// << ", created as non-local";
704+
705+
// return res;
706+
// }
707+
// }
706708
if (res->FullModernName.empty()) {
707709
res->Valid = false;
708710
res->Reason = TStringBuilder() << "Internal error: FullModernName empty in TopicConverter(for schema) for topic: "
@@ -943,4 +945,3 @@ TConverterFactoryPtr TTopicsListController::GetConverterFactory() const {
943945
};
944946

945947
} // namespace NPersQueue
946-

ydb/services/persqueue_v1/actors/schema_actors.cpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,12 @@ void TCreateTopicActor::FillProposeRequest(TEvTxUserProxy::TEvProposeTransaction
396396
<< "' instead of " << LocalCluster, Ydb::PersQueue::ErrorCode::BAD_REQUEST));
397397
return RespondWithCode(Ydb::StatusIds::BAD_REQUEST);
398398
}
399-
if (Count(Clusters, config.GetDC()) == 0 && !Clusters.empty()) {
400-
Request_->RaiseIssue(FillIssue(TStringBuilder() << "Unknown cluster '" << config.GetDC() << "'", Ydb::PersQueue::ErrorCode::BAD_REQUEST));
401-
return RespondWithCode(Ydb::StatusIds::BAD_REQUEST);
402-
}
399+
400+
// skip because of LOGBROKER-8792
401+
// if (Count(Clusters, config.GetDC()) == 0 && !Clusters.empty()) {
402+
// Request_->RaiseIssue(FillIssue(TStringBuilder() << "Unknown cluster '" << config.GetDC() << "'", Ydb::PersQueue::ErrorCode::BAD_REQUEST));
403+
// return RespondWithCode(Ydb::StatusIds::BAD_REQUEST);
404+
// }
403405
}
404406

405407

@@ -596,7 +598,7 @@ void TDescribeTopicActorImpl::Handle(TEvPQProxy::TEvRequestTablet::TPtr& ev, con
596598
Y_ABORT_UNLESS(RequestsInfly > 0);
597599
--RequestsInfly;
598600
}
599-
601+
600602
RequestTablet(tabletInfo, ctx);
601603
}
602604

@@ -635,7 +637,7 @@ void TDescribeTopicActorImpl::RequestBalancer(const TActorContext& ctx) {
635637
GotLocation = true;
636638
}
637639

638-
if (Settings.Mode == TDescribeTopicActorSettings::EMode::DescribeConsumer && Settings.RequireStats) {
640+
if (Settings.Mode == TDescribeTopicActorSettings::EMode::DescribeConsumer && Settings.RequireStats) {
639641
if (!GotReadSessions) {
640642
RequestReadSessionsInfo(ctx);
641643
}
@@ -671,7 +673,7 @@ void TDescribeTopicActorImpl::RequestPartitionsLocation(const TActorContext& ctx
671673
return RaiseError(
672674
TStringBuilder() << "No partition " << Settings.Partitions[0] << " in topic",
673675
Ydb::PersQueue::ErrorCode::BAD_REQUEST, Ydb::StatusIds::BAD_REQUEST, ctx
674-
);
676+
);
675677
}
676678
auto res = partIds.insert(p);
677679
if (res.second) {
@@ -705,7 +707,7 @@ void TDescribeTopicActorImpl::Handle(NKikimr::TEvPersQueue::TEvStatusResponse::T
705707

706708
auto& record = ev->Get()->Record;
707709
bool doRestart = (record.PartResultSize() == 0);
708-
710+
709711
for (auto& partResult : record.GetPartResult()) {
710712
if (partResult.GetStatus() == NKikimrPQ::TStatusResponse::STATUS_INITIALIZING ||
711713
partResult.GetStatus() == NKikimrPQ::TStatusResponse::STATUS_UNKNOWN) {
@@ -917,7 +919,7 @@ bool TDescribeTopicActor::ApplyResponse(
917919
}
918920
return true;
919921
}
920-
922+
921923

922924

923925
void TDescribeTopicActor::Reply(const TActorContext& ctx) {
@@ -1030,7 +1032,7 @@ bool TDescribeConsumerActor::ApplyResponse(
10301032
}
10311033
return true;
10321034
}
1033-
1035+
10341036

10351037
bool FillConsumerProto(Ydb::Topic::Consumer *rr, const NKikimrPQ::TPQTabletConfig& config, ui32 i,
10361038
const NActors::TActorContext& ctx, Ydb::StatusIds::StatusCode& status, TString& error)
@@ -1272,11 +1274,11 @@ bool TDescribeTopicActorImpl::ProcessTablets(
12721274
Tablets[pi.GetTabletId()].Partitions.push_back(pi.GetPartitionId());
12731275
Tablets[pi.GetTabletId()].TabletId = pi.GetTabletId();
12741276
}
1275-
1277+
12761278
for (auto& pair : Tablets) {
12771279
RequestTablet(pair.second, ctx);
12781280
}
1279-
1281+
12801282
if (RequestsInfly == 0) {
12811283
Reply(ctx);
12821284
return false;
@@ -1332,7 +1334,7 @@ void TDescribePartitionActor::Bootstrap(const NActors::TActorContext& ctx)
13321334

13331335
void TDescribePartitionActor::StateWork(TAutoPtr<IEventHandle>& ev) {
13341336
switch (ev->GetTypeRewrite()) {
1335-
default:
1337+
default:
13361338
if (!TDescribeTopicActorImpl::StateWork(ev, ActorContext())) {
13371339
TBase::StateWork(ev);
13381340
};
@@ -1359,12 +1361,12 @@ void TDescribePartitionActor::ApplyResponse(TTabletInfo&, NKikimr::TEvPersQueue:
13591361

13601362
void TDescribePartitionActor::ApplyResponse(TTabletInfo& tabletInfo, NKikimr::TEvPersQueue::TEvStatusResponse::TPtr& ev, const TActorContext&) {
13611363
auto* partResult = Result.mutable_partition();
1362-
1364+
13631365
const auto& record = ev->Get()->Record;
13641366
for (auto partData : record.GetPartResult()) {
13651367
if ((ui32)partData.GetPartition() != Settings.Partitions[0])
13661368
continue;
1367-
1369+
13681370
Y_ABORT_UNLESS((ui32)(partData.GetPartition()) == Settings.Partitions[0]);
13691371
partResult->set_partition_id(partData.GetPartition());
13701372
partResult->set_active(true);
@@ -1411,7 +1413,7 @@ void TDescribePartitionActor::Reply(const TActorContext& ctx) {
14111413

14121414
using namespace NIcNodeCache;
14131415

1414-
TPartitionsLocationActor::TPartitionsLocationActor(const TGetPartitionsLocationRequest& request, const TActorId& requester)
1416+
TPartitionsLocationActor::TPartitionsLocationActor(const TGetPartitionsLocationRequest& request, const TActorId& requester)
14151417
: TBase(request, requester)
14161418
, TDescribeTopicActorImpl(TDescribeTopicActorSettings::GetPartitionsLocation(request.PartitionIds))
14171419
{
@@ -1429,7 +1431,7 @@ void TPartitionsLocationActor::Bootstrap(const NActors::TActorContext&)
14291431
void TPartitionsLocationActor::StateWork(TAutoPtr<IEventHandle>& ev) {
14301432
switch (ev->GetTypeRewrite()) {
14311433
hFunc(TEvICNodesInfoCache::TEvGetAllNodesInfoResponse, Handle);
1432-
default:
1434+
default:
14331435
if (!TDescribeTopicActorImpl::StateWork(ev, ActorContext())) {
14341436
TBase::StateWork(ev);
14351437
};

0 commit comments

Comments
 (0)