Skip to content

added a new path type for system views #18038

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 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions ydb/core/protos/flat_scheme_op.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1814,6 +1814,7 @@ enum EPathType {
EPathTypeResourcePool = 21;
EPathTypeBackupCollection = 22;
EPathTypeTransfer = 23;
EPathTypeSysView = 24;
}

enum EPathSubType {
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/tx/scheme_board/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,7 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> {
Kind = TNavigate::KindBackupCollection;
FillInfo(Kind, BackupCollectionInfo, std::move(*pathDesc.MutableBackupCollectionDescription()));
break;
case NKikimrSchemeOp::EPathTypeSysView:
case NKikimrSchemeOp::EPathTypeInvalid:
Y_DEBUG_ABORT("Invalid path type");
break;
Expand Down Expand Up @@ -1702,6 +1703,7 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> {
case NKikimrSchemeOp::EPathTypeBackupCollection:
ListNodeEntry->Children.emplace_back(name, pathId, TNavigate::KindBackupCollection);
break;
case NKikimrSchemeOp::EPathTypeSysView:
case NKikimrSchemeOp::EPathTypeTableIndex:
case NKikimrSchemeOp::EPathTypeInvalid:
Y_DEBUG_ABORT("Invalid path type");
Expand Down
1 change: 1 addition & 0 deletions ydb/core/tx/scheme_cache/scheme_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ struct TSchemeCacheNavigate {
KindResourcePool = 22,
KindBackupCollection = 23,
KindTransfer = 24,
KindSysView = 25,
};

struct TListNodeEntry : public TAtomicRefCount<TListNodeEntry> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ class TConfigure: public TSubOperationState {
case NKikimrSchemeOp::EPathType::EPathTypeTransfer:
case NKikimrSchemeOp::EPathType::EPathTypeBlobDepot:
case NKikimrSchemeOp::EPathType::EPathTypeBackupCollection:
case NKikimrSchemeOp::EPathType::EPathTypeSysView:
Y_ABORT("UNIMPLEMENTED");
case NKikimrSchemeOp::EPathType::EPathTypeInvalid:
Y_UNREACHABLE();
Expand Down
5 changes: 5 additions & 0 deletions ydb/core/tx/schemeshard/schemeshard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,9 @@ bool TSchemeShard::CheckApplyIf(const NKikimrSchemeOp::TModifyScheme& scheme, TS
case NKikimrSchemeOp::EPathType::EPathTypeView:
actualVersion = pathVersion.GetViewVersion();
break;
case NKikimrSchemeOp::EPathType::EPathTypeSysView:
Y_ABORT("UNIMPLEMENTED");
break;
default:
actualVersion = pathVersion.GetGeneralVersion();
break;
Expand Down Expand Up @@ -4469,6 +4472,7 @@ NKikimrSchemeOp::TPathVersion TSchemeShard::GetPathVersion(const TPath& path) co
break;
}

case NKikimrSchemeOp::EPathType::EPathTypeSysView:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Придираться пока не буду (т.к. это всё временно), но вообще лучше никогда не добавлять то, что когда-либо может (в будущем) встретиться под Y_UNREACHABLE, потому что Y_UNREACHABLE - это гарантированное UB с непредсказуемым результатом.

case NKikimrSchemeOp::EPathType::EPathTypeInvalid: {
Y_UNREACHABLE();
}
Expand Down Expand Up @@ -5333,6 +5337,7 @@ void TSchemeShard::UncountNode(TPathElement::TPtr node) {
case TPathElement::EPathType::EPathTypeBackupCollection:
TabletCounters->Simple()[COUNTER_BACKUP_COLLECTION_COUNT].Sub(1);
break;
case TPathElement::EPathType::EPathTypeSysView:
case TPathElement::EPathType::EPathTypeInvalid:
Y_ABORT("impossible path type");
}
Expand Down
1 change: 1 addition & 0 deletions ydb/core/tx/schemeshard/schemeshard_path_describer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,7 @@ THolder<TEvSchemeShard::TEvDescribeSchemeResultBuilder> TPathDescriber::Describe
DescribeDir(path);
DescribeBackupCollection(base->PathId, base);
break;
case NKikimrSchemeOp::EPathTypeSysView:
case NKikimrSchemeOp::EPathTypeInvalid:
Y_UNREACHABLE();
}
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/viewer/browse.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class TBrowse : public TActorBootstrapped<TBrowse> {
return NKikimrViewer::EObjectType::View;
case NKikimrSchemeOp::EPathType::EPathTypeResourcePool:
return NKikimrViewer::EObjectType::ResourcePool;
case NKikimrSchemeOp::EPathType::EPathTypeSysView:
return NKikimrViewer::EObjectType::SysView;
case NKikimrSchemeOp::EPathType::EPathTypeExtSubDomain:
case NKikimrSchemeOp::EPathType::EPathTypeTableIndex:
case NKikimrSchemeOp::EPathType::EPathTypeInvalid:
Expand Down
1 change: 1 addition & 0 deletions ydb/core/viewer/protos/viewer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ enum EObjectType {
ExternalDataSource = 25;
View = 26;
ResourcePool = 27;
SysView = 28;
}

message TBrowseInfo {
Expand Down
3 changes: 2 additions & 1 deletion ydb/public/lib/deprecated/kicli/kicli.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ class TSchemaObject {
View,
ResourcePool,
BackupCollection,
Transfer
Transfer,
SysView,
};

TSchemaObject(TSchemaObject&&) = default;
Expand Down
3 changes: 3 additions & 0 deletions ydb/public/lib/deprecated/kicli/schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void TSchemaObject::Drop() {
case EPathType::Unknown:
case EPathType::SubDomain:
case EPathType::RtmrVolume:
case EPathType::SysView:
throw yexception() << "Wrong drop";
break;
}
Expand Down Expand Up @@ -241,6 +242,8 @@ static TSchemaObject::EPathType GetType(const NKikimrSchemeOp::TDirEntry& entry)
return TSchemaObject::EPathType::ResourcePool;
case NKikimrSchemeOp::EPathTypeBackupCollection:
return TSchemaObject::EPathType::BackupCollection;
case NKikimrSchemeOp::EPathTypeSysView:
return TSchemaObject::EPathType::SysView;
case NKikimrSchemeOp::EPathTypeTableIndex:
case NKikimrSchemeOp::EPathTypeExtSubDomain:
case NKikimrSchemeOp::EPathTypeCdcStream:
Expand Down
2 changes: 2 additions & 0 deletions ydb/services/ydb/backup_ut/ydb_backup_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,7 @@ Y_UNIT_TEST_SUITE(BackupRestore) {
case EPathTypeInvalid:
case EPathTypeBackupCollection:
case EPathTypeBlobDepot:
case EPathTypeSysView:
break; // not applicable
case EPathTypeRtmrVolume:
case EPathTypeBlockStoreVolume:
Expand Down Expand Up @@ -2629,6 +2630,7 @@ Y_UNIT_TEST_SUITE(BackupRestoreS3) {
case EPathTypeInvalid:
case EPathTypeBackupCollection:
case EPathTypeBlobDepot:
case EPathTypeSysView:
break; // not applicable
case EPathTypeRtmrVolume:
case EPathTypeBlockStoreVolume:
Expand Down
Loading