@@ -927,11 +927,39 @@ namespace Tests {
927
927
host.SetHostConfigId (hostConfig.GetHostConfigId ());
928
928
bsConfigureRequest->Record .MutableRequest ()->AddCommand ()->MutableDefineBox ()->CopyFrom (boxConfig);
929
929
930
+ std::unordered_map<TString, ui64> poolsConfigGenerations;
931
+ if (Settings->FetchPoolsGeneration ) {
932
+ auto bsDescribeRequest = MakeHolder<TEvBlobStorage::TEvControllerConfigRequest>();
933
+ auto & describeCommand = *bsDescribeRequest->Record .MutableRequest ()->AddCommand ()->MutableReadStoragePool ();
934
+ describeCommand.SetBoxId (Settings->BOX_ID );
935
+ for (const auto & [_, storagePool] : Settings->StoragePoolTypes ) {
936
+ describeCommand.AddName (storagePool.GetName ());
937
+ }
938
+
939
+ Runtime->SendToPipe (MakeBSControllerID (), sender, bsDescribeRequest.Release (), 0 , pipeConfig);
940
+ TAutoPtr<IEventHandle> handleDescResponse;
941
+ const auto descResponse = Runtime->GrabEdgeEventRethrow <TEvBlobStorage::TEvControllerConfigResponse>(handleDescResponse);
942
+
943
+ const auto & response = descResponse->Record .GetResponse ();
944
+ if (!response.GetSuccess ()) {
945
+ Cerr << " \n\n descResponse is #" << descResponse->Record .DebugString () << " \n\n " ;
946
+ }
947
+ UNIT_ASSERT (descResponse->Record .GetResponse ().GetSuccess ());
948
+ UNIT_ASSERT_VALUES_EQUAL (response.StatusSize (), 1 );
949
+ const auto & status = response.GetStatus (0 );
950
+
951
+ poolsConfigGenerations.reserve (status.StoragePoolSize ());
952
+ for (const auto & storagePool : status.GetStoragePool ()) {
953
+ UNIT_ASSERT (poolsConfigGenerations.emplace (storagePool.GetName (), storagePool.GetItemConfigGeneration ()).second );
954
+ }
955
+ }
956
+
930
957
for (const auto & [poolKind, storagePool] : Settings->StoragePoolTypes ) {
931
958
if (storagePool.GetNumGroups () > 0 ) {
932
959
auto * command = bsConfigureRequest->Record .MutableRequest ()->AddCommand ()->MutableDefineStoragePool ();
933
960
command->CopyFrom (storagePool);
934
- command->SetItemConfigGeneration (Settings->StorageGeneration );
961
+ const auto poolGenerationIt = poolsConfigGenerations.find (storagePool.GetName ());
962
+ command->SetItemConfigGeneration (poolGenerationIt == poolsConfigGenerations.end () ? Settings->StorageGeneration : poolGenerationIt->second );
935
963
}
936
964
}
937
965
0 commit comments