summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkomels <[email protected]>2023-01-30 13:32:39 +0300
committerkomels <[email protected]>2023-01-30 13:32:39 +0300
commit3493c77fd1253607323a688441ad0dcef6329ef4 (patch)
treefd0dab32139a9d358dbfcdbc537ef2379d9ef3c5
parent61163696570fc4fb5e821877ef68a752300952e0 (diff)
CM improvements
-rw-r--r--ydb/library/persqueue/topic_parser/topic_parser.cpp1
-rw-r--r--ydb/library/persqueue/topic_parser/topic_parser.h6
2 files changed, 6 insertions, 1 deletions
diff --git a/ydb/library/persqueue/topic_parser/topic_parser.cpp b/ydb/library/persqueue/topic_parser/topic_parser.cpp
index c1377d4d4f8..7050604e71e 100644
--- a/ydb/library/persqueue/topic_parser/topic_parser.cpp
+++ b/ydb/library/persqueue/topic_parser/topic_parser.cpp
@@ -305,6 +305,7 @@ bool TDiscoveryConverter::TryParseModernMirroredPath(TStringBuf path) {
CHECK_SET_VALID(!path.Contains("mirrored-from"), "Federation topics cannot contain 'mirrored-from' in name unless this is a mirrored topic", return false);
return false;
}
+ CHECK_SET_VALID(Dc.empty() || LocalDc != Dc, "Local topic cannot contain '-mirrored-from' part", return false);
TStringBuf fst, snd;
auto res = path.TryRSplit("-mirrored-from-", fst, snd);
CHECK_SET_VALID(res, "Malformed mirrored topic path - expected to end with '-mirrored-from-<cluster>'", return false);
diff --git a/ydb/library/persqueue/topic_parser/topic_parser.h b/ydb/library/persqueue/topic_parser/topic_parser.h
index 627785eef52..0da1ca16e83 100644
--- a/ydb/library/persqueue/topic_parser/topic_parser.h
+++ b/ydb/library/persqueue/topic_parser/topic_parser.h
@@ -318,7 +318,11 @@ public:
if (!IsLocalDc.Defined()) {
localDc = LocalDc;
} else if (IsLocalDc.GetRef()) {
- localDc = dc;
+ if (!dc.empty()) {
+ localDc = dc;
+ } else {
+ localDc = ".local";
+ }
} else {
localDc = dc + ".non-local"; // Just always mismatch with any DC;
}