aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Rutkovsky <alexvru@ydb.tech>2024-09-03 13:39:32 +0300
committerGitHub <noreply@github.com>2024-09-03 10:39:32 +0000
commitd28c13eeb1a903ca4dd2fa9b77649fb6a1317fbc (patch)
treef118b8800f13aa44fb8ca31a43c8ed812e539f76
parent25aad65914a8dd2577c5416f2f8320fdf63aa0ed (diff)
downloadydb-d28c13eeb1a903ca4dd2fa9b77649fb6a1317fbc.tar.gz
More confident DS proxy phantom blob checking logic (#8611)
-rw-r--r--ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp38
1 files changed, 10 insertions, 28 deletions
diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp
index 3d1fc7ce8a..b959123262 100644
--- a/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp
+++ b/ydb/core/blobstorage/dsproxy/dsproxy_get_impl.cpp
@@ -57,7 +57,7 @@ void TGetImpl::PrepareReply(NKikimrProto::EReplyStatus status, TString errorReas
// extra validation code for phantom logic
if (PhantomCheck) {
- TSubgroupPartLayout possiblyWritten;
+ TSubgroupPartLayout possiblyPresent;
for (ui32 idxInSubgroup = 0; idxInSubgroup < blobState.Disks.size(); ++idxInSubgroup) {
const auto& disk = blobState.Disks[idxInSubgroup];
@@ -81,10 +81,13 @@ void TGetImpl::PrepareReply(NKikimrProto::EReplyStatus status, TString errorReas
}
switch (disk.DiskParts[partIdx].Situation) {
case TBlobState::ESituation::Unknown:
+ Y_DEBUG_ABORT_S("proxy didn't probe some valid parts of the blob while returning NODATA"
+ << " State# " << blobState.ToString());
+ [[fallthrough]];
case TBlobState::ESituation::Error:
case TBlobState::ESituation::Present:
case TBlobState::ESituation::Sent:
- possiblyWritten.AddItem(idxInSubgroup, partIdx, Info->Type);
+ possiblyPresent.AddItem(idxInSubgroup, partIdx, Info->Type);
break;
case TBlobState::ESituation::Absent:
@@ -95,32 +98,11 @@ void TGetImpl::PrepareReply(NKikimrProto::EReplyStatus status, TString errorReas
}
}
- switch (Info->Type.GetErasure()) {
- case TBlobStorageGroupType::ErasureMirror3dc:
- if (possiblyWritten.GetDisksWithPart(0) || possiblyWritten.GetDisksWithPart(1) ||
- possiblyWritten.GetDisksWithPart(2)) {
- okay = false;
- }
- break;
-
- case TBlobStorageGroupType::ErasureMirror3of4:
- if (possiblyWritten.GetDisksWithPart(0) || possiblyWritten.GetDisksWithPart(1)) {
- okay = false;
- }
- break;
-
- default: {
- ui32 numDistinctParts = 0;
- for (ui32 partIdx = 0; partIdx < Info->Type.TotalPartCount(); ++partIdx) {
- if (possiblyWritten.GetDisksWithPart(partIdx)) {
- ++numDistinctParts;
- }
- }
- if (numDistinctParts >= Info->Type.MinimalRestorablePartCount()) {
- okay = false;
- }
- break;
- }
+ const TBlobStorageGroupInfo::TSubgroupVDisks zero(&Info->GetTopology());
+ const auto& checker = Info->GetQuorumChecker();
+ const bool canBeRestored = checker.GetBlobState(possiblyPresent, zero) != TBlobStorageGroupInfo::EBS_UNRECOVERABLE_FRAGMENTARY;
+ if (canBeRestored) {
+ okay = false; // there is a slight chance that we can restore that blob
}
}