diff options
author | t1mursadykov <t1mursadykov@ydb.tech> | 2022-08-16 17:09:21 +0300 |
---|---|---|
committer | t1mursadykov <t1mursadykov@ydb.tech> | 2022-08-16 17:09:21 +0300 |
commit | 9b427171469d17ae2bc0f6c9c668832722f7129e (patch) | |
tree | 93738790919c5ac425a2bd62b5144aa47afc10c9 | |
parent | 6eacb40870aeea9a0668645fd6b141e978e4618f (diff) | |
download | ydb-9b427171469d17ae2bc0f6c9c668832722f7129e.tar.gz |
Add state storage version to the protobuf
-rw-r--r-- | ydb/core/base/statestorage.cpp | 10 | ||||
-rw-r--r-- | ydb/core/base/statestorage.h | 4 | ||||
-rw-r--r-- | ydb/core/protos/config.proto | 3 |
3 files changed, 16 insertions, 1 deletions
diff --git a/ydb/core/base/statestorage.cpp b/ydb/core/base/statestorage.cpp index de39a327ae..12e279426f 100644 --- a/ydb/core/base/statestorage.cpp +++ b/ydb/core/base/statestorage.cpp @@ -203,6 +203,8 @@ static void CopyStateStorageRingInfo( const NKikimrConfig::TDomainsConfig::TStateStorage::TRing &ring = source.GetRing(iring); info->Rings[iring].UseRingSpecificNodeSelection = ring.GetUseRingSpecificNodeSelection(); + info->Rings[iring].IsDisabled = ring.GetIsDisabled(); + if (ring.GetUseSingleNodeActorId()) { Y_VERIFY(ring.NodeSize() == 1); @@ -246,7 +248,13 @@ static void CopyStateStorageRingInfo( TIntrusivePtr<TStateStorageInfo> BuildStateStorageInfo(char (&namePrefix)[TActorId::MaxServiceIDLength], const NKikimrConfig::TDomainsConfig::TStateStorage& config) { TIntrusivePtr<TStateStorageInfo> info = new TStateStorageInfo(); info->StateStorageGroup = config.GetSSId(); - + info->StateStorageVersion = config.GetStateStorageVersion(); + + info->CompatibleVersions.reserve(config.CompatibleVersionsSize()); + for (ui32 version : config.GetCompatibleVersions()) { + info->CompatibleVersions.push_back(version); + } + const size_t offset = FindIndex(namePrefix, char()); Y_VERIFY(offset != NPOS && (offset + sizeof(ui32)) < TActorId::MaxServiceIDLength); diff --git a/ydb/core/base/statestorage.h b/ydb/core/base/statestorage.h index 3a3c06c3b8..df49ba869a 100644 --- a/ydb/core/base/statestorage.h +++ b/ydb/core/base/statestorage.h @@ -476,6 +476,7 @@ struct TStateStorageInfo : public TThrRefBase { }; struct TRing { + bool IsDisabled; bool UseRingSpecificNodeSelection; TVector<TActorId> Replicas; @@ -487,6 +488,9 @@ struct TStateStorageInfo : public TThrRefBase { ui32 NToSelect; TVector<TRing> Rings; + ui32 StateStorageVersion; + TVector<ui32> CompatibleVersions; + void SelectReplicas(ui64 tabletId, TSelection *selection) const; TList<TActorId> SelectAllReplicas() const; ui32 ContentHash() const; diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index a77dff0c1e..5a54d3eece 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -163,10 +163,13 @@ message TDomainsConfig { repeated uint32 Node = 3; optional bool UseSingleNodeActorId = 4; optional bool UseRingSpecificNodeSelection = 5; + optional bool IsDisabled = 6 [default = false]; // used in the intermediate reconfiguration step } optional uint32 SSId = 1; optional TRing Ring = 2; + optional uint32 StateStorageVersion = 3 [default = 0]; + repeated uint32 CompatibleVersions = 4; } message TStoragePoolType { |