diff options
author | tarum <tarum@yandex-team.com> | 2023-04-20 16:24:17 +0300 |
---|---|---|
committer | tarum <tarum@yandex-team.com> | 2023-04-20 16:24:17 +0300 |
commit | bacb095f225d39abedab523aa4ffef7fb8492d3d (patch) | |
tree | 7f2342fd7aad693a8833951d29ce13533591a4bc | |
parent | ef238c42b52c0e459aff8a61d851a17df1eebbd3 (diff) | |
download | ydb-bacb095f225d39abedab523aa4ffef7fb8492d3d.tar.gz |
Handle external tag 0 as unset
It is an attempt to fix the storage_perf script. Presumably, it fails as it sends stop request with tag 0 which was not allowed in service actor.
-rw-r--r-- | ydb/core/load_test/service_actor.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/ydb/core/load_test/service_actor.cpp b/ydb/core/load_test/service_actor.cpp index a12a055776b..3ad3e899851 100644 --- a/ydb/core/load_test/service_actor.cpp +++ b/ydb/core/load_test/service_actor.cpp @@ -242,17 +242,20 @@ private: ui64 GetTag(const TEvLoadTestRequest& origRequest, bool legacyRequest) { if (legacyRequest) { ui64 tag = ExtractTagFromCommand(origRequest); - LOG_N("Received legacy request with tag# " << tag); - Y_ENSURE(tag >= NextTag, "External tag# " << tag << " should not be less than NextTag = " << NextTag); - Y_ENSURE(TakenTags.count(tag) == 0, "External tag# " << tag << " should not be taken"); - TakenTags.insert(tag); - return tag; - } else { - while (TakenTags.count(NextTag)) { - ++NextTag; + if (tag) { + LOG_N("Received legacy request with tag# " << tag); + Y_ENSURE(tag >= NextTag, "External tag# " << tag << " should not be less than NextTag = " << NextTag); + Y_ENSURE(TakenTags.count(tag) == 0, "External tag# " << tag << " should not be taken"); + TakenTags.insert(tag); + return tag; + } else { + LOG_N("Received legacy request with tag# 0, assigning it a proper tag in a regular way"); } - return NextTag++; } + while (TakenTags.count(NextTag)) { + ++NextTag; + } + return NextTag++; } const TEvLoadTestRequest& AddRequestInProcessing(const TEvLoadTestRequest& origRequest, bool legacyRequest) { |