@@ -110,6 +110,18 @@ enum class ENaivePatchCase {
110110 ErrorOnPut,
111111};
112112
113+ #define CASE_TO_RETURN_STRING (cs ) \
114+ case cs: return #cs \
115+ // end CASE_TO_RETURN_STRING
116+ TString ToString (ENaivePatchCase cs) {
117+ switch (cs) {
118+ CASE_TO_RETURN_STRING (ENaivePatchCase::Ok);
119+ CASE_TO_RETURN_STRING (ENaivePatchCase::ErrorOnGetItem);
120+ CASE_TO_RETURN_STRING (ENaivePatchCase::ErrorOnGet);
121+ CASE_TO_RETURN_STRING (ENaivePatchCase::ErrorOnPut);
122+ }
123+ }
124+
113125NKikimrProto::EReplyStatus GetPatchResultStatus (ENaivePatchCase naiveCase) {
114126 switch (naiveCase) {
115127 case ENaivePatchCase::Ok:
@@ -156,6 +168,17 @@ enum class EVPatchCase {
156168 Custom,
157169};
158170
171+ TString ToString (EVPatchCase cs) {
172+ switch (cs) {
173+ CASE_TO_RETURN_STRING (EVPatchCase::Ok);
174+ CASE_TO_RETURN_STRING (EVPatchCase::OneErrorAndAllPartExistInStart);
175+ CASE_TO_RETURN_STRING (EVPatchCase::OnePartLostInStart);
176+ CASE_TO_RETURN_STRING (EVPatchCase::DeadGroupInStart);
177+ CASE_TO_RETURN_STRING (EVPatchCase::ErrorDuringVPatchDiff);
178+ CASE_TO_RETURN_STRING (EVPatchCase::Custom);
179+ }
180+ }
181+
159182NKikimrProto::EReplyStatus GetPatchResultStatus (EVPatchCase vpatchCase) {
160183 switch (vpatchCase) {
161184 case EVPatchCase::Ok:
@@ -249,6 +272,15 @@ enum class EMovedPatchCase {
249272 Error
250273};
251274
275+ TString ToString (EMovedPatchCase cs) {
276+ switch (cs) {
277+ CASE_TO_RETURN_STRING (EMovedPatchCase::Ok);
278+ CASE_TO_RETURN_STRING (EMovedPatchCase::Error);
279+ }
280+ }
281+
282+ #undef CASE_TO_RETURN_STRING
283+
252284NKikimrProto::EReplyStatus GetPatchResultStatus (EMovedPatchCase movedCase) {
253285 switch (movedCase) {
254286 case EMovedPatchCase::Ok:
@@ -289,7 +321,7 @@ void ReceivePatchResult(TTestBasicRuntime &runtime, const TTestArgs &args, NKiki
289321}
290322
291323void ConductGet (TTestBasicRuntime &runtime, const TTestArgs &args, ENaivePatchCase naiveCase) {
292- CTEST << " ConductGet: Start\n " ;
324+ CTEST << " ConductGet: Start NaiveCase: " << ToString (naiveCase) << " \n " ;
293325 NKikimrProto::EReplyStatus resultStatus = GetGetResultStatus (naiveCase);
294326 TAutoPtr<IEventHandle> handle;
295327 TEvBlobStorage::TEvGet *get = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvGet>(handle);
@@ -328,10 +360,10 @@ TString MakePatchedBuffer(const TTestArgs &args) {
328360void ConductPut (TTestBasicRuntime &runtime, const TTestArgs &args, ENaivePatchCase naiveCase) {
329361 NKikimrProto::EReplyStatus resultStatus = GetPutResultStatus (naiveCase);
330362 if (resultStatus == NKikimrProto::UNKNOWN) {
331- CTEST << " ConductPut: Skip\n " ;
363+ CTEST << " ConductPut: Skip NaiveCase: " << ToString (naiveCase) << " \n " ;
332364 return ;
333365 }
334- CTEST << " ConductPut: Start\n " ;
366+ CTEST << " ConductPut: Start NaiveCase: " << ToString (naiveCase) << " \n " ;
335367 TAutoPtr<IEventHandle> handle;
336368 TEvBlobStorage::TEvPut *put = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvPut>(handle);
337369 UNIT_ASSERT_VALUES_EQUAL (put->Id , args.PatchedId );
@@ -346,22 +378,35 @@ void ConductPut(TTestBasicRuntime &runtime, const TTestArgs &args, ENaivePatchCa
346378}
347379
348380void ConductNaivePatch (TTestBasicRuntime &runtime, const TTestArgs &args, ENaivePatchCase naiveCase) {
349- CTEST << " ConductNaivePatch: Start\n " ;
381+ CTEST << " ConductNaivePatch: Start NaiveCase: " << ToString (naiveCase) << Endl ;
350382 ConductGet (runtime, args, naiveCase);
351383 ConductPut (runtime, args, naiveCase);
352384 NKikimrProto::EReplyStatus resultStatus = GetPatchResultStatus (naiveCase);
353385 ReceivePatchResult (runtime, args, resultStatus);
354386 CTEST << " ConductNaivePatch: Finish\n " ;
355387}
356388
389+ template <typename InnerType>
390+ TString ToString (const TVector<InnerType> &lst) {
391+ TStringBuilder bld;
392+ bld << ' [' ;
393+ for (ui32 idx = 0 ; idx < lst.size (); ++idx) {
394+ if (idx) {
395+ bld << " , " ;
396+ }
397+ bld << lst[idx];
398+ }
399+ bld << ' ]' ;
400+ return bld;
401+ }
357402
358403void ConductVPatchStart (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
359- EVPatchCase naiveCase , TVDiskPointer vdiskPointer)
404+ EVPatchCase vpatchCase , TVDiskPointer vdiskPointer)
360405{
361406 auto [vdiskIdx, idxInSubgroup] = vdiskPointer.GetIndecies (env, args.OriginalId .Hash ());
362- CTEST << " ConductVPatchStart: Start vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " \n " ;
407+ CTEST << " ConductVPatchStart: Start vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " VPatchCase: " << ToString (vpatchCase) << " \n " ;
363408 TVDiskID vdisk = env.Info ->GetVDiskInSubgroup (idxInSubgroup, args.OriginalId .Hash ());
364- auto [status, parts] = GetVPatchFoundPartsStatus (env, args, naiveCase , vdiskPointer);
409+ auto [status, parts] = GetVPatchFoundPartsStatus (env, args, vpatchCase , vdiskPointer);
365410
366411 auto start = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvVPatchStart>({env.VDisks [vdiskIdx]});
367412 auto &startRecord = start->Get ()->Record ;
@@ -376,21 +421,22 @@ void ConductVPatchStart(TTestBasicRuntime &runtime, const TDSProxyEnv &env, cons
376421 for (auto partId : parts) {
377422 foundParts->AddPart (partId);
378423 }
424+ CTEST << " ConductVPatchStart: Send FoundParts vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " parts# " << ToString (parts) << " \n " ;
379425 SendByHandle (runtime, start, std::move (foundParts));
380426 CTEST << " ConductVPatchStart: Finish vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " \n " ;
381427}
382428
383429void ConductVPatchDiff (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
384- EVPatchCase naiveCase , TVDiskPointer vdiskPointer)
430+ EVPatchCase vpatchCase , TVDiskPointer vdiskPointer)
385431{
386432 auto [vdiskIdx, idxInSubgroup] = vdiskPointer.GetIndecies (env, args.PatchedId .Hash ());
387433 TVDiskID vdisk = env.Info ->GetVDiskInSubgroup (idxInSubgroup, args.PatchedId .Hash ());
388- NKikimrProto::EReplyStatus resultStatus = GetVPatchResultStatus (env, args, naiveCase , vdiskPointer);
434+ NKikimrProto::EReplyStatus resultStatus = GetVPatchResultStatus (env, args, vpatchCase , vdiskPointer);
389435 if (resultStatus == NKikimrProto::UNKNOWN) {
390- CTEST << " ConductVPatchDiff: Skip vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " \n " ;
436+ CTEST << " ConductVPatchDiff: Skip vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " VPatchCase: " << ToString (vpatchCase) << " \n " ;
391437 return ;
392438 }
393- CTEST << " ConductVPatchDiff: Start vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " \n " ;
439+ CTEST << " ConductVPatchDiff: Start vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " VPatchCase: " << ToString (vpatchCase) << " \n " ;
394440
395441 auto diffEv = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvVPatchDiff>({env.VDisks [vdiskIdx]});
396442 auto &diffRecord = diffEv->Get ()->Record ;
@@ -415,6 +461,7 @@ void ConductVPatchDiff(TTestBasicRuntime &runtime, const TDSProxyEnv &env, const
415461}
416462
417463void ConductFailedVPatch (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args) {
464+ return ; // disabled vpatch
418465 CTEST << " ConductFailedVPatch: Start\n " ;
419466 for (ui32 idxInSubgroup = 0 ; idxInSubgroup < args.GType .BlobSubgroupSize (); ++idxInSubgroup) {
420467 TVDiskPointer vdisk = TVDiskPointer::GetVDiskIdx (idxInSubgroup);
@@ -429,7 +476,7 @@ void ConductFailedVPatch(TTestBasicRuntime &runtime, const TDSProxyEnv &env, con
429476
430477
431478void ConductVMovedPatch (TTestBasicRuntime &runtime, const TTestArgs &args, EMovedPatchCase movedCase) {
432- CTEST << " ConductVMovedPatch: Start\n " ;
479+ CTEST << " ConductVMovedPatch: Start MovedPatchCase: " << ToString (movedCase) << Endl ;
433480 NKikimrProto::EReplyStatus resultStatus = GetVMovedPatchResultStatus (movedCase);
434481 TAutoPtr<IEventHandle> handle;
435482 TEvBlobStorage::TEvVMovedPatch *vPatch = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvVMovedPatch>(handle);
@@ -459,7 +506,7 @@ void ConductVMovedPatch(TTestBasicRuntime &runtime, const TTestArgs &args, EMove
459506void ConductMovedPatch (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
460507 EMovedPatchCase movedCase)
461508{
462- CTEST << " ConductMovedPatch: Start\n " ;
509+ CTEST << " ConductMovedPatch: Start MovedPatchCase: " << ToString (movedCase) << Endl ;
463510 ConductFailedVPatch (runtime, env, args);
464511 ConductVMovedPatch (runtime, args, movedCase);
465512 NKikimrProto::EReplyStatus resultStatus = GetPatchResultStatus (movedCase);
@@ -481,7 +528,8 @@ void ConductFallbackPatch(TTestBasicRuntime &runtime, const TTestArgs &args) {
481528void ConductVPatchEvents (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
482529 EVPatchCase vpatchCase)
483530{
484- CTEST << " ConductVPatchEvents: Start\n " ;
531+ return ; // disabled vpatch
532+ CTEST << " ConductVPatchEvents: Start VPatchCase: " << ToString (vpatchCase) << Endl;
485533 for (ui32 idxInSubgroup = 0 ; idxInSubgroup < args.GType .BlobSubgroupSize (); ++idxInSubgroup) {
486534 TVDiskPointer vdisk = TVDiskPointer::GetVDiskIdx (idxInSubgroup);
487535 ConductVPatchStart (runtime, env, args, vpatchCase, vdisk);
@@ -496,7 +544,7 @@ void ConductVPatchEvents(TTestBasicRuntime &runtime, const TDSProxyEnv &env, con
496544void ConductVPatch (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
497545 EVPatchCase vpatchCase)
498546{
499- CTEST << " ConductFallbackPatch: Start\n " ;
547+ CTEST << " ConductFallbackPatch: Start VPatchCase: " << ToString (vpatchCase) << Endl ;
500548 ConductVPatchEvents (runtime, env, args, vpatchCase);
501549 NKikimrProto::EReplyStatus resultStatus = GetPatchResultStatus (vpatchCase);
502550 if (resultStatus == NKikimrProto::UNKNOWN) {
@@ -620,17 +668,18 @@ void RunGeneralTest(void(*runner)(TTestBasicRuntime &runtime, const TTestArgs &a
620668 Y_UNIT_TEST_NAIVE (ErrorOnPut, erasure) \
621669 Y_UNIT_TEST_MOVED (Ok, erasure) \
622670 Y_UNIT_TEST_MOVED (Error, erasure) \
623- Y_UNIT_TEST_VPATCH (Ok, erasure) \
624- Y_UNIT_TEST_VPATCH (OneErrorAndAllPartExistInStart, erasure) \
625- Y_UNIT_TEST_VPATCH (OnePartLostInStart, erasure) \
626- Y_UNIT_TEST_VPATCH (DeadGroupInStart, erasure) \
627- Y_UNIT_TEST_VPATCH (ErrorDuringVPatchDiff, erasure) \
628671 Y_UNIT_TEST_SECURED (Ok, erasure) \
629672 Y_UNIT_TEST_SECURED (ErrorOnGetItem, erasure) \
630673 Y_UNIT_TEST_SECURED (ErrorOnGet, erasure) \
631674 Y_UNIT_TEST_SECURED (ErrorOnPut, erasure) \
632675// end Y_UNIT_TEST_PATCH_PACK
633676
677+ // Y_UNIT_TEST_VPATCH(Ok, erasure)
678+ // Y_UNIT_TEST_VPATCH(OneErrorAndAllPartExistInStart, erasure)
679+ // Y_UNIT_TEST_VPATCH(OnePartLostInStart, erasure)
680+ // Y_UNIT_TEST_VPATCH(DeadGroupInStart, erasure)
681+ // Y_UNIT_TEST_VPATCH(ErrorDuringVPatchDiff, erasure)
682+
634683 Y_UNIT_TEST_PATCH_PACK (ErasureNone)
635684 Y_UNIT_TEST_PATCH_PACK (Erasure4Plus2Block)
636685 Y_UNIT_TEST_PATCH_PACK (ErasureMirror3dc)
@@ -712,6 +761,7 @@ EFaultToleranceCase GetFaultToleranceCaseForBlock4Plus2(const TDSProxyEnv &env,
712761 }
713762 }
714763 }
764+ return EFaultToleranceCase::Fallback; // disabled vpatch
715765 if (layout.CountEffectiveReplicas (env.Info ->Type ) == env.Info ->Type .TotalPartCount ()) {
716766 return EFaultToleranceCase::Ok;
717767 } else {
@@ -736,6 +786,7 @@ EFaultToleranceCase GetFaultToleranceCaseForMirror3dc(const TDSProxyEnv &env, co
736786 for (ui32 dcIdx = 0 ; dcIdx < dcCnt; ++dcIdx) {
737787 x2cnt += (replInDc[dcIdx] >= 2 );
738788 }
789+ return EFaultToleranceCase::Fallback; // disabled vpatch
739790 if ((replInDc[0 ] && replInDc[1 ] && replInDc[2 ]) || x2cnt >= 2 ) {
740791 return EFaultToleranceCase::Ok;
741792 } else {
0 commit comments