aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexvru <alexvru@ydb.tech>2023-03-06 16:16:56 +0300
committeralexvru <alexvru@ydb.tech>2023-03-06 16:16:56 +0300
commit1f5ec3dabc082e5efd9f3ecdb9221c1f62a06360 (patch)
treef5fe31cd7f784ddc2e35bc2834f0e279c1fe022b
parent55060209757c994259968a68420de3126687fa38 (diff)
downloadydb-1f5ec3dabc082e5efd9f3ecdb9221c1f62a06360.tar.gz
Revert "Add DrivesSerials table and use it instead of DriveSerial."
This reverts commit bac7fd03a94db1eb51faa99f3629e521767baad3, reversing changes made to 4bf23c97fee4b81f84f45e8b114649283ddf870b.
-rw-r--r--ydb/core/mind/bscontroller/impl.h2
-rw-r--r--ydb/core/mind/bscontroller/load_everything.cpp6
-rw-r--r--ydb/core/mind/bscontroller/scheme.h19
-rw-r--r--ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema98
4 files changed, 54 insertions, 71 deletions
diff --git a/ydb/core/mind/bscontroller/impl.h b/ydb/core/mind/bscontroller/impl.h
index 25f67e4ab1..340f9ad725 100644
--- a/ydb/core/mind/bscontroller/impl.h
+++ b/ydb/core/mind/bscontroller/impl.h
@@ -1273,7 +1273,7 @@ public:
};
struct TDriveSerialInfo {
- using Table = Schema::DrivesSerials;
+ using Table = Schema::DriveSerial;
Table::BoxId::Type BoxId;
TMaybe<Table::NodeId::Type> NodeId;
diff --git a/ydb/core/mind/bscontroller/load_everything.cpp b/ydb/core/mind/bscontroller/load_everything.cpp
index 54d713e832..32b47f4549 100644
--- a/ydb/core/mind/bscontroller/load_everything.cpp
+++ b/ydb/core/mind/bscontroller/load_everything.cpp
@@ -36,7 +36,7 @@ public:
auto groupStoragePool = db.Table<Schema::GroupStoragePool>().Range().Select();
auto groupLatencies = db.Table<Schema::GroupLatencies>().Select();
auto scrubState = db.Table<Schema::ScrubState>().Select();
- auto drivesSerials = db.Table<Schema::DrivesSerials>().Select();
+ auto pdiskSerial = db.Table<Schema::DriveSerial>().Select();
if (!state.IsReady()
|| !nodes.IsReady()
|| !disk.IsReady()
@@ -55,7 +55,7 @@ public:
|| !groupStoragePool.IsReady()
|| !groupLatencies.IsReady()
|| !scrubState.IsReady()
- || !drivesSerials.IsReady()) {
+ || !pdiskSerial.IsReady()) {
return false;
}
}
@@ -235,7 +235,7 @@ public:
if (!NTableAdapter::FetchTable<Schema::HostConfig>(db, Self, Self->HostConfigs)
|| !NTableAdapter::FetchTable<Schema::Box>(db, Self, Self->Boxes)
|| !NTableAdapter::FetchTable<Schema::BoxStoragePool>(db, Self, Self->StoragePools)
- || !NTableAdapter::FetchTable<Schema::DrivesSerials>(db, Self, Self->DrivesSerials)) {
+ || !NTableAdapter::FetchTable<Schema::DriveSerial>(db, Self, Self->DrivesSerials)) {
return false;
}
for (const auto& [storagePoolId, storagePool] : Self->StoragePools) {
diff --git a/ydb/core/mind/bscontroller/scheme.h b/ydb/core/mind/bscontroller/scheme.h
index 19e03cf036..5436761eea 100644
--- a/ydb/core/mind/bscontroller/scheme.h
+++ b/ydb/core/mind/bscontroller/scheme.h
@@ -372,7 +372,6 @@ struct Schema : NIceDb::Schema {
using TColumns = TableColumns<NodeId, PDiskId, VSlotId, State, ScrubCycleStartTime, ScrubCycleFinishTime, Success>;
};
- // the following table is obsolete, use DrivesSerials instead
struct DriveSerial : Table<129> {
struct Serial : Column<1, NScheme::NTypeIds::String> {}; // PK
struct BoxId : Column<2, Box::BoxId::ColumnType> {};
@@ -389,22 +388,6 @@ struct Schema : NIceDb::Schema {
using TColumns = TableColumns<Serial, BoxId, NodeId, PDiskId, Guid, LifeStage, Kind, PDiskType, PDiskConfig, Path>;
};
- struct DrivesSerials : Table<130> {
- struct Serial : Column<1, NScheme::NTypeIds::String> {}; // PK
- struct BoxId : Column<2, Box::BoxId::ColumnType> {};
- struct NodeId : Column<3, Node::ID::ColumnType> {}; // FK PDisk.NodeID
- struct PDiskId : Column<4, Node::NextPDiskID::ColumnType> {}; // FK PDisk.PDiskID
- struct Guid : Column<5, PDisk::Guid::ColumnType> {}; // Check-only column for PDisk.Guid
- struct LifeStage : Column<6, NScheme::NTypeIds::Uint32> { using Type = NKikimrBlobStorage::TDriveLifeStage::E; };
- struct Kind : Column<7, HostConfigDrive::Kind::ColumnType> {};
- struct PDiskType : Column<8, HostConfigDrive::TypeCol::ColumnType> { using Type = NKikimrBlobStorage::EPDiskType; };
- struct PDiskConfig : Column<9, NScheme::NTypeIds::String> {};
- struct Path : Column<10, NScheme::NTypeIds::String> {};
-
- using TKey = TableKey<Serial>;
- using TColumns = TableColumns<Serial, BoxId, NodeId, PDiskId, Guid, LifeStage, Kind, PDiskType, PDiskConfig, Path>;
- };
-
using TTables = SchemaTables<
Node,
PDisk,
@@ -427,7 +410,7 @@ struct Schema : NIceDb::Schema {
MigrationPlan,
MigrationEntry,
ScrubState,
- DrivesSerials
+ DriveSerial
>;
using TSettings = SchemaSettings<
diff --git a/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema b/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema
index 584dcff095..00cd34dd26 100644
--- a/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema
+++ b/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema
@@ -1365,55 +1365,8 @@
}
},
{
- "TableId": 100,
- "TableName": "Box",
- "TableKey": [
- 1
- ],
- "ColumnsAdded": [
- {
- "ColumnId": 1,
- "ColumnName": "BoxId",
- "ColumnType": "Uint64"
- },
- {
- "ColumnId": 2,
- "ColumnName": "Name",
- "ColumnType": "Utf8"
- },
- {
- "ColumnId": 3,
- "ColumnName": "Generation",
- "ColumnType": "Uint64"
- }
- ],
- "ColumnsDropped": [],
- "ColumnFamilies": {
- "0": {
- "Columns": [
- 1,
- 2,
- 3
- ],
- "RoomID": 0,
- "Codec": 0,
- "InMemory": false,
- "Cache": 0,
- "Small": 4294967295,
- "Large": 4294967295
- }
- },
- "Rooms": {
- "0": {
- "Main": 1,
- "Outer": 1,
- "Blobs": 1
- }
- }
- },
- {
- "TableId": 130,
- "TableName": "DrivesSerials",
+ "TableId": 129,
+ "TableName": "DriveSerial",
"TableKey": [
1
],
@@ -1501,6 +1454,53 @@
}
},
{
+ "TableId": 100,
+ "TableName": "Box",
+ "TableKey": [
+ 1
+ ],
+ "ColumnsAdded": [
+ {
+ "ColumnId": 1,
+ "ColumnName": "BoxId",
+ "ColumnType": "Uint64"
+ },
+ {
+ "ColumnId": 2,
+ "ColumnName": "Name",
+ "ColumnType": "Utf8"
+ },
+ {
+ "ColumnId": 3,
+ "ColumnName": "Generation",
+ "ColumnType": "Uint64"
+ }
+ ],
+ "ColumnsDropped": [],
+ "ColumnFamilies": {
+ "0": {
+ "Columns": [
+ 1,
+ 2,
+ 3
+ ],
+ "RoomID": 0,
+ "Codec": 0,
+ "InMemory": false,
+ "Cache": 0,
+ "Small": 4294967295,
+ "Large": 4294967295
+ }
+ },
+ "Rooms": {
+ "0": {
+ "Main": 1,
+ "Outer": 1,
+ "Blobs": 1
+ }
+ }
+ },
+ {
"TableId": 101,
"TableName": "BoxUser",
"TableKey": [