aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormfilitov <mfilitov@yandex-team.com>2025-03-20 19:30:49 +0300
committermfilitov <mfilitov@yandex-team.com>2025-03-20 19:44:41 +0300
commit77e33e55d0ef2ddea8d6e7a06222506ddf906d00 (patch)
tree37e9e9fde7d68e0dcabcf09e21f4fcd2dcfac793
parente46659b81b6c7ca63eabfd9f90ef2ed03c04c494 (diff)
downloadydb-77e33e55d0ef2ddea8d6e7a06222506ddf906d00.tar.gz
Added YellowZone check after preallocation in gracejoin
Additional check that after allocating memory we did not go beyond the yellow zone. Otherwise deallocate and switch to spilling commit_hash:c240687c121d99a4b794f5da2993e984854d6bc8
-rw-r--r--yql/essentials/minikql/comp_nodes/mkql_grace_join_imp.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/yql/essentials/minikql/comp_nodes/mkql_grace_join_imp.cpp b/yql/essentials/minikql/comp_nodes/mkql_grace_join_imp.cpp
index 475e9a012e5..5163d779423 100644
--- a/yql/essentials/minikql/comp_nodes/mkql_grace_join_imp.cpp
+++ b/yql/essentials/minikql/comp_nodes/mkql_grace_join_imp.cpp
@@ -359,10 +359,15 @@ bool TTable::TryToPreallocateMemoryForJoin(TTable & t1, TTable & t2, EJoinKind /
tableForPreallocation.NumberOfKeyStringColumns != 0, tableForPreallocation.NumberOfKeyIColumns != 0);
const auto slotSize = ComputeNumberOfSlots(tableForPreallocation.TableBucketsStats[bucket].TuplesNum);
+ bool wasException = false;
try {
bucketForPreallocation.JoinSlots.reserve(nSlots*slotSize);
bucketForPreallocationStats.BloomFilter.Reserve(bucketForPreallocationStats.TuplesNum);
} catch (TMemoryLimitExceededException) {
+ wasException = true;
+ }
+
+ if (wasException || TlsAllocState->IsMemoryYellowZoneEnabled()) {
for (ui64 i = 0; i < bucket; ++i) {
auto& b1 = t1.TableBuckets[i];
b1.JoinSlots.resize(0);