diff options
author | yuryalekseev <yuryalekseev@yandex-team.com> | 2022-09-22 18:50:40 +0300 |
---|---|---|
committer | yuryalekseev <yuryalekseev@yandex-team.com> | 2022-09-22 18:50:40 +0300 |
commit | e400a5bdcb6e1222ce1cc97fd8f77eae6ee5f8e0 (patch) | |
tree | 5f39f1c545eefeaa7773ef7f4f55899681018bb0 | |
parent | e456e6648f9cd36eab42378984bb6f21003627dc (diff) | |
download | ydb-e400a5bdcb6e1222ce1cc97fd8f77eae6ee5f8e0.tar.gz |
Add a check for BLOCKED TEvGet with BlocksManager.
-rw-r--r-- | ydb/core/blob_depot/agent/storage_get.cpp | 9 | ||||
-rw-r--r-- | ydb/core/blobstorage/ut_blobstorage/blob_depot.cpp | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/ydb/core/blob_depot/agent/storage_get.cpp b/ydb/core/blob_depot/agent/storage_get.cpp index 004b0506ba..cdf8dae8bc 100644 --- a/ydb/core/blob_depot/agent/storage_get.cpp +++ b/ydb/core/blob_depot/agent/storage_get.cpp @@ -1,5 +1,6 @@ #include "agent_impl.h" #include "blob_mapping_cache.h" +#include "blocks.h" namespace NKikimr::NBlobDepot { @@ -36,6 +37,14 @@ namespace NKikimr::NBlobDepot { Agent.VirtualGroupId); AnswersRemain = msg.QuerySize; + if (msg.ReaderTabletId && msg.ReaderTabletGeneration) { + auto status = Agent.BlocksManager.CheckBlockForTablet(msg.ReaderTabletId.value(), msg.ReaderTabletGeneration.value(), this, nullptr); + if (status == NKikimrProto::BLOCKED) { + EndWithError(status, "Fail TEvGet due to BLOCKED tablet generation"); + return; + } + } + for (ui32 i = 0; i < msg.QuerySize; ++i) { auto& query = msg.Queries[i]; diff --git a/ydb/core/blobstorage/ut_blobstorage/blob_depot.cpp b/ydb/core/blobstorage/ut_blobstorage/blob_depot.cpp index d194da5fc8..4ef1acb4e8 100644 --- a/ydb/core/blobstorage/ut_blobstorage/blob_depot.cpp +++ b/ydb/core/blobstorage/ut_blobstorage/blob_depot.cpp @@ -68,7 +68,7 @@ Y_UNIT_TEST_SUITE(BlobDepot) { auto res = CaptureTEvGetResult(env, sender, true, true); // check that TEvGet returns BLOCKED - UNIT_ASSERT_VALUES_EQUAL(res->Get()->Status, NKikimrProto::OK); + UNIT_ASSERT_VALUES_EQUAL(res->Get()->Status, NKikimrProto::BLOCKED); UNIT_ASSERT_VALUES_EQUAL(res->Get()->Responses[0].Status, NKikimrProto::BLOCKED); } |