Skip to content

Commit e08e74c

Browse files
authored
RateLimiter creation has been fixed for analytical queries (ydb-platform#10612) (ydb-platform#11012)
1 parent ba86523 commit e08e74c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ydb/core/fq/libs/control_plane_proxy/actors/request_actor.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,15 @@ class TCreateQueryRequestActor :
202202
}
203203
}
204204

205+
bool ShouldCreateRateLimiter() const {
206+
return RequestProxy->Get()->Quotas
207+
&& (RequestProxy->Get()->Request.content().type() == FederatedQuery::QueryContent::STREAMING
208+
|| !Config.ComputeConfig.YdbComputeControlPlaneEnabled(RequestProxy->Get()->Scope));
209+
}
210+
205211
void OnBootstrap() override {
206212
this->UnsafeBecome(&TCreateQueryRequestActor::StateFunc);
207-
if (RequestProxy->Get()->Quotas) {
213+
if (ShouldCreateRateLimiter()) {
208214
SendCreateRateLimiterResourceRequest();
209215
} else {
210216
SendRequestIfCan();
@@ -249,7 +255,7 @@ class TCreateQueryRequestActor :
249255
}
250256

251257
bool CanSendRequest() const override {
252-
return (QuoterResourceCreated || !RequestProxy->Get()->Quotas) && TBaseRequestActor::CanSendRequest();
258+
return (QuoterResourceCreated || !ShouldCreateRateLimiter()) && TBaseRequestActor::CanSendRequest();
253259
}
254260
};
255261

0 commit comments

Comments
 (0)