diff options
author | Alexey Efimov <xeno@prnwatch.com> | 2022-04-01 19:02:28 +0300 |
---|---|---|
committer | Alexey Efimov <xeno@prnwatch.com> | 2022-04-01 19:02:28 +0300 |
commit | 2d46b6cc220ceeaa928317415544bedda99fa28a (patch) | |
tree | 473300b23a76803657bb5b1ad54ae13708cbdeee | |
parent | d2b85af50645125b16517ade92bce6406da6eb0b (diff) | |
download | ydb-2d46b6cc220ceeaa928317415544bedda99fa28a.tar.gz |
dirty workaround for test KIKIMR-14624
ref:4c78aac9f85b6757dbe4b42a276ed5a9159ccd7b
-rw-r--r-- | ydb/core/mind/hive/hive.h | 4 | ||||
-rw-r--r-- | ydb/core/mind/hive/hive_impl.cpp | 2 | ||||
-rw-r--r-- | ydb/core/mind/hive/hive_impl_ut.cpp | 4 | ||||
-rw-r--r-- | ydb/core/mind/hive/hive_ut.cpp | 17 | ||||
-rw-r--r-- | ydb/core/mind/hive/storage_pool_info.cpp | 2 | ||||
-rw-r--r-- | ydb/core/mind/hive/storage_pool_info.h | 1 | ||||
-rw-r--r-- | ydb/core/protos/config.proto | 1 | ||||
-rw-r--r-- | ydb/core/testlib/basics/appdata.cpp | 5 | ||||
-rw-r--r-- | ydb/core/testlib/basics/appdata.h | 1 |
9 files changed, 33 insertions, 4 deletions
diff --git a/ydb/core/mind/hive/hive.h b/ydb/core/mind/hive/hive.h index cce565aecd6..c51cb1df93b 100644 --- a/ydb/core/mind/hive/hive.h +++ b/ydb/core/mind/hive/hive.h @@ -132,6 +132,10 @@ struct THiveSharedSettings { bool GetStorageSafeMode() const { return CurrentConfig.GetStorageSafeMode(); } + + TDuration GetStoragePoolFreshPeriod() const { + return TDuration::MilliSeconds(CurrentConfig.GetStoragePoolFreshPeriod()); + } }; struct TDrainSettings { diff --git a/ydb/core/mind/hive/hive_impl.cpp b/ydb/core/mind/hive/hive_impl.cpp index 9e85839722a..e7fd0e1d7cc 100644 --- a/ydb/core/mind/hive/hive_impl.cpp +++ b/ydb/core/mind/hive/hive_impl.cpp @@ -880,7 +880,7 @@ void THive::AssignTabletGroups(TLeaderTabletInfo& tablet) { } if (!storagePoolsToRefresh.empty()) { - // we had to refresh storage pool state from BSC + // we need to refresh storage pool state from BSC TVector<THolder<NKikimrBlobStorage::TEvControllerSelectGroups::TGroupParameters>> requests; for (TString storagePoolName : storagePoolsToRefresh) { TStoragePoolInfo& storagePool = GetStoragePool(storagePoolName); diff --git a/ydb/core/mind/hive/hive_impl_ut.cpp b/ydb/core/mind/hive/hive_impl_ut.cpp index 077c3eab24c..9e6ff996ff5 100644 --- a/ydb/core/mind/hive/hive_impl_ut.cpp +++ b/ydb/core/mind/hive/hive_impl_ut.cpp @@ -63,8 +63,12 @@ Y_UNIT_TEST_SUITE(THiveImplTest) { passed = timer.Passed(); Ctest << "Process = " << passed << Endl; #ifndef SANITIZER_TYPE +#ifndef NDEBUG + UNIT_ASSERT(passed < 10); +#else UNIT_ASSERT(passed < 2); #endif +#endif timer.Reset(); diff --git a/ydb/core/mind/hive/hive_ut.cpp b/ydb/core/mind/hive/hive_ut.cpp index 27d654014ec..988eb6e8017 100644 --- a/ydb/core/mind/hive/hive_ut.cpp +++ b/ydb/core/mind/hive/hive_ut.cpp @@ -65,7 +65,6 @@ namespace { runtime.SetLogPriority(NKikimrServices::TABLET_MAIN, otherPriority); runtime.SetLogPriority(NKikimrServices::TABLET_EXECUTOR, otherPriority); runtime.SetLogPriority(NKikimrServices::BS_NODE, otherPriority); - runtime.SetLogPriority(NKikimrServices::BS_CONTROLLER, otherPriority); runtime.SetLogPriority(NKikimrServices::BS_PROXY, otherPriority); runtime.SetLogPriority(NKikimrServices::BS_SYNCLOG, NLog::PRI_CRIT); runtime.SetLogPriority(NKikimrServices::BS_SYNCER, NLog::PRI_CRIT); @@ -252,6 +251,7 @@ namespace { app.SetMinRequestSequenceSize(10); // for smaller sequences and high interaction between root and domain hives app.SetRequestSequenceSize(10); + app.SetHiveStoragePoolFreshPeriod(0); SetupNodeWarden(runtime); SetupPDisk(runtime); @@ -2418,6 +2418,21 @@ Y_UNIT_TEST_SUITE(THiveTest) { ui64 tabletId = SendCreateTestTablet(runtime, hiveTablet, testerTablet, MakeHolder<TEvHive::TEvCreateTablet>(testerTablet, 0, tabletType, BINDED_CHANNELS), 0, true); MakeSureTabletIsUp(runtime, tabletId, 0); + + auto updateDiskStatus = MakeHolder<TEvBlobStorage::TEvControllerUpdateDiskStatus>(); + + NKikimrBlobStorage::TVDiskMetrics* vdiskMetrics = updateDiskStatus->Record.AddVDisksMetrics(); + + vdiskMetrics->MutableVDiskId()->SetGroupID(2147483650); + vdiskMetrics->MutableVDiskId()->SetGroupGeneration(1); + vdiskMetrics->MutableVDiskId()->SetRing(0); + vdiskMetrics->MutableVDiskId()->SetDomain(0); + vdiskMetrics->MutableVDiskId()->SetVDisk(0); + vdiskMetrics->SetAvailableSize(100000); + + TActorId sender = runtime.AllocateEdgeActor(); + runtime.SendToPipe(MakeBSControllerID(0), sender, updateDiskStatus.Release(), 0, GetPipeConfigWithRetries()); + SendReassignTabletSpace(runtime, hiveTablet, tabletId, {}, 0); { TDispatchOptions options; diff --git a/ydb/core/mind/hive/storage_pool_info.cpp b/ydb/core/mind/hive/storage_pool_info.cpp index fafd6644dee..99cb48871c1 100644 --- a/ydb/core/mind/hive/storage_pool_info.cpp +++ b/ydb/core/mind/hive/storage_pool_info.cpp @@ -145,7 +145,7 @@ bool TStoragePoolInfo::IsBalanceBySize() const { } bool TStoragePoolInfo::IsFresh() const { - return TInstant::Now() < LastUpdate + FreshPeriod; + return TInstant::Now() < LastUpdate + Settings->GetStoragePoolFreshPeriod(); } void TStoragePoolInfo::SetAsFresh() { diff --git a/ydb/core/mind/hive/storage_pool_info.h b/ydb/core/mind/hive/storage_pool_info.h index b606fc40b7e..5b6a4406fdd 100644 --- a/ydb/core/mind/hive/storage_pool_info.h +++ b/ydb/core/mind/hive/storage_pool_info.h @@ -11,7 +11,6 @@ using namespace NKikimrBlobStorage; class THive; struct TStoragePoolInfo { - static constexpr TDuration FreshPeriod = TDuration::Minutes(1); THiveSharedSettings* Settings; NKikimrConfig::THiveConfig::EHiveStorageBalanceStrategy GetBalanceStrategy() const { diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index b7c4bc2f1c5..1599fbff70d 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1341,6 +1341,7 @@ message THiveConfig { optional uint64 PostponeStartPeriod = 44 [default = 1000]; // milliseconds optional EHiveNodeSelectStrategy NodeSelectStrategy = 45 [default = HIVE_NODE_SELECT_STRATEGY_RANDOM_MIN_7P]; optional bool CheckMoveExpediency = 46 [default = true]; + optional uint64 StoragePoolFreshPeriod = 47 [default = 60000]; // milliseconds } message TDataShardConfig { diff --git a/ydb/core/testlib/basics/appdata.cpp b/ydb/core/testlib/basics/appdata.cpp index 9a0eb661ed9..e9e105a1383 100644 --- a/ydb/core/testlib/basics/appdata.cpp +++ b/ydb/core/testlib/basics/appdata.cpp @@ -168,6 +168,11 @@ namespace NKikimr { HiveConfig.SetRequestSequenceSize(value); } + void TAppPrepare::SetHiveStoragePoolFreshPeriod(ui64 value) + { + HiveConfig.SetStoragePoolFreshPeriod(value); + } + void TAppPrepare::AddSystemBackupSID(const TString& sid) { MeteringConfig.AddSystemBackupSIDs(sid); diff --git a/ydb/core/testlib/basics/appdata.h b/ydb/core/testlib/basics/appdata.h index 409869161f5..5618db56f34 100644 --- a/ydb/core/testlib/basics/appdata.h +++ b/ydb/core/testlib/basics/appdata.h @@ -66,6 +66,7 @@ namespace NKikimr { void SetChangesQueueBytesLimit(ui64 value); void SetMinRequestSequenceSize(ui64 value); void SetRequestSequenceSize(ui64 value); + void SetHiveStoragePoolFreshPeriod(ui64 value); void AddSystemBackupSID(const TString& sid); void SetEnableProtoSourceIdInfo(std::optional<bool> value); |