Skip to content

Commit 32218fe

Browse files
authored
Disable vpatch 24-3 (#7320)
1 parent 4876ec0 commit 32218fe

File tree

7 files changed

+405
-43
lines changed

7 files changed

+405
-43
lines changed

ydb/core/blobstorage/dsproxy/dsproxy_patch.cpp

Lines changed: 195 additions & 13 deletions
Large diffs are not rendered by default.

ydb/core/blobstorage/dsproxy/ut/dsproxy_patch_ut.cpp

Lines changed: 71 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
113125
NKikimrProto::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+
159182
NKikimrProto::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+
252284
NKikimrProto::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

291323
void 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) {
328360
void 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

348380
void 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

358403
void 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

383429
void 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

417463
void 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

431478
void 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
459506
void 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) {
481528
void 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
496544
void 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 {

ydb/core/blobstorage/vdisk/common/vdisk_events.h

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ namespace NKikimr {
15851585
if (deadline != TInstant::Max()) {
15861586
this->Record.MutableMsgQoS()->SetDeadlineSeconds((ui32)deadline.Seconds());
15871587
}
1588-
this->Record.MutableMsgQoS()->SetExtQueueId(HandleClassToQueueId(NKikimrBlobStorage::AsyncBlob));
1588+
this->Record.MutableMsgQoS()->SetExtQueueId(NKikimrBlobStorage::PutAsyncBlob);
15891589
}
15901590

15911591
bool GetIgnoreBlock() const {
@@ -1965,6 +1965,25 @@ namespace NKikimr {
19651965
}
19661966
Record.MutableMsgQoS()->SetExtQueueId(NKikimrBlobStorage::EVDiskQueueId::GetFastRead);
19671967
}
1968+
1969+
TString ToString() const {
1970+
return ToString(this->Record);
1971+
}
1972+
1973+
static TString ToString(const NKikimrBlobStorage::TEvVPatchStart &record) {
1974+
TStringStream str;
1975+
TLogoBlobID originalId = LogoBlobIDFromLogoBlobID(record.GetOriginalBlobId());
1976+
TLogoBlobID patchedId = LogoBlobIDFromLogoBlobID(record.GetPatchedBlobId());
1977+
str << "{TEvVPatchStart";
1978+
str << " OriginalBlobId# " << originalId.ToString();
1979+
str << " PatchedBlobId# " << patchedId.ToString();
1980+
if (record.HasMsgQoS()) {
1981+
str << " ";
1982+
TEvBlobStorage::TEvVPut::OutMsgQos(record.GetMsgQoS(), str);
1983+
}
1984+
str << "}";
1985+
return str.Str();
1986+
}
19681987
};
19691988

19701989
struct TEvBlobStorage::TEvVPatchFoundParts
@@ -2010,6 +2029,25 @@ namespace NKikimr {
20102029
Record.SetStatus(status);
20112030
}
20122031

2032+
TString ToString() const {
2033+
return ToString(this->Record);
2034+
}
2035+
2036+
static TString ToString(const NKikimrBlobStorage::TEvVPatchFoundParts &record) {
2037+
TStringStream str;
2038+
TLogoBlobID originalId = LogoBlobIDFromLogoBlobID(record.GetOriginalBlobId());
2039+
TLogoBlobID patchedId = LogoBlobIDFromLogoBlobID(record.GetPatchedBlobId());
2040+
str << "{TEvVPatchFoundParts";
2041+
str << " OriginalBlobId# " << originalId.ToString();
2042+
str << " PatchedBlobId# " << patchedId.ToString();
2043+
if (record.HasMsgQoS()) {
2044+
str << " ";
2045+
TEvBlobStorage::TEvVPut::OutMsgQos(record.GetMsgQoS(), str);
2046+
}
2047+
str << "}";
2048+
return str.Str();
2049+
}
2050+
20132051
void MakeError(NKikimrProto::EReplyStatus status, const TString& errorReason,
20142052
const NKikimrBlobStorage::TEvVPatchStart &request) {
20152053
Record.SetErrorReason(errorReason);
@@ -2099,6 +2137,25 @@ namespace NKikimr {
20992137
}
21002138
return result;
21012139
}
2140+
2141+
TString ToString() const {
2142+
return ToString(this->Record);
2143+
}
2144+
2145+
static TString ToString(const NKikimrBlobStorage::TEvVPatchDiff &record) {
2146+
TStringStream str;
2147+
TLogoBlobID originalId = LogoBlobIDFromLogoBlobID(record.GetOriginalPartBlobId());
2148+
TLogoBlobID patchedId = LogoBlobIDFromLogoBlobID(record.GetPatchedPartBlobId());
2149+
str << "{TEvVPatchDiff";
2150+
str << " OriginalBlobId# " << originalId.ToString();
2151+
str << " PatchedBlobId# " << patchedId.ToString();
2152+
if (record.HasMsgQoS()) {
2153+
str << " ";
2154+
TEvBlobStorage::TEvVPut::OutMsgQos(record.GetMsgQoS(), str);
2155+
}
2156+
str << "}";
2157+
return str.Str();
2158+
}
21022159
};
21032160

21042161

@@ -2144,6 +2201,25 @@ namespace NKikimr {
21442201
}
21452202
return result;
21462203
}
2204+
2205+
TString ToString() const {
2206+
return ToString(this->Record);
2207+
}
2208+
2209+
static TString ToString(const NKikimrBlobStorage::TEvVPatchXorDiff &record) {
2210+
TStringStream str;
2211+
TLogoBlobID originalId = LogoBlobIDFromLogoBlobID(record.GetOriginalPartBlobId());
2212+
TLogoBlobID patchedId = LogoBlobIDFromLogoBlobID(record.GetPatchedPartBlobId());
2213+
str << "{TEvVPatchXorDiff";
2214+
str << " OriginalBlobId# " << originalId.ToString();
2215+
str << " PatchedBlobId# " << patchedId.ToString();
2216+
if (record.HasMsgQoS()) {
2217+
str << " ";
2218+
TEvBlobStorage::TEvVPut::OutMsgQos(record.GetMsgQoS(), str);
2219+
}
2220+
str << "}";
2221+
return str.Str();
2222+
}
21472223
};
21482224

21492225
struct TEvBlobStorage::TEvVPatchXorDiffResult

0 commit comments

Comments
 (0)