Skip to content

Commit 659facd

Browse files
25-1-a Fix early object deletion in wide combiner (#17624)
1 parent c58582f commit 659facd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

yql/essentials/minikql/comp_nodes/mkql_wide_combine.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
504504
// while restoration we process buckets one by one starting from the first in a queue
505505
bool isNew = SpilledBuckets.front().InMemoryProcessingState->TasteIt();
506506
Throat = SpilledBuckets.front().InMemoryProcessingState->Throat;
507-
BufferForUsedInputItems.resize(0);
508507
return isNew ? ETasteResult::Init : ETasteResult::Update;
509508
}
510509

@@ -837,7 +836,7 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
837836
//process spilled data
838837
if (!bucket.SpilledData->Empty()) {
839838
RecoverState = false;
840-
BufferForUsedInputItems.resize(UsedInputItemType->GetElementsCount());
839+
std::fill(BufferForUsedInputItems.begin(), BufferForUsedInputItems.end(), NUdf::TUnboxedValuePod());
841840
AsyncReadOperation = bucket.SpilledData->ExtractWideItem(BufferForUsedInputItems);
842841
if (AsyncReadOperation) {
843842
return EUpdateResult::Yield;
@@ -886,6 +885,9 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
886885
YQL_LOG(INFO) << "switching Memory mode to ProcessSpilled";
887886
MKQL_ENSURE(EOperatingMode::Spilling == Mode, "Internal logic error");
888887
MKQL_ENSURE(SpilledBuckets.size() == SpilledBucketCount, "Internal logic error");
888+
MKQL_ENSURE(BufferForUsedInputItems.empty(), "Internal logic error");
889+
890+
BufferForUsedInputItems.resize(UsedInputItemType->GetElementsCount());
889891

890892
std::sort(SpilledBuckets.begin(), SpilledBuckets.end(), [](const TSpilledBucket& lhs, const TSpilledBucket& rhs) {
891893
bool lhs_in_memory = lhs.BucketState == TSpilledBucket::EBucketState::InMemory;

0 commit comments

Comments
 (0)