aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuryalekseev <yuryalekseev@yandex-team.com>2022-09-05 11:54:41 +0300
committeryuryalekseev <yuryalekseev@yandex-team.com>2022-09-05 11:54:41 +0300
commit16702277d5981df06c80769cdb6c30a7a1d018fc (patch)
treec53975ac0c03a1cb54240ee3cf22eed8f3ca2fdf
parentda52521556a6575c3f9095314741f327b4bbaf44 (diff)
downloadydb-16702277d5981df06c80769cdb6c30a7a1d018fc.tar.gz
Return BLOCKED instead of ERROR when tablet generation is blocked on TEvGet.
-rw-r--r--ydb/core/blobstorage/ut_blobstorage/get.cpp4
-rw-r--r--ydb/core/blobstorage/vdisk/hullop/blobstorage_hull.h8
-rw-r--r--ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp4
3 files changed, 6 insertions, 10 deletions
diff --git a/ydb/core/blobstorage/ut_blobstorage/get.cpp b/ydb/core/blobstorage/ut_blobstorage/get.cpp
index 311b1daea66..30953ef526c 100644
--- a/ydb/core/blobstorage/ut_blobstorage/get.cpp
+++ b/ydb/core/blobstorage/ut_blobstorage/get.cpp
@@ -76,8 +76,8 @@ Y_UNIT_TEST_SUITE(Get) {
// check that TEvGet still returns OK for blocked generation without reader params
SendGet(test, originalBlobId, data, NKikimrProto::OK);
- // check that now TEvGet returns ERROR for blocked generation with reader params
- SendGet(test, originalBlobId, data, NKikimrProto::ERROR, tabletId, tabletGeneration);
+ // check that now TEvGet returns BLOCKED for blocked generation with reader params
+ SendGet(test, originalBlobId, data, NKikimrProto::BLOCKED, tabletId, tabletGeneration);
}
Y_UNIT_TEST(EvGetReaderParams) {
diff --git a/ydb/core/blobstorage/vdisk/hullop/blobstorage_hull.h b/ydb/core/blobstorage/vdisk/hullop/blobstorage_hull.h
index d8ed15a3b08..f77c6d83df2 100644
--- a/ydb/core/blobstorage/vdisk/hullop/blobstorage_hull.h
+++ b/ydb/core/blobstorage/vdisk/hullop/blobstorage_hull.h
@@ -158,12 +158,8 @@ namespace NKikimr {
return BlocksCache.Find(tabletID, outGen);
}
- bool IsBlocked(ui64 tabletID, TBlocksCache::TBlockedGen tabletGeneration) {
- auto res = BlocksCache.IsBlocked(tabletID, tabletGeneration);
- if (res.Status == TBlocksCache::EStatus::OK) {
- return false;
- }
- return true;
+ TBlocksCache::TBlockRes IsBlocked(ui64 tabletID, TBlocksCache::TBlockedGen tabletGeneration) {
+ return BlocksCache.IsBlocked(tabletID, tabletGeneration);
}
////////////////////////////////////////////////////////////////////////
diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp
index d0ceef02639..dc5cfcbf653 100644
--- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp
+++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeleton.cpp
@@ -882,8 +882,8 @@ namespace NKikimr {
ReplyError(NKikimrProto::ERROR, "get query is invalid", ev, ctx, now);
} else if (record.HasReaderTabletId()
&& record.HasReaderTabletGeneration()
- && Hull->IsBlocked(record.GetReaderTabletId(), {record.GetReaderTabletGeneration(), 0})) {
- ReplyError(NKikimrProto::ERROR, "tablet's generation is blocked", ev, ctx, now);
+ && Hull->IsBlocked(record.GetReaderTabletId(), {record.GetReaderTabletGeneration(), 0}).Status != TBlocksCache::EStatus::OK) {
+ ReplyError(NKikimrProto::BLOCKED, "tablet's generation is blocked", ev, ctx, now);
} else {
std::optional<THullDsSnap> fullSnap;
if (record.HasSnapshotId()) {