@@ -110,6 +110,18 @@ enum class ENaivePatchCase {
110
110
ErrorOnPut,
111
111
};
112
112
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
+
113
125
NKikimrProto::EReplyStatus GetPatchResultStatus (ENaivePatchCase naiveCase) {
114
126
switch (naiveCase) {
115
127
case ENaivePatchCase::Ok:
@@ -156,6 +168,17 @@ enum class EVPatchCase {
156
168
Custom,
157
169
};
158
170
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
+
159
182
NKikimrProto::EReplyStatus GetPatchResultStatus (EVPatchCase vpatchCase) {
160
183
switch (vpatchCase) {
161
184
case EVPatchCase::Ok:
@@ -249,6 +272,15 @@ enum class EMovedPatchCase {
249
272
Error
250
273
};
251
274
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
+
252
284
NKikimrProto::EReplyStatus GetPatchResultStatus (EMovedPatchCase movedCase) {
253
285
switch (movedCase) {
254
286
case EMovedPatchCase::Ok:
@@ -289,7 +321,7 @@ void ReceivePatchResult(TTestBasicRuntime &runtime, const TTestArgs &args, NKiki
289
321
}
290
322
291
323
void ConductGet (TTestBasicRuntime &runtime, const TTestArgs &args, ENaivePatchCase naiveCase) {
292
- CTEST << " ConductGet: Start\n " ;
324
+ CTEST << " ConductGet: Start NaiveCase: " << ToString (naiveCase) << " \n " ;
293
325
NKikimrProto::EReplyStatus resultStatus = GetGetResultStatus (naiveCase);
294
326
TAutoPtr<IEventHandle> handle;
295
327
TEvBlobStorage::TEvGet *get = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvGet>(handle);
@@ -328,10 +360,10 @@ TString MakePatchedBuffer(const TTestArgs &args) {
328
360
void ConductPut (TTestBasicRuntime &runtime, const TTestArgs &args, ENaivePatchCase naiveCase) {
329
361
NKikimrProto::EReplyStatus resultStatus = GetPutResultStatus (naiveCase);
330
362
if (resultStatus == NKikimrProto::UNKNOWN) {
331
- CTEST << " ConductPut: Skip\n " ;
363
+ CTEST << " ConductPut: Skip NaiveCase: " << ToString (naiveCase) << " \n " ;
332
364
return ;
333
365
}
334
- CTEST << " ConductPut: Start\n " ;
366
+ CTEST << " ConductPut: Start NaiveCase: " << ToString (naiveCase) << " \n " ;
335
367
TAutoPtr<IEventHandle> handle;
336
368
TEvBlobStorage::TEvPut *put = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvPut>(handle);
337
369
UNIT_ASSERT_VALUES_EQUAL (put->Id , args.PatchedId );
@@ -346,22 +378,35 @@ void ConductPut(TTestBasicRuntime &runtime, const TTestArgs &args, ENaivePatchCa
346
378
}
347
379
348
380
void ConductNaivePatch (TTestBasicRuntime &runtime, const TTestArgs &args, ENaivePatchCase naiveCase) {
349
- CTEST << " ConductNaivePatch: Start\n " ;
381
+ CTEST << " ConductNaivePatch: Start NaiveCase: " << ToString (naiveCase) << Endl ;
350
382
ConductGet (runtime, args, naiveCase);
351
383
ConductPut (runtime, args, naiveCase);
352
384
NKikimrProto::EReplyStatus resultStatus = GetPatchResultStatus (naiveCase);
353
385
ReceivePatchResult (runtime, args, resultStatus);
354
386
CTEST << " ConductNaivePatch: Finish\n " ;
355
387
}
356
388
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
+ }
357
402
358
403
void ConductVPatchStart (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
359
- EVPatchCase naiveCase , TVDiskPointer vdiskPointer)
404
+ EVPatchCase vpatchCase , TVDiskPointer vdiskPointer)
360
405
{
361
406
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 " ;
363
408
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);
365
410
366
411
auto start = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvVPatchStart>({env.VDisks [vdiskIdx]});
367
412
auto &startRecord = start->Get ()->Record ;
@@ -376,21 +421,22 @@ void ConductVPatchStart(TTestBasicRuntime &runtime, const TDSProxyEnv &env, cons
376
421
for (auto partId : parts) {
377
422
foundParts->AddPart (partId);
378
423
}
424
+ CTEST << " ConductVPatchStart: Send FoundParts vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " parts# " << ToString (parts) << " \n " ;
379
425
SendByHandle (runtime, start, std::move (foundParts));
380
426
CTEST << " ConductVPatchStart: Finish vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " \n " ;
381
427
}
382
428
383
429
void ConductVPatchDiff (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
384
- EVPatchCase naiveCase , TVDiskPointer vdiskPointer)
430
+ EVPatchCase vpatchCase , TVDiskPointer vdiskPointer)
385
431
{
386
432
auto [vdiskIdx, idxInSubgroup] = vdiskPointer.GetIndecies (env, args.PatchedId .Hash ());
387
433
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);
389
435
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 " ;
391
437
return ;
392
438
}
393
- CTEST << " ConductVPatchDiff: Start vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " \n " ;
439
+ CTEST << " ConductVPatchDiff: Start vdiskIdx# " << vdiskIdx << " idxInSubgroup# " << idxInSubgroup << " VPatchCase: " << ToString (vpatchCase) << " \n " ;
394
440
395
441
auto diffEv = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvVPatchDiff>({env.VDisks [vdiskIdx]});
396
442
auto &diffRecord = diffEv->Get ()->Record ;
@@ -415,6 +461,7 @@ void ConductVPatchDiff(TTestBasicRuntime &runtime, const TDSProxyEnv &env, const
415
461
}
416
462
417
463
void ConductFailedVPatch (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args) {
464
+ return ; // disabled vpatch
418
465
CTEST << " ConductFailedVPatch: Start\n " ;
419
466
for (ui32 idxInSubgroup = 0 ; idxInSubgroup < args.GType .BlobSubgroupSize (); ++idxInSubgroup) {
420
467
TVDiskPointer vdisk = TVDiskPointer::GetVDiskIdx (idxInSubgroup);
@@ -429,7 +476,7 @@ void ConductFailedVPatch(TTestBasicRuntime &runtime, const TDSProxyEnv &env, con
429
476
430
477
431
478
void ConductVMovedPatch (TTestBasicRuntime &runtime, const TTestArgs &args, EMovedPatchCase movedCase) {
432
- CTEST << " ConductVMovedPatch: Start\n " ;
479
+ CTEST << " ConductVMovedPatch: Start MovedPatchCase: " << ToString (movedCase) << Endl ;
433
480
NKikimrProto::EReplyStatus resultStatus = GetVMovedPatchResultStatus (movedCase);
434
481
TAutoPtr<IEventHandle> handle;
435
482
TEvBlobStorage::TEvVMovedPatch *vPatch = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvVMovedPatch>(handle);
@@ -459,7 +506,7 @@ void ConductVMovedPatch(TTestBasicRuntime &runtime, const TTestArgs &args, EMove
459
506
void ConductMovedPatch (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
460
507
EMovedPatchCase movedCase)
461
508
{
462
- CTEST << " ConductMovedPatch: Start\n " ;
509
+ CTEST << " ConductMovedPatch: Start MovedPatchCase: " << ToString (movedCase) << Endl ;
463
510
ConductFailedVPatch (runtime, env, args);
464
511
ConductVMovedPatch (runtime, args, movedCase);
465
512
NKikimrProto::EReplyStatus resultStatus = GetPatchResultStatus (movedCase);
@@ -481,7 +528,8 @@ void ConductFallbackPatch(TTestBasicRuntime &runtime, const TTestArgs &args) {
481
528
void ConductVPatchEvents (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
482
529
EVPatchCase vpatchCase)
483
530
{
484
- CTEST << " ConductVPatchEvents: Start\n " ;
531
+ return ; // disabled vpatch
532
+ CTEST << " ConductVPatchEvents: Start VPatchCase: " << ToString (vpatchCase) << Endl;
485
533
for (ui32 idxInSubgroup = 0 ; idxInSubgroup < args.GType .BlobSubgroupSize (); ++idxInSubgroup) {
486
534
TVDiskPointer vdisk = TVDiskPointer::GetVDiskIdx (idxInSubgroup);
487
535
ConductVPatchStart (runtime, env, args, vpatchCase, vdisk);
@@ -496,7 +544,7 @@ void ConductVPatchEvents(TTestBasicRuntime &runtime, const TDSProxyEnv &env, con
496
544
void ConductVPatch (TTestBasicRuntime &runtime, const TDSProxyEnv &env, const TTestArgs &args,
497
545
EVPatchCase vpatchCase)
498
546
{
499
- CTEST << " ConductFallbackPatch: Start\n " ;
547
+ CTEST << " ConductFallbackPatch: Start VPatchCase: " << ToString (vpatchCase) << Endl ;
500
548
ConductVPatchEvents (runtime, env, args, vpatchCase);
501
549
NKikimrProto::EReplyStatus resultStatus = GetPatchResultStatus (vpatchCase);
502
550
if (resultStatus == NKikimrProto::UNKNOWN) {
@@ -620,17 +668,18 @@ void RunGeneralTest(void(*runner)(TTestBasicRuntime &runtime, const TTestArgs &a
620
668
Y_UNIT_TEST_NAIVE (ErrorOnPut, erasure) \
621
669
Y_UNIT_TEST_MOVED (Ok, erasure) \
622
670
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) \
628
671
Y_UNIT_TEST_SECURED (Ok, erasure) \
629
672
Y_UNIT_TEST_SECURED (ErrorOnGetItem, erasure) \
630
673
Y_UNIT_TEST_SECURED (ErrorOnGet, erasure) \
631
674
Y_UNIT_TEST_SECURED (ErrorOnPut, erasure) \
632
675
// end Y_UNIT_TEST_PATCH_PACK
633
676
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
+
634
683
Y_UNIT_TEST_PATCH_PACK (ErasureNone)
635
684
Y_UNIT_TEST_PATCH_PACK (Erasure4Plus2Block)
636
685
Y_UNIT_TEST_PATCH_PACK (ErasureMirror3dc)
@@ -712,6 +761,7 @@ EFaultToleranceCase GetFaultToleranceCaseForBlock4Plus2(const TDSProxyEnv &env,
712
761
}
713
762
}
714
763
}
764
+ return EFaultToleranceCase::Fallback; // disabled vpatch
715
765
if (layout.CountEffectiveReplicas (env.Info ->Type ) == env.Info ->Type .TotalPartCount ()) {
716
766
return EFaultToleranceCase::Ok;
717
767
} else {
@@ -736,6 +786,7 @@ EFaultToleranceCase GetFaultToleranceCaseForMirror3dc(const TDSProxyEnv &env, co
736
786
for (ui32 dcIdx = 0 ; dcIdx < dcCnt; ++dcIdx) {
737
787
x2cnt += (replInDc[dcIdx] >= 2 );
738
788
}
789
+ return EFaultToleranceCase::Fallback; // disabled vpatch
739
790
if ((replInDc[0 ] && replInDc[1 ] && replInDc[2 ]) || x2cnt >= 2 ) {
740
791
return EFaultToleranceCase::Ok;
741
792
} else {
0 commit comments