aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnaury <snaury@ydb.tech>2023-09-15 21:16:27 +0300
committersnaury <snaury@ydb.tech>2023-09-15 21:36:45 +0300
commit7d42ee7f7f5f80a7ed2bb79a3bf018a00ba09fb4 (patch)
treea16b28a59f4c4f030df5fe3263e930d6b6aec0fa
parentd2c95cc997093871cd3b4fb25d20817cf1c490ee (diff)
downloadydb-7d42ee7f7f5f80a7ed2bb79a3bf018a00ba09fb4.tar.gz
Don't take from chunks limiter when reply size limit exceeded or scan finishes KIKIMR-19378
-rw-r--r--ydb/core/tx/datashard/datashard__kqp_scan.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/ydb/core/tx/datashard/datashard__kqp_scan.cpp b/ydb/core/tx/datashard/datashard__kqp_scan.cpp
index 9ab272aa7d..d4e147693b 100644
--- a/ydb/core/tx/datashard/datashard__kqp_scan.cpp
+++ b/ydb/core/tx/datashard/datashard__kqp_scan.cpp
@@ -450,9 +450,6 @@ private:
<< ", bytes: " << sendBytes << ", rows: " << Rows << ", page faults: " << Result->PageFaults
<< ", finished: " << Result->Finished << ", pageFault: " << Result->PageFault);
- Y_VERIFY(ChunksLimiter.Take(sendBytes));
- Result->RequestedBytesLimitReached = !ChunksLimiter.HasMore();
-
if (sendBytes >= 48_MB) {
LOG_ERROR_S(*TlsActivationContext, NKikimrServices::TX_DATASHARD, "Query size limit exceeded.");
if (finish) {
@@ -472,6 +469,11 @@ private:
}
}
+ if (!finish) {
+ Y_VERIFY(ChunksLimiter.Take(sendBytes));
+ Result->RequestedBytesLimitReached = !ChunksLimiter.HasMore();
+ }
+
Send(ComputeActorId, Result.Release(), IEventHandle::FlagTrackDelivery);
ReportDatashardStats();