Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions ydb/core/kqp/workload_service/actors/scheme_actors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,12 @@ class TDatabaseFetcherActor : public TSchemeActorBase<TDatabaseFetcherActor> {
}
return;
case EStatus::Ok:
if (!IsSubDomainPath(result)) {
Reply(Ydb::StatusIds::UNSUPPORTED, TStringBuilder() << "Invalid database path " << Database << ", please check the correctness of the path");
return;
}
if (result.DomainInfo) {
Serverless = result.DomainInfo->IsServerless();
if (result.Self->Info.GetPathId() != result.DomainInfo->DomainKey.LocalPathId) {
Reply(Ydb::StatusIds::UNSUPPORTED, TStringBuilder() << "Invalid database " << Database << ", domain path id is different");
return;
}
}
Reply(Ydb::StatusIds::SUCCESS);
return;
Expand Down Expand Up @@ -541,6 +541,18 @@ class TDatabaseFetcherActor : public TSchemeActorBase<TDatabaseFetcherActor> {
PassAway();
}

static bool IsSubDomainPath(const NSchemeCache::TSchemeCacheNavigate::TEntry& entry) {
switch (entry.Kind) {
case NSchemeCache::TSchemeCacheNavigate::EKind::KindSubdomain:
case NSchemeCache::TSchemeCacheNavigate::EKind::KindExtSubdomain:
return true;
case NSchemeCache::TSchemeCacheNavigate::EKind::KindPath:
return entry.Self->Info.GetPathId() == NSchemeShard::RootPathId;
default:
return false;
}
}

private:
const TActorId ReplyActorId;
const TString Database;
Expand Down