diff options
author | Aleksei Borzenkov <snaury@gmail.com> | 2022-07-01 19:46:27 +0300 |
---|---|---|
committer | Aleksei Borzenkov <snaury@gmail.com> | 2022-07-01 19:46:27 +0300 |
commit | b30a65cd2df15691dd97b50f1296203ea64a7be9 (patch) | |
tree | e9603bd11c17f296c734eb27fc37794d0163b543 | |
parent | d5e97562adef9abb252a232dfa3d28c2848a76bf (diff) | |
download | ydb-b30a65cd2df15691dd97b50f1296203ea64a7be9.tar.gz |
Reply ALREADY to TEvBlock races, don't hide errors by retrying blocking, KIKIMR-15235
ref:3f38c5246ee30a9f07e5d4e43ade7d8162b1a514
-rw-r--r-- | ydb/core/blobstorage/dsproxy/dsproxy_block.cpp | 4 | ||||
-rw-r--r-- | ydb/core/blobstorage/dsproxy/mock/model.h | 2 | ||||
-rw-r--r-- | ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp | 4 | ||||
-rw-r--r-- | ydb/core/blobstorage/testload/test_load_write.cpp | 4 | ||||
-rw-r--r-- | ydb/core/mind/hive/tx__block_storage_result.cpp | 1 | ||||
-rw-r--r-- | ydb/core/tablet/tablet_req_blockbs.cpp | 11 |
6 files changed, 10 insertions, 16 deletions
diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_block.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_block.cpp index cf742ad23e7..f381d505a7d 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_block.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_block.cpp @@ -59,7 +59,7 @@ class TBlobStorageGroupBlockRequest : public TBlobStorageGroupRequestActor<TBlob std::vector<TVDiskID> queryStatus, resend; if (status == NKikimrProto::ALREADY) { // ALREADY means that newly arrived Block is the same or older than existing one; we treat it as ERROR here - // and reply with RACE only when no quorum could be obtained during the whole operation + // and reply with ALREADY only when no quorum could be obtained during the whole operation SeenAlready = true; status = NKikimrProto::ERROR; } @@ -74,7 +74,7 @@ class TBlobStorageGroupBlockRequest : public TBlobStorageGroupRequestActor<TBlob case NKikimrProto::ERROR: { TStringStream err; - newStatus = SeenAlready ? NKikimrProto::RACE : NKikimrProto::ERROR; + newStatus = SeenAlready ? NKikimrProto::ALREADY : NKikimrProto::ERROR; err << "Status# " << NKikimrProto::EReplyStatus_Name(newStatus) << " From# " << vdisk.ToString() << " NodeId# " << Info->GetActorId(vdisk).NodeId() diff --git a/ydb/core/blobstorage/dsproxy/mock/model.h b/ydb/core/blobstorage/dsproxy/mock/model.h index 6161a6b8573..f8a7f78d4a3 100644 --- a/ydb/core/blobstorage/dsproxy/mock/model.h +++ b/ydb/core/blobstorage/dsproxy/mock/model.h @@ -137,7 +137,7 @@ namespace NFake { if (it == Blocks.end()) { Blocks.emplace(msg->TabletId, msg->Generation); } else if (msg->Generation <= it->second) { - status = NKikimrProto::RACE; + status = NKikimrProto::ALREADY; } else { it->second = msg->Generation; } diff --git a/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp b/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp index 983f3c00da7..e103f1d830d 100644 --- a/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp +++ b/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp @@ -461,8 +461,8 @@ Y_UNIT_TEST_SUITE(TBlobStorageWardenTest) { ui64 tabletId = 1234; ui32 generation = 1; BlockGroup(runtime, sender0, tabletId, groupId, generation, true); - BlockGroup(runtime, sender0, tabletId, groupId, generation, true, NKikimrProto::EReplyStatus::RACE); - BlockGroup(runtime, sender0, tabletId, groupId, generation-1, true, NKikimrProto::EReplyStatus::RACE); + BlockGroup(runtime, sender0, tabletId, groupId, generation, true, NKikimrProto::EReplyStatus::ALREADY); + BlockGroup(runtime, sender0, tabletId, groupId, generation-1, true, NKikimrProto::EReplyStatus::ALREADY); auto describePool = DescribeStoragePool(runtime, DOMAIN_ID, "test_storage"); { diff --git a/ydb/core/blobstorage/testload/test_load_write.cpp b/ydb/core/blobstorage/testload/test_load_write.cpp index d30f9d4a31d..a7ac7823e88 100644 --- a/ydb/core/blobstorage/testload/test_load_write.cpp +++ b/ydb/core/blobstorage/testload/test_load_write.cpp @@ -271,9 +271,9 @@ class TLogWriterTestLoadActor : public TActorBootstrapped<TLogWriterTestLoadActo auto callback = [this] (IEventBase *event, const TActorContext& ctx) { auto *res = dynamic_cast<TEvBlobStorage::TEvBlockResult *>(event); Y_VERIFY(res); - if (!CheckStatus(ctx, res, {NKikimrProto::EReplyStatus::OK, NKikimrProto::EReplyStatus::RACE})) { + if (!CheckStatus(ctx, res, {NKikimrProto::EReplyStatus::OK, NKikimrProto::EReplyStatus::ALREADY})) { return; - } else if (res->Status == NKikimrProto::EReplyStatus::RACE && GroupBlockRetries-- > 0) { + } else if (res->Status == NKikimrProto::EReplyStatus::ALREADY && GroupBlockRetries-- > 0) { LOG_INFO_S(ctx, NKikimrServices::BS_LOAD_TEST, PrintMe() << " recieved " << res->ToString()); IssueTEvBlock(ctx); return; diff --git a/ydb/core/mind/hive/tx__block_storage_result.cpp b/ydb/core/mind/hive/tx__block_storage_result.cpp index 7ca9b1c417c..1740ea1a4f6 100644 --- a/ydb/core/mind/hive/tx__block_storage_result.cpp +++ b/ydb/core/mind/hive/tx__block_storage_result.cpp @@ -34,6 +34,7 @@ public: } } if (msg->Status == NKikimrProto::OK + || msg->Status == NKikimrProto::ALREADY || msg->Status == NKikimrProto::RACE || msg->Status == NKikimrProto::BLOCKED || msg->Status == NKikimrProto::NO_GROUP) { diff --git a/ydb/core/tablet/tablet_req_blockbs.cpp b/ydb/core/tablet/tablet_req_blockbs.cpp index ac5914fb595..44be5e5af75 100644 --- a/ydb/core/tablet/tablet_req_blockbs.cpp +++ b/ydb/core/tablet/tablet_req_blockbs.cpp @@ -5,15 +5,12 @@ namespace NKikimr { -constexpr ui32 MAX_ATTEMPTS = 3; - class TTabletReqBlockBlobStorageGroup : public TActorBootstrapped<TTabletReqBlockBlobStorageGroup> { public: TActorId Owner; ui64 TabletId; ui32 GroupId; ui32 Generation; - ui32 ErrorCount; void ReplyAndDie(NKikimrProto::EReplyStatus status, const TString &reason = { }) { Send(Owner, new TEvTabletBase::TEvBlockBlobStorageResult(status, TabletId, reason)); @@ -37,17 +34,14 @@ public: switch (msg->Status) { case NKikimrProto::OK: return ReplyAndDie(NKikimrProto::OK); + case NKikimrProto::ALREADY: case NKikimrProto::BLOCKED: case NKikimrProto::RACE: case NKikimrProto::NO_GROUP: // The request will never succeed return ReplyAndDie(msg->Status, msg->ErrorReason); default: - ++ErrorCount; - if (ErrorCount >= MAX_ATTEMPTS) { - return ReplyAndDie(NKikimrProto::ERROR, msg->ErrorReason); - } - return SendRequest(); + return ReplyAndDie(NKikimrProto::ERROR, msg->ErrorReason); } } @@ -74,7 +68,6 @@ public: : TabletId(tabletId) , GroupId(groupId) , Generation(gen) - , ErrorCount(0) {} }; |