Skip to content

YQ WM fixed databse checking #8251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
Loading