diff options
author | serg-belyakov <serg-belyakov@yandex-team.com> | 2023-08-28 18:26:09 +0300 |
---|---|---|
committer | serg-belyakov <serg-belyakov@yandex-team.com> | 2023-08-28 19:35:32 +0300 |
commit | 651faffe49539658acd0ef3da9e079e0fa0b597b (patch) | |
tree | 0bbe3a6bd2df24ef68870f0c2a36b03dc30e41a3 | |
parent | 2f61aa846ac3374f98edd2c5b3be9a2d91f70912 (diff) | |
download | ydb-651faffe49539658acd0ef3da9e079e0fa0b597b.tar.gz |
Either enqueue request or reply with error when stopping batching puts in unconfigured state, KIKIMR-19177
Either enqueue request or reply with error when stopping batching puts in unconfigured state
-rw-r--r-- | ydb/core/blobstorage/dsproxy/dsproxy_request.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_request.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_request.cpp index 8d60a60882..26d5c48039 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_request.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_request.cpp @@ -263,22 +263,29 @@ namespace NKikimr { TMaybe<TGroupStat::EKind> kind = PutHandleClassToGroupStatKind(handleClass); if (Info) { - TAppData *app = NKikimr::AppData(TActivationContext::AsActorContext()); - bool enableRequestMod3x3ForMinLatency = app->FeatureFlags.GetEnable3x3RequestsForMirror3DCMinLatencyPut(); - // TODO(alexvru): MinLatency support - if (batchedPuts.Queue.size() == 1) { - const TActorId reqID = Register( - CreateBlobStorageGroupPutRequest(Info, Sessions->GroupQueues, batchedPuts.Queue.front()->Sender, - Mon, batchedPuts.Queue.front()->Get(), batchedPuts.Queue.front()->Cookie, - std::move(batchedPuts.Queue.front()->TraceId), Mon->TimeStats.IsEnabled(), PerDiskStats, kind, - TActivationContext::Now(), StoragePoolCounters, enableRequestMod3x3ForMinLatency)); - ActiveRequests.insert(reqID); + if (CurrentStateFunc() == &TThis::StateWork) { + TAppData *app = NKikimr::AppData(TActivationContext::AsActorContext()); + bool enableRequestMod3x3ForMinLatency = app->FeatureFlags.GetEnable3x3RequestsForMirror3DCMinLatencyPut(); + // TODO(alexvru): MinLatency support + if (batchedPuts.Queue.size() == 1) { + const TActorId reqID = Register( + CreateBlobStorageGroupPutRequest(Info, Sessions->GroupQueues, batchedPuts.Queue.front()->Sender, + Mon, batchedPuts.Queue.front()->Get(), batchedPuts.Queue.front()->Cookie, + std::move(batchedPuts.Queue.front()->TraceId), Mon->TimeStats.IsEnabled(), PerDiskStats, kind, + TActivationContext::Now(), StoragePoolCounters, enableRequestMod3x3ForMinLatency)); + ActiveRequests.insert(reqID); + } else { + const TActorId reqID = Register( + CreateBlobStorageGroupPutRequest(Info, Sessions->GroupQueues, + Mon, batchedPuts.Queue, Mon->TimeStats.IsEnabled(), PerDiskStats, kind, TActivationContext::Now(), + StoragePoolCounters, handleClass, tactic, enableRequestMod3x3ForMinLatency)); + ActiveRequests.insert(reqID); + } } else { - const TActorId reqID = Register( - CreateBlobStorageGroupPutRequest(Info, Sessions->GroupQueues, - Mon, batchedPuts.Queue, Mon->TimeStats.IsEnabled(), PerDiskStats, kind, TActivationContext::Now(), - StoragePoolCounters, handleClass, tactic, enableRequestMod3x3ForMinLatency)); - ActiveRequests.insert(reqID); + for (auto it = batchedPuts.Queue.begin(); it != batchedPuts.Queue.end(); ++it) { + TAutoPtr<IEventHandle> ev = it->Release(); + Receive(ev); + } } } else { for (auto it = batchedPuts.Queue.begin(); it != batchedPuts.Queue.end(); ++it) { |