diff options
author | Artem Zuikov <chertus@gmail.com> | 2022-06-20 17:38:10 +0300 |
---|---|---|
committer | Artem Zuikov <chertus@gmail.com> | 2022-06-20 17:38:10 +0300 |
commit | d3c3071e6d9055951691edcccbc30b86a2c0a800 (patch) | |
tree | b423ed585488e7a1fd312f41e7c8a8fecceb15f2 | |
parent | 4ee4fd9dc0c74fb6f4ab60934240cf730fd4900a (diff) | |
download | ydb-d3c3071e6d9055951691edcccbc30b86a2c0a800.tar.gz |
KIKIMR-11746: remove some legacy
ref:969dbbdb12a4cac7d17ecbf7bde84e67fbdd95a1
10 files changed, 6 insertions, 204 deletions
diff --git a/ydb/core/mind/hive/monitoring.cpp b/ydb/core/mind/hive/monitoring.cpp index 46df5add56..362466da54 100644 --- a/ydb/core/mind/hive/monitoring.cpp +++ b/ydb/core/mind/hive/monitoring.cpp @@ -1069,6 +1069,8 @@ public: return "H"; case TTabletTypes::DataShard: return "DS"; + case TTabletTypes::ColumnShard: + return "CS"; case TTabletTypes::KeyValue: return "KV"; case TTabletTypes::PersQueue: diff --git a/ydb/core/protos/tablet.proto b/ydb/core/protos/tablet.proto index 98f84828ff..43ad30b183 100644 --- a/ydb/core/protos/tablet.proto +++ b/ydb/core/protos/tablet.proto @@ -41,7 +41,7 @@ message TTabletTypes { BlockStoreDiskRegistry = 31; SysViewProcessor = 32; FileStore = 33; - OlapShard = 34; + // number 34 was OlapShard ColumnShard = 35; TestShard = 36; SequenceShard = 37; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_alter_olap_store.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_alter_olap_store.cpp index d7701ca1dd..28acea3694 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_alter_olap_store.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_alter_olap_store.cpp @@ -254,26 +254,6 @@ public: const ui32 presetId = alterData->SchemaPresetByName.at(presetName); updatedSchemaPresets.insert(presetId); } -#if 0 - TVector<ui32> droppedTtlSettingsPresets; - for (const auto& presetProto : storeInfo->Description.GetTtlSettingsPresets()) { - const ui32 presetId = presetProto.GetId(); - if (!alterData->TtlSettingsPresets.contains(presetId)) { - droppedTtlSettingsPresets.push_back(presetId); - } - } - THashSet<ui32> updatedTtlSettingsPresets; - for (const auto& proto : alterData->AlterBody->GetAlterTtlSettingsPresets()) { - const TString& presetName = proto.GetName(); - const ui32 presetId = alterData->TtlSettingsPresetByName.at(presetName); - updatedTtlSettingsPresets.insert(presetId); - } - for (const auto& proto : alterData->AlterBody->GetAddTtlSettingsPresets()) { - const TString& presetName = proto.GetName(); - const ui32 presetId = alterData->TtlSettingsPresetByName.at(presetName); - updatedTtlSettingsPresets.insert(presetId); - } -#endif TString columnShardTxBody; { @@ -290,16 +270,7 @@ public: *alter->AddSchemaPresets() = presetProto; } } -#if 0 - for (ui32 id : droppedTtlSettingsPresets) { - alter->AddDroppedTtlSettingsPresets(id); - } - for (const auto& presetProto : storeInfo->Description.GetTtlSettingsPresets()) { - if (updatedTtlSettingsPresets.contains(presetProto.GetId())) { - *alter->AddTtlSettingsPresets() = presetProto; - } - } -#endif + Y_PROTOBUF_SUPPRESS_NODISCARD tx.SerializeToString(&columnShardTxBody); } diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_alter_olap_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_alter_olap_table.cpp index 33c9c93ad7..5d409f18ef 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_alter_olap_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_alter_olap_table.cpp @@ -36,14 +36,6 @@ TOlapTableInfo::TPtr ParseParams( if (alterData->Description.HasTtlSettings()) { currentTtlVersion = alterData->Description.GetTtlSettings().GetVersion(); } -#if 0 - else if (alterData->Description.HasTtlSettingsPresetId()) { - auto& preset = storeInfo->TtlSettingsPresets.at(alterData->Description.GetTtlSettingsPresetId()); - currentTtlVersion = preset.Version + alterData->Description.GetTtlSettingsPresetVersionAdj(); - } else { - currentTtlVersion = alterData->Description.GetTtlSettingsPresetVersionAdj(); - } -#endif if (alter.HasAlterTtlSettings()) { const NKikimrSchemeOp::TColumnTableSchema* tableSchema = nullptr; @@ -81,36 +73,11 @@ TOlapTableInfo::TPtr ParseParams( *alterData->Description.MutableTtlSettings() = alter.GetAlterTtlSettings(); alterData->Description.MutableTtlSettings()->SetVersion(currentTtlVersion + 1); -#if 0 - alterData->Description.ClearTtlSettingsPresetId(); - alterData->Description.ClearTtlSettingsPresetName(); - alterData->Description.ClearTtlSettingsPresetVersionAdj(); -#endif } if (alter.HasRESERVED_AlterTtlSettingsPresetName()) { -#if 1 status = NKikimrScheme::StatusInvalidParameter; errStr = "TTL presets are not supported"; return nullptr; -#else - auto it = storeInfo->TtlSettingsPresetByName.find(alter.GetAlterTtlSettingsPresetName()); - if (it == storeInfo->TtlSettingsPresetByName.end()) { - status = NKikimrScheme::StatusInvalidParameter; - errStr = TStringBuilder() - << "Cannot find ttl settings preset '" << alter.GetAlterTtlSettingsPresetName() << "'"; - return nullptr; - } - alterData->Description.ClearTtlSettings(); - alterData->Description.SetTtlSettingsPresetId(it->second); - alterData->Description.SetTtlSettingsPresetName(alter.GetAlterTtlSettingsPresetName()); - auto& preset = storeInfo->TtlSettingsPresets.at(it->second); - if (preset.Version > currentTtlVersion) { - alterData->Description.ClearTtlSettingsPresetVersionAdj(); - } else { - // New version must be currentTtlVersion + 1 == preset.Version + adj - alterData->Description.SetTtlSettingsPresetVersionAdj(currentTtlVersion - preset.Version + 1); - } -#endif } tableInfo->AlterData = alterData; @@ -188,24 +155,9 @@ public: if (alterInfo->Description.HasTtlSettings()) { *alter->MutableTtlSettings() = alterInfo->Description.GetTtlSettings(); } -#if 0 - if (alterInfo->Description.HasTtlSettingsPresetId()) { - const ui32 presetId = alterInfo->Description.GetTtlSettingsPresetId(); - Y_VERIFY(storeInfo->TtlSettingsPresets.contains(presetId), - "Failed to find ttl settings preset %" PRIu32 " in an olap store", presetId); - auto& preset = storeInfo->TtlSettingsPresets.at(presetId); - size_t presetIndex = preset.ProtoIndex; - *alter->MutableTtlSettingsPreset() = storeInfo->Description.GetTtlSettingsPresets(presetIndex); - } -#endif if (alterInfo->Description.HasSchemaPresetVersionAdj()) { alter->SetSchemaPresetVersionAdj(alterInfo->Description.GetSchemaPresetVersionAdj()); } -#if 0 - if (alterInfo->Description.HasTtlSettingsPresetVersionAdj()) { - alter->SetTtlSettingsPresetVersionAdj(alterInfo->Description.GetTtlSettingsPresetVersionAdj()); - } -#endif Y_VERIFY(tx.SerializeToString(&columnShardTxBody)); } diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp index 74880e35b2..4965083605 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp @@ -150,42 +150,6 @@ bool PrepareSchemaPreset(NKikimrSchemeOp::TColumnTableSchemaPreset& proto, TOlap return true; } -#if 0 -bool PrepareTtlSettingsPreset( - NKikimrSchemeOp::TColumnTableTtlSettingsPreset& proto, TOlapStoreInfo& store, size_t protoIndex, - TEvSchemeShard::EStatus& status, TString& errStr) -{ - if (proto.GetName().empty()) { - status = NKikimrScheme::StatusSchemeError; - errStr = Sprintf("Ttl settings preset name cannot be empty"); - return false; - } - if (!proto.HasId()) { - proto.SetId(store.Description.GetNextTtlSettingsPresetId()); - store.Description.SetNextTtlSettingsPresetId(proto.GetId() + 1); - } else if (proto.GetId() <= 0 || proto.GetId() >= store.Description.GetNextTtlSettingsPresetId()) { - status = NKikimrScheme::StatusSchemeError; - errStr = Sprintf("Ttl settings preset id is incorrect"); - return false; - } - if (store.TtlSettingsPresets.contains(proto.GetId()) || - store.TtlSettingsPresetByName.contains(proto.GetName())) - { - status = NKikimrScheme::StatusSchemeError; - errStr = Sprintf("Duplicate ttl settings preset %" PRIu32 " with name '%s'", proto.GetId(), proto.GetName().c_str()); - return false; - } - auto& preset = store.TtlSettingsPresets[proto.GetId()]; - preset.Id = proto.GetId(); - preset.Name = proto.GetName(); - preset.ProtoIndex = protoIndex; - store.TtlSettingsPresetByName[preset.Name] = preset.Id; - - proto.MutableTtlSettings()->SetVersion(1); - - return true; -} -#endif TOlapStoreInfo::TPtr CreateOlapStore(const NKikimrSchemeOp::TColumnStoreDescription& opSrc, TEvSchemeShard::EStatus& status, TString& errStr) { @@ -224,21 +188,10 @@ TOlapStoreInfo::TPtr CreateOlapStore(const NKikimrSchemeOp::TColumnStoreDescript protoIndex = 0; for (auto& presetProto : *op.MutableRESERVED_TtlSettingsPresets()) { -#if 1 Y_UNUSED(presetProto); status = NKikimrScheme::StatusSchemeError; errStr = "TTL presets are not supported"; return nullptr; -#else - if (presetProto.HasId()) { - status = NKikimrScheme::StatusSchemeError; - errStr = "Ttl settings preset id cannot be specified explicitly"; - return nullptr; - } - if (!PrepareTtlSettingsPreset(presetProto, *storeInfo, protoIndex++, status, errStr)) { - return nullptr; - } -#endif } if (!storeInfo->SchemaPresetByName.contains("default") || storeInfo->SchemaPresets.size() > 1) { @@ -252,7 +205,6 @@ TOlapStoreInfo::TPtr CreateOlapStore(const NKikimrSchemeOp::TColumnStoreDescript } void ApplySharding(TTxId txId, TPathId pathId, TOlapStoreInfo::TPtr storeInfo, - const TChannelsBindings& metaChannelsBindings, const TChannelsBindings& channelsBindings, TTxState& txState, TSchemeShard* ss) { @@ -261,9 +213,6 @@ void ApplySharding(TTxId txId, TPathId pathId, TOlapStoreInfo::TPtr storeInfo, txState.Shards.reserve(numShards); - TShardInfo metaShardInfo = TShardInfo::OlapShardInfo(txId, pathId); - metaShardInfo.BindedChannels = metaChannelsBindings; - TShardInfo columnShardInfo = TShardInfo::ColumnShardInfo(txId, pathId); columnShardInfo.BindedChannels = channelsBindings; @@ -694,10 +643,6 @@ public: return result; } - // Only the first two channels are used for metashards - TChannelsBindings metaChannelsBindings = channelsBindings; - metaChannelsBindings.resize(2); - const ui64 shardsToCreate = storeInfo->ColumnShards.size(); { NSchemeShard::TPath::TChecker checks = dstPath.Check(); @@ -726,9 +671,7 @@ public: TPathId pathId = dstPath.Base()->PathId; TTxState& txState = context.SS->CreateTx(OperationId, TTxState::TxCreateOlapStore, pathId); - ApplySharding( - OperationId.GetTxId(), pathId, storeInfo, - metaChannelsBindings, channelsBindings, txState, context.SS); + ApplySharding(OperationId.GetTxId(), pathId, storeInfo, channelsBindings, txState, context.SS); NIceDb::TNiceDb db(context.GetDB()); @@ -743,10 +686,6 @@ public: Y_VERIFY(shard.Operation == TTxState::CreateParts); context.SS->PersistShardMapping(db, shard.Idx, InvalidTabletId, pathId, OperationId.GetTxId(), shard.TabletType); switch (shard.TabletType) { - case ETabletType::OlapShard: { - context.SS->PersistChannelsBinding(db, shard.Idx, metaChannelsBindings); - break; - } case ETabletType::ColumnShard: { context.SS->PersistChannelsBinding(db, shard.Idx, channelsBindings); break; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp index cf2e80090c..9c076d70d9 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp @@ -379,24 +379,9 @@ public: if (tableInfo->Description.HasTtlSettings()) { create->MutableTtlSettings()->CopyFrom(tableInfo->Description.GetTtlSettings()); } -#if 0 - if (tableInfo->Description.HasTtlSettingsPresetId()) { - const ui32 presetId = tableInfo->Description.GetTtlSettingsPresetId(); - Y_VERIFY(storeInfo->TtlSettingsPresets.contains(presetId), - "Failed to find ttl settings preset %" PRIu32 " in an olap store", presetId); - auto& preset = storeInfo->TtlSettingsPresets.at(presetId); - size_t presetIndex = preset.ProtoIndex; - create->MutableTtlSettingsPreset()->CopyFrom(storeInfo->Description.GetTtlSettingsPresets(presetIndex)); - } -#endif if (tableInfo->Description.HasSchemaPresetVersionAdj()) { create->SetSchemaPresetVersionAdj(tableInfo->Description.GetSchemaPresetVersionAdj()); } -#if 0 - if (tableInfo->Description.HasTtlSettingsPresetVersionAdj()) { - create->SetTtlSettingsPresetVersionAdj(tableInfo->Description.GetTtlSettingsPresetVersionAdj()); - } -#endif Y_VERIFY(tx.SerializeToString(&columnShardTxBody)); } diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp index 758976ffa5..7d7efa62ef 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp @@ -3600,15 +3600,6 @@ NKikimrSchemeOp::TPathVersion TSchemeShard::GetPathVersion(const TPath& path) co if (tableInfo->Description.HasTtlSettings()) { result.SetColumnTableTtlSettingsVersion(tableInfo->Description.GetTtlSettings().GetVersion()); } -#if 0 - else if (tableInfo->Description.HasTtlSettingsPresetId() && tableInfo->OlapStorePathId) { - auto storeInfo = OlapStores.at(tableInfo->OlapStorePathId); - auto& preset = storeInfo->TtlSettingsPresets.at(tableInfo->Description.GetTtlSettingsPresetId()); - result.SetColumnTableTtlSettingsVersion(tableInfo->Description.GetTtlSettingsPresetVersionAdj() + preset.Version); - } else { - result.SetColumnTableTtlSettingsVersion(tableInfo->Description.GetTtlSettingsPresetVersionAdj()); - } -#endif generalVersion += result.GetColumnTableTtlSettingsVersion(); break; diff --git a/ydb/core/tx/schemeshard/schemeshard_info_types.cpp b/ydb/core/tx/schemeshard/schemeshard_info_types.cpp index ebd7d4aa67..6d2d173409 100644 --- a/ydb/core/tx/schemeshard/schemeshard_info_types.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_info_types.cpp @@ -2030,22 +2030,7 @@ TOlapStoreInfo::TOlapStoreInfo( preset.NextColumnId = presetProto.GetSchema().GetNextColumnId(); preset.Version = presetProto.GetSchema().GetVersion(); } -#if 0 - size_t ttlSettingsPresetIndex = 0; - for (const auto& presetProto : Description.GetTtlSettingsPresets()) { - Y_VERIFY(presetProto.HasId()); - Y_VERIFY(presetProto.HasName()); - Y_VERIFY(presetProto.HasTtlSettings()); - Y_VERIFY(!TtlSettingsPresets.contains(presetProto.GetId())); - auto& preset = TtlSettingsPresets[presetProto.GetId()]; - preset.Id = presetProto.GetId(); - preset.Name = presetProto.GetName(); - preset.ProtoIndex = ttlSettingsPresetIndex++; - TtlSettingsPresetByName[preset.Name] = preset.Id; - // TODO: parse relevant settings - preset.Version = presetProto.GetTtlSettings().GetVersion(); - } -#endif + for (const auto& shardIdx : Sharding.GetColumnShards()) { ColumnShards.push_back(TShardIdx( TOwnerId(shardIdx.GetOwnerId()), diff --git a/ydb/core/tx/schemeshard/schemeshard_info_types.h b/ydb/core/tx/schemeshard/schemeshard_info_types.h index b08827004f..9638f5978a 100644 --- a/ydb/core/tx/schemeshard/schemeshard_info_types.h +++ b/ydb/core/tx/schemeshard/schemeshard_info_types.h @@ -826,15 +826,7 @@ struct TOlapTtlSettings { // TODO: add parsed settings ui64 Version = 1; }; -#if 0 -struct TOlapStoreTtlSettingsPreset : public TOlapTtlSettings { - ui32 Id; - TString Name; - // Preset index in the olap store description - size_t ProtoIndex = -1; -}; -#endif struct TOlapStoreInfo : TSimpleRefCount<TOlapStoreInfo> { using TPtr = TIntrusivePtr<TOlapStoreInfo>; @@ -1008,10 +1000,6 @@ struct TShardInfo { return TShardInfo(txId, pathId, ETabletType::Kesus); } - static TShardInfo OlapShardInfo(TTxId txId, TPathId pathId) { - return TShardInfo(txId, pathId, ETabletType::OlapShard); - } - static TShardInfo ColumnShardInfo(TTxId txId, TPathId pathId) { return TShardInfo(txId, pathId, ETabletType::ColumnShard); } diff --git a/ydb/core/tx/schemeshard/schemeshard_path_describer.cpp b/ydb/core/tx/schemeshard/schemeshard_path_describer.cpp index fb36ef2ab9..6301cda130 100644 --- a/ydb/core/tx/schemeshard/schemeshard_path_describer.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_path_describer.cpp @@ -383,17 +383,6 @@ void TPathDescriber::DescribeOlapTable(TPathId pathId, TPathElement::TPtr pathEl description->MutableSchema()->SetVersion(description->GetSchema().GetVersion() + description->GetSchemaPresetVersionAdj()); } } -#if 0 - if (!description->HasTtlSettings() && description->HasTtlSettingsPresetId()) { - auto& preset = storeInfo->TtlSettingsPresets.at(description->GetTtlSettingsPresetId()); - auto& presetProto = storeInfo->Description.GetTtlSettingsPresets(preset.ProtoIndex); - *description->MutableTtlSettings() = presetProto.GetTtlSettings(); - if (description->HasTtlSettingsPresetVersionAdj()) { - description->MutableTtlSettings()->SetVersion( - description->GetTtlSettings().GetVersion() + description->GetTtlSettingsPresetVersionAdj()); - } - } -#endif } void TPathDescriber::DescribePersQueueGroup(TPathId pathId, TPathElement::TPtr pathEl) { |