diff options
| author | alexvru <[email protected]> | 2023-06-21 09:38:39 +0300 |
|---|---|---|
| committer | alexvru <[email protected]> | 2023-06-21 09:38:39 +0300 |
| commit | 9a987ea00b435b2905fb5d0d243bcddeff0eec26 (patch) | |
| tree | 644bffc77672dbe01d2c5ff0d87119679d870ec8 | |
| parent | 599d36e52278e1aef748053f8a7c4a92a4e3c75b (diff) | |
Revert "Add TCompatibilityInfo to VDisk,"
This reverts commit c8627b03515586a67c4774e846b64ceba9163efc, reversing
changes made to 8fa7a4b7716e29dc17d30ab8b1dc4f079ccc8b4f.
16 files changed, 10 insertions, 132 deletions
diff --git a/ydb/core/blobstorage/ut_blobstorage/CMakeLists.darwin-x86_64.txt b/ydb/core/blobstorage/ut_blobstorage/CMakeLists.darwin-x86_64.txt index 311f4de7013..844cc787c3c 100644 --- a/ydb/core/blobstorage/ut_blobstorage/CMakeLists.darwin-x86_64.txt +++ b/ydb/core/blobstorage/ut_blobstorage/CMakeLists.darwin-x86_64.txt @@ -53,7 +53,6 @@ target_sources(ydb-core-blobstorage-ut_blobstorage PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/snapshots.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/space_check.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/sync.cpp - ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/vdisk_recovery.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/big_cluster.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/get.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/discover.cpp diff --git a/ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-aarch64.txt b/ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-aarch64.txt index 73a0b53bbf6..7134c089845 100644 --- a/ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-aarch64.txt +++ b/ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-aarch64.txt @@ -56,7 +56,6 @@ target_sources(ydb-core-blobstorage-ut_blobstorage PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/snapshots.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/space_check.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/sync.cpp - ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/vdisk_recovery.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/big_cluster.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/get.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/discover.cpp diff --git a/ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-x86_64.txt b/ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-x86_64.txt index c13939ab2f2..f3c7bbe3d6b 100644 --- a/ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-x86_64.txt +++ b/ydb/core/blobstorage/ut_blobstorage/CMakeLists.linux-x86_64.txt @@ -57,7 +57,6 @@ target_sources(ydb-core-blobstorage-ut_blobstorage PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/snapshots.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/space_check.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/sync.cpp - ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/vdisk_recovery.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/big_cluster.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/get.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/discover.cpp diff --git a/ydb/core/blobstorage/ut_blobstorage/CMakeLists.windows-x86_64.txt b/ydb/core/blobstorage/ut_blobstorage/CMakeLists.windows-x86_64.txt index 5afa9123000..2537ba3d23e 100644 --- a/ydb/core/blobstorage/ut_blobstorage/CMakeLists.windows-x86_64.txt +++ b/ydb/core/blobstorage/ut_blobstorage/CMakeLists.windows-x86_64.txt @@ -46,7 +46,6 @@ target_sources(ydb-core-blobstorage-ut_blobstorage PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/snapshots.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/space_check.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/sync.cpp - ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/vdisk_recovery.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/big_cluster.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/get.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/ut_blobstorage/discover.cpp diff --git a/ydb/core/blobstorage/ut_blobstorage/vdisk_recovery.cpp b/ydb/core/blobstorage/ut_blobstorage/vdisk_recovery.cpp deleted file mode 100644 index f3b309d5708..00000000000 --- a/ydb/core/blobstorage/ut_blobstorage/vdisk_recovery.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include <ydb/core/blobstorage/ut_blobstorage/lib/env.h> -#include <ydb/core/driver_lib/version/version.h> -#include <ydb/core/driver_lib/version/ut/ut_helpers.h> -#include <library/cpp/testing/unittest/registar.h> - -Y_UNIT_TEST_SUITE(VDiskRecovery) { - using TCurrent = NKikimrConfig::TCurrentCompatibilityInfo; - using TYdbVersion = TCompatibilityInfo::TProtoConstructor::TYdbVersion; - using TCurrentConstructor = TCompatibilityInfo::TProtoConstructor::TCurrentCompatibilityInfo; - - void TestVersion(TCurrent oldInfo, TCurrent newInfo, bool expected) { - TCompatibilityInfoTest::Reset(&oldInfo); - TEnvironmentSetup env{{ - .Erasure = TBlobStorageGroupType::ErasureMirror3dc, - }}; - env.CreateBoxAndPool(1, 1); - - // Get group info from BSC - NKikimrBlobStorage::TConfigRequest request; - request.AddCommand()->MutableQueryBaseConfig(); - auto response = env.Invoke(request); - - const auto& base = response.GetStatus(0).GetBaseConfig(); - UNIT_ASSERT_VALUES_EQUAL(base.GroupSize(), 1); - ui32 groupId = base.GetGroup(0).GetGroupId(); - - ui32 puts = 0; - - auto put = [&](bool expected) { - TActorId sender = env.Runtime->AllocateEdgeActor(1); - TString data = "Test"; - auto ev = new TEvBlobStorage::TEvPut(TLogoBlobID(1, 1, 1, 1, data.size(), puts++), data, TInstant::Max()); - - env.Runtime->WrapInActorContext(sender, [&] { - SendToBSProxy(sender, groupId, ev, 0); - }); - auto res = env.WaitForEdgeActorEvent<TEvBlobStorage::TEvPutResult>(sender, true, TInstant::Max()); - - if (expected) { - UNIT_ASSERT_VALUES_EQUAL(res->Get()->Status, NKikimrProto::OK); - } else { - UNIT_ASSERT_VALUES_UNEQUAL(res->Get()->Status, NKikimrProto::OK); - } - }; - - env.Sim(TDuration::Seconds(30)); - put(true); - env.Cleanup(); - TCompatibilityInfoTest::Reset(&newInfo); - env.Initialize(); - env.Sim(TDuration::Seconds(30)); - put(expected); - } - - Y_UNIT_TEST(OldCompatibleVersion) { - TCurrentConstructor oldInfo = { - .Build = "ydb", - .YdbVersion = TYdbVersion{ .Year = 23, .Major = 1, .Minor = 22, .Hotfix = 0 } - }; - TCurrentConstructor newInfo = { - .Build = "ydb", - .YdbVersion = TYdbVersion{ .Year = 23, .Major = 2, .Minor = 1, .Hotfix = 0 } - }; - TestVersion(oldInfo.ToPB(), newInfo.ToPB(), true); - } - - Y_UNIT_TEST(OldIncompatibleVersion) { - TCurrentConstructor oldInfo = { - .Build = "ydb", - .YdbVersion = TYdbVersion{ .Year = 23, .Major = 1, .Minor = 22, .Hotfix = 0 } - }; - TCurrentConstructor newInfo = { - .Build = "ydb", - .YdbVersion = TYdbVersion{ .Year = 23, .Major = 3, .Minor = 1, .Hotfix = 0 } - }; - TestVersion(oldInfo.ToPB(), newInfo.ToPB(), false); - } -}
\ No newline at end of file diff --git a/ydb/core/blobstorage/ut_blobstorage/ya.make b/ydb/core/blobstorage/ut_blobstorage/ya.make index 0755cd13dc9..9fd17327c12 100644 --- a/ydb/core/blobstorage/ut_blobstorage/ya.make +++ b/ydb/core/blobstorage/ut_blobstorage/ya.make @@ -29,7 +29,6 @@ SRCS( snapshots.cpp space_check.cpp sync.cpp - vdisk_recovery.cpp ) IF (BUILD_TYPE == "RELEASE") diff --git a/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_public.cpp b/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_public.cpp index a85924a9e3a..ec0a809e7f4 100644 --- a/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_public.cpp +++ b/ydb/core/blobstorage/vdisk/localrecovery/localrecovery_public.cpp @@ -373,11 +373,9 @@ namespace NKikimr { // read existing one LocRecCtx->RecovInfo->EmptySyncer = false; const TRcBuf &entryPoint = it->second.Data; - TString errorReason; if (!TSyncerData::CheckEntryPoint(LocRecCtx->VCtx->VDiskLogPrefix, SkeletonId, - LocRecCtx->VCtx->ShortSelfVDisk, LocRecCtx->VCtx->Top, entryPoint, errorReason)) { - SignalErrorAndDie(ctx, NKikimrProto::ERROR, - TStringBuilder() << "Entry point for Syncer check failed, ErrorReason# " << errorReason); + LocRecCtx->VCtx->ShortSelfVDisk, LocRecCtx->VCtx->Top, entryPoint)) { + SignalErrorAndDie(ctx, NKikimrProto::ERROR, "Entry point for Syncer check failed"); return false; } LocRecCtx->SyncerData = MakeIntrusive<TSyncerData>( diff --git a/ydb/core/blobstorage/vdisk/syncer/CMakeLists.darwin-x86_64.txt b/ydb/core/blobstorage/vdisk/syncer/CMakeLists.darwin-x86_64.txt index c1c9968058c..61cea37ccdc 100644 --- a/ydb/core/blobstorage/vdisk/syncer/CMakeLists.darwin-x86_64.txt +++ b/ydb/core/blobstorage/vdisk/syncer/CMakeLists.darwin-x86_64.txt @@ -21,7 +21,6 @@ target_link_libraries(blobstorage-vdisk-syncer PUBLIC blobstorage-vdisk-anubis_osiris blobstorage-vdisk-common vdisk-hulldb-base - version ) target_sources(blobstorage-vdisk-syncer PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_committer.cpp diff --git a/ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-aarch64.txt b/ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-aarch64.txt index dbd1f3e1613..ae4f1bd9913 100644 --- a/ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-aarch64.txt +++ b/ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-aarch64.txt @@ -22,7 +22,6 @@ target_link_libraries(blobstorage-vdisk-syncer PUBLIC blobstorage-vdisk-anubis_osiris blobstorage-vdisk-common vdisk-hulldb-base - version ) target_sources(blobstorage-vdisk-syncer PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_committer.cpp diff --git a/ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-x86_64.txt b/ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-x86_64.txt index dbd1f3e1613..ae4f1bd9913 100644 --- a/ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-x86_64.txt +++ b/ydb/core/blobstorage/vdisk/syncer/CMakeLists.linux-x86_64.txt @@ -22,7 +22,6 @@ target_link_libraries(blobstorage-vdisk-syncer PUBLIC blobstorage-vdisk-anubis_osiris blobstorage-vdisk-common vdisk-hulldb-base - version ) target_sources(blobstorage-vdisk-syncer PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_committer.cpp diff --git a/ydb/core/blobstorage/vdisk/syncer/CMakeLists.windows-x86_64.txt b/ydb/core/blobstorage/vdisk/syncer/CMakeLists.windows-x86_64.txt index c1c9968058c..61cea37ccdc 100644 --- a/ydb/core/blobstorage/vdisk/syncer/CMakeLists.windows-x86_64.txt +++ b/ydb/core/blobstorage/vdisk/syncer/CMakeLists.windows-x86_64.txt @@ -21,7 +21,6 @@ target_link_libraries(blobstorage-vdisk-syncer PUBLIC blobstorage-vdisk-anubis_osiris blobstorage-vdisk-common vdisk-hulldb-base - version ) target_sources(blobstorage-vdisk-syncer PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_committer.cpp diff --git a/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_data.cpp b/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_data.cpp index 0c4c398ae1d..e1944ac30b4 100644 --- a/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_data.cpp +++ b/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_data.cpp @@ -254,7 +254,6 @@ namespace NKikimr { s.Signature = SyncerDataSignature; Neighbors->Serialize(&s.Proto, info); LocalSyncerState.Serialize(s.Proto.MutableLocalGuidInfo()); - s.Proto.MutableCompatibilityInfo()->CopyFrom(CurrentCompatibilityInfo); } TString TSyncerData::Serialize(const TBlobStorageGroupInfo *info) const { @@ -270,11 +269,6 @@ namespace NKikimr { Y_VERIFY(status); LocalSyncerState.Parse(proto.GetLocalGuidInfo()); Neighbors->Parse(proto); - - if (proto.HasCompatibilityInfo()) { - StoredCompatibilityInfo.emplace(); - StoredCompatibilityInfo->CopyFrom(proto.GetCompatibilityInfo()); - } } } @@ -307,16 +301,6 @@ namespace NKikimr { } } - bool TSyncerData::CheckCompatibility(TString& errorReason) { - if (StoredCompatibilityInfo) { - return TCompatibilityInfo::CheckCompatibility(&*StoredCompatibilityInfo, - (ui32)NKikimrConfig::TCompatibilityRule::VDisk, errorReason); - } else { - return TCompatibilityInfo::CheckCompatibility(TCompatibilityInfo::GetUnknown(), - (ui32)NKikimrConfig::TCompatibilityRule::VDisk, errorReason); - } - } - TSyncerData::TSyncerData(const TString &logPrefix, const TActorId ¬ifyId, const TVDiskIdShort &selfVDisk, @@ -328,7 +312,6 @@ namespace NKikimr { top)) , LocalSyncerState() , NotifyId(notifyId) - , CurrentCompatibilityInfo(TCompatibilityInfo::MakeStored(NKikimrConfig::TCompatibilityRule::VDisk)) { TString serProto = WithoutSignature(Convert(selfVDisk, top, entryPoint)); ParseWOSignature(serProto); @@ -345,7 +328,6 @@ namespace NKikimr { top)) , LocalSyncerState() , NotifyId(notifyId) - , CurrentCompatibilityInfo(TCompatibilityInfo::MakeStored(NKikimrConfig::TCompatibilityRule::VDisk)) { TString serProto = WithoutSignature(Convert(selfVDisk, top, entryPoint)); ParseWOSignature(serProto); @@ -355,34 +337,30 @@ namespace NKikimr { const TActorId ¬ifyId, const TVDiskIdShort &selfVDisk, std::shared_ptr<TBlobStorageGroupInfo::TTopology> top, - const TString &entryPoint, - TString& errorReason) { + const TString &entryPoint) { try { TSyncerData n(logPrefix, notifyId, selfVDisk, top); TString serProto = WithoutSignature(Convert(selfVDisk, top, entryPoint)); n.ParseWOSignature(serProto); - return n.CheckCompatibility(errorReason); - } catch (yexception e) { - errorReason = e.what(); + } catch (yexception) { return false; } + return true; } bool TSyncerData::CheckEntryPoint(const TString &logPrefix, const TActorId ¬ifyId, const TVDiskIdShort &selfVDisk, std::shared_ptr<TBlobStorageGroupInfo::TTopology> top, - const TContiguousSpan &entryPoint, - TString& errorReason) { + const TContiguousSpan &entryPoint) { try { TSyncerData n(logPrefix, notifyId, selfVDisk, top); TString serProto = WithoutSignature(Convert(selfVDisk, top, entryPoint)); //FIXME(innokentii) unnecessary copy n.ParseWOSignature(serProto); - return n.CheckCompatibility(errorReason); - } catch (yexception e) { - errorReason = e.what(); + } catch (yexception) { return false; } + return true; } // Convert from old entry point format to protobuf format diff --git a/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_data.h b/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_data.h index 7e29247e055..0ad21de03b7 100644 --- a/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_data.h +++ b/ydb/core/blobstorage/vdisk/syncer/blobstorage_syncer_data.h @@ -7,7 +7,6 @@ #include <ydb/core/blobstorage/vdisk/common/vdisk_syncneighbors.h> #include <ydb/core/blobstorage/vdisk/common/vdisk_events.h> #include <ydb/core/blobstorage/vdisk/ingress/blobstorage_ingress.h> -#include <ydb/core/driver_lib/version/version.h> #include <ydb/core/base/appdata.h> @@ -190,8 +189,6 @@ namespace NKikimr { TSyncNeighborsPtr Neighbors; NSyncer::TLocalSyncerState LocalSyncerState; const TActorId NotifyId; - std::optional<NKikimrConfig::TStoredCompatibilityInfo> StoredCompatibilityInfo; - NKikimrConfig::TStoredCompatibilityInfo CurrentCompatibilityInfo; TSyncerData(const TString &logPrefix, const TActorId ¬ifyId, @@ -211,7 +208,6 @@ namespace NKikimr { void PutFromRecoveryLog(const TVDiskIdShort &vdisk, const TSyncState &syncState); TString Serialize(const TBlobStorageGroupInfo *info) const; void Serialize(TSyncerDataSerializer &s, const TBlobStorageGroupInfo *info) const; - bool CheckCompatibility(TString& errorReason); // check and cut signature static TContiguousSpan WithoutSignature(TContiguousSpan entryPoint); @@ -220,14 +216,12 @@ namespace NKikimr { const TActorId ¬ifyId, const TVDiskIdShort &selfVDisk, std::shared_ptr<TBlobStorageGroupInfo::TTopology> top, - const TString &entryPoint, - TString& errorReason); + const TString &entryPoint); static bool CheckEntryPoint(const TString &logPrefix, const TActorId ¬ifyId, const TVDiskIdShort &selfVDisk, std::shared_ptr<TBlobStorageGroupInfo::TTopology> top, - const TContiguousSpan &entryPoint, - TString& errorReason); + const TContiguousSpan &entryPoint); // Convert from old entry point format to protobuf format // TODO: we can remove this function after migrating to the protobuf format diff --git a/ydb/core/blobstorage/vdisk/syncer/ya.make b/ydb/core/blobstorage/vdisk/syncer/ya.make index 3fc0d3926ac..f8fc07b2150 100644 --- a/ydb/core/blobstorage/vdisk/syncer/ya.make +++ b/ydb/core/blobstorage/vdisk/syncer/ya.make @@ -10,7 +10,6 @@ PEERDIR( ydb/core/blobstorage/vdisk/anubis_osiris ydb/core/blobstorage/vdisk/common ydb/core/blobstorage/vdisk/hulldb/base - ydb/core/driver_lib/version ) SRCS( diff --git a/ydb/core/protos/blobstorage_vdisk_internal.proto b/ydb/core/protos/blobstorage_vdisk_internal.proto index 69f3b49235c..fc674e70c08 100644 --- a/ydb/core/protos/blobstorage_vdisk_internal.proto +++ b/ydb/core/protos/blobstorage_vdisk_internal.proto @@ -1,7 +1,6 @@ import "ydb/core/protos/base.proto"; import "ydb/core/protos/blobstorage.proto"; import "ydb/core/protos/blobstorage_disk.proto"; -import "ydb/core/protos/config.proto"; package NKikimrVDiskData; @@ -122,8 +121,6 @@ message TSyncerVDiskEntry { message TSyncerEntryPoint { optional NKikimrBlobStorage.TLocalGuidInfo LocalGuidInfo = 5; repeated TSyncerVDiskEntry Entries = 10; - // Info about YDB version of VDisk which made this record - optional NKikimrConfig.TStoredCompatibilityInfo CompatibilityInfo = 15; }; message TIncrHugeChunks { diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index 296023be185..fcd260195f0 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1882,7 +1882,6 @@ message TCompatibilityRule { Test1 = 1; Test2 = 2; Interconnect = 3; - VDisk = 4; } optional string Build = 1; |
