@@ -57,7 +57,7 @@ void TGetImpl::PrepareReply(NKikimrProto::EReplyStatus status, TString errorReas
57
57
58
58
// extra validation code for phantom logic
59
59
if (PhantomCheck) {
60
- TSubgroupPartLayout possiblyWritten ;
60
+ TSubgroupPartLayout possiblyPresent ;
61
61
62
62
for (ui32 idxInSubgroup = 0 ; idxInSubgroup < blobState.Disks .size (); ++idxInSubgroup) {
63
63
const auto & disk = blobState.Disks [idxInSubgroup];
@@ -81,10 +81,13 @@ void TGetImpl::PrepareReply(NKikimrProto::EReplyStatus status, TString errorReas
81
81
}
82
82
switch (disk.DiskParts [partIdx].Situation ) {
83
83
case TBlobState::ESituation::Unknown:
84
+ Y_DEBUG_ABORT_S (" proxy didn't probe some valid parts of the blob while returning NODATA"
85
+ << " State# " << blobState.ToString ());
86
+ [[fallthrough]];
84
87
case TBlobState::ESituation::Error:
85
88
case TBlobState::ESituation::Present:
86
89
case TBlobState::ESituation::Sent:
87
- possiblyWritten .AddItem (idxInSubgroup, partIdx, Info->Type );
90
+ possiblyPresent .AddItem (idxInSubgroup, partIdx, Info->Type );
88
91
break ;
89
92
90
93
case TBlobState::ESituation::Absent:
@@ -95,32 +98,11 @@ void TGetImpl::PrepareReply(NKikimrProto::EReplyStatus status, TString errorReas
95
98
}
96
99
}
97
100
98
- switch (Info->Type .GetErasure ()) {
99
- case TBlobStorageGroupType::ErasureMirror3dc:
100
- if (possiblyWritten.GetDisksWithPart (0 ) || possiblyWritten.GetDisksWithPart (1 ) ||
101
- possiblyWritten.GetDisksWithPart (2 )) {
102
- okay = false ;
103
- }
104
- break ;
105
-
106
- case TBlobStorageGroupType::ErasureMirror3of4:
107
- if (possiblyWritten.GetDisksWithPart (0 ) || possiblyWritten.GetDisksWithPart (1 )) {
108
- okay = false ;
109
- }
110
- break ;
111
-
112
- default : {
113
- ui32 numDistinctParts = 0 ;
114
- for (ui32 partIdx = 0 ; partIdx < Info->Type .TotalPartCount (); ++partIdx) {
115
- if (possiblyWritten.GetDisksWithPart (partIdx)) {
116
- ++numDistinctParts;
117
- }
118
- }
119
- if (numDistinctParts >= Info->Type .MinimalRestorablePartCount ()) {
120
- okay = false ;
121
- }
122
- break ;
123
- }
101
+ const TBlobStorageGroupInfo::TSubgroupVDisks zero (&Info->GetTopology ());
102
+ const auto & checker = Info->GetQuorumChecker ();
103
+ const bool canBeRestored = checker.GetBlobState (possiblyPresent, zero) != TBlobStorageGroupInfo::EBS_UNRECOVERABLE_FRAGMENTARY;
104
+ if (canBeRestored) {
105
+ okay = false ; // there is a slight chance that we can restore that blob
124
106
}
125
107
}
126
108
0 commit comments