diff options
author | Evgeniy Ivanov <eivanov89@yandex-team.ru> | 2022-02-11 15:10:19 +0300 |
---|---|---|
committer | Evgeniy Ivanov <eivanov89@yandex-team.ru> | 2022-02-11 15:10:19 +0300 |
commit | c2de13b9ab7ce95116d50f549996f146c91017df (patch) | |
tree | d7417fe6385ff7f16c6ca2312d3e3395ce170982 | |
parent | e7a02de169d3c58a75c8193d67736659942a4dfa (diff) | |
download | ydb-c2de13b9ab7ce95116d50f549996f146c91017df.tar.gz |
KIKIMR-9748: persist new ds stats in schemeshard
ref:b3cfc4c40385ccfbf0c302a12de81b148bf89de0
4 files changed, 32 insertions, 9 deletions
diff --git a/ydb/core/tx/schemeshard/schemeshard__init.cpp b/ydb/core/tx/schemeshard/schemeshard__init.cpp index 650506549e0..049afed7ac1 100644 --- a/ydb/core/tx/schemeshard/schemeshard__init.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__init.cpp @@ -2165,6 +2165,9 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> { stats.ReadIops = rowSet.GetValue<Schema::TablePartitionStats::ReadIops>(); stats.WriteIops = rowSet.GetValue<Schema::TablePartitionStats::WriteIops>(); + stats.SearchHeight = rowSet.GetValueOrDefault<Schema::TablePartitionStats::SearchHeight>(); + stats.FullCompactionTs = rowSet.GetValueOrDefault<Schema::TablePartitionStats::FullCompactionTs>(); + tableInfo->UpdateShardStats(shardIdx, stats); if (!rowSet.Next()) { diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp index 7176d01bd4c..014e36dcfcc 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp @@ -2125,7 +2125,10 @@ void TSchemeShard::PersistTablePartitionStats(NIceDb::TNiceDb& db, const TPathId NIceDb::TUpdate<Schema::TablePartitionStats::ReadThroughput>(stats.ReadThroughput), NIceDb::TUpdate<Schema::TablePartitionStats::WriteThroughput>(stats.WriteThroughput), NIceDb::TUpdate<Schema::TablePartitionStats::ReadIops>(stats.ReadIops), - NIceDb::TUpdate<Schema::TablePartitionStats::WriteIops>(stats.WriteIops) + NIceDb::TUpdate<Schema::TablePartitionStats::WriteIops>(stats.WriteIops), + + NIceDb::TUpdate<Schema::TablePartitionStats::SearchHeight>(stats.SearchHeight), + NIceDb::TUpdate<Schema::TablePartitionStats::FullCompactionTs>(stats.FullCompactionTs) ); } diff --git a/ydb/core/tx/schemeshard/schemeshard_schema.h b/ydb/core/tx/schemeshard/schemeshard_schema.h index f293136fe85..cc19895d88f 100644 --- a/ydb/core/tx/schemeshard/schemeshard_schema.h +++ b/ydb/core/tx/schemeshard/schemeshard_schema.h @@ -344,6 +344,9 @@ struct Schema : NIceDb::Schema { struct ReadIops: Column<28, NScheme::NTypeIds::Uint64> {}; struct WriteIops: Column<29, NScheme::NTypeIds::Uint64> {}; + struct SearchHeight: Column<30, NScheme::NTypeIds::Uint64> { static constexpr ui64 Default = 0; }; + struct FullCompactionTs: Column<31, NScheme::NTypeIds::Uint64> { static constexpr ui64 Default = 0; }; + // PartCount, PartOwners & ShardState are volatile data using TKey = TableKey<TableOwnerId, TableLocalId, PartitionId>; @@ -376,7 +379,9 @@ struct Schema : NIceDb::Schema { ReadThroughput, WriteThroughput, ReadIops, - WriteIops + WriteIops, + SearchHeight, + FullCompactionTs >; }; diff --git a/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema b/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema index eb3d61c1230..cb12a5c1f72 100644 --- a/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema +++ b/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema @@ -6383,11 +6383,6 @@ ], "ColumnsAdded": [ { - "ColumnId": 29, - "ColumnName": "WriteIops", - "ColumnType": "Uint64" - }, - { "ColumnId": 1, "ColumnName": "TableOwnerId", "ColumnType": "Uint64" @@ -6526,13 +6521,27 @@ "ColumnId": 28, "ColumnName": "ReadIops", "ColumnType": "Uint64" + }, + { + "ColumnId": 29, + "ColumnName": "WriteIops", + "ColumnType": "Uint64" + }, + { + "ColumnId": 30, + "ColumnName": "SearchHeight", + "ColumnType": "Uint64" + }, + { + "ColumnId": 31, + "ColumnName": "FullCompactionTs", + "ColumnType": "Uint64" } ], "ColumnsDropped": [], "ColumnFamilies": { "0": { "Columns": [ - 29, 1, 2, 3, @@ -6560,7 +6569,10 @@ 25, 26, 27, - 28 + 28, + 29, + 30, + 31 ], "RoomID": 0, "Codec": 0, |