Skip to content

Commit 8bdca99

Browse files
committed
added debug log + spilling
1 parent b038463 commit 8bdca99

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

ydb/library/yql/dq/actors/compute/dq_compute_memory_quota.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
#pragma once
33

4+
#include <format>
45
#include <util/system/mem_info.h>
56
#include <ydb/library/services/services.pb.h>
67
#include <ydb/library/yql/dq/actors/compute/dq_compute_actor.h>
@@ -60,15 +61,17 @@ namespace NYql::NDq {
6061
// Most likely this callback will be removed after KIKIMR-21481.
6162
void TrySetIncreaseMemoryLimitCallbackWithRSSControl(NKikimr::NMiniKQL::TScopedAlloc* alloc) {
6263
if (!CanAllocateExtraMemory) return;
63-
const ui64 limitRSS = std::numeric_limits<ui64>::max();
64+
const ui64 limitRSS = 3_GB;
6465
const ui64 criticalRSSValue = limitRSS / 100 * 80;
6566

6667
alloc->Ref().SetIncreaseMemoryLimitCallback([this, alloc](ui64 limit, ui64 required) {
6768
RequestExtraMemory(required - limit, alloc);
6869

6970
ui64 currentRSS = NMemInfo::GetMemInfo().RSS;
71+
std::cerr << std::format("[MISHA]: limit: {}MB required: {}MB, RSS: {}MB\n", limit / 1024 / 1024, required / 1024 / 1024, currentRSS / 1024 / 1024);
7072
if (currentRSS > criticalRSSValue) {
7173
alloc->SetMaximumLimitValueReached(true);
74+
std::cerr << std::format("[MISHA]: MAximum limit set up\n");
7275
}
7376
});
7477
}

ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "mkql_wide_combine.h"
22
#include "mkql_rh_hash.h"
33

4+
#include <format>
45
#include <ydb/library/yql/minikql/computation/mkql_computation_node_codegen.h> // Y_IGNORE
56
#include <ydb/library/yql/minikql/computation/mkql_llvm_base.h> // Y_IGNORE
67
#include <ydb/library/yql/minikql/computation/mkql_computation_node.h>
@@ -366,7 +367,13 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
366367
~TSpillingSupportState() {
367368
}
368369

370+
bool WasLog = false;
371+
369372
EFetchResult DoCalculate(TComputationContext& ctx, NUdf::TUnboxedValue*const* output) {
373+
if (!WasLog) {
374+
std::cerr << "[MISHA] WIDE COMBINE\n";
375+
WasLog = true;
376+
}
370377
while (true) {
371378
switch(GetMode()) {
372379
case EOperatingMode::InMemory: {
@@ -514,8 +521,10 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
514521

515522
if (!HasMemoryForProcessing()) {
516523
bool isWaitingForReduce = TryToReduceMemory();
524+
std::cerr << std::format("[MISHA] PROCESSING. is waiting: {}\n", isWaitingForReduce);
517525
if (isWaitingForReduce) return;
518526
}
527+
std::cerr << "[MISHA] PROCESSING\n";
519528

520529
if (BufferForUsedInputItems.size()) {
521530
auto& bucket = SpilledBuckets[BufferForUsedInputItemsBucketId];
@@ -680,6 +689,7 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
680689
break;
681690
}
682691
case EOperatingMode::Spilling: {
692+
std::cerr << "[MISHA] spilling enabled\n";
683693
MKQL_ENSURE(EOperatingMode::InMemory == Mode, "Internal logic error");
684694
SpilledBuckets.resize(SpilledBucketCount);
685695
auto spiller = ctx.SpillerFactory->CreateSpiller();
@@ -706,9 +716,9 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
706716
}
707717

708718
bool IsSwitchToSpillingModeCondition() const {
709-
return false;
719+
// return false;
710720
// TODO: YQL-18033
711-
// return !HasMemoryForProcessing();
721+
return !HasMemoryForProcessing();
712722
}
713723

714724
private:

ydb/library/yql/providers/dq/worker_manager/local_worker_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace NYql::NDqs {
3030
NDq::NTaskRunnerActor::ITaskRunnerActorFactory::TPtr TaskRunnerActorFactory;
3131
THashMap<TString, TString> ClusterNamesMapping;
3232

33-
ui64 MkqlInitialMemoryLimit = 8_GB;
33+
ui64 MkqlInitialMemoryLimit = 300_MB;
3434
ui64 MkqlTotalMemoryLimit = 0;
3535
ui64 MkqlMinAllocSize = 30_MB;
3636
ui64 MkqlProgramHardMemoryLimit = 0;

0 commit comments

Comments
 (0)