Describe the bug
I run some data(300g) in small mem(64g) with sort merge join spill.
Then i get error
Failed to allocate additional {} for {} with {} already allocated for this reservation - {} remain available for the total pool
And i try to fix it. I fix two code
remove this code:
|
self.reservation.try_resize(self.converter.size())?; |
and
|
match self.reservation.try_grow(size) { |
to
loop {
match self.reservation.try_grow(size) {
Ok(_) => Ok(()),
Err(e) => {
if self.in_mem_batches.is_empty() {
return Err(Self::err_with_oom_context(e));
}
// Spill and try again.
self.sort_and_spill_in_mem_batches().await?;
}
}
I think the issues are as follows:
- The memory was immediately occupied as soon as the sort operator spilled data to disk.
- The row operator failed to spill data to disk, which caused this problem.
So could we fix it in this way, or are there any better solutions?
To Reproduce
No response
Expected behavior
No response
Additional context
No response
Describe the bug
I run some data(300g) in small mem(64g) with sort merge join spill.
Then i get error
Failed to allocate additional {} for {} with {} already allocated for this reservation - {} remain available for the total poolAnd i try to fix it. I fix two code
remove this code:
datafusion/datafusion/physical-plan/src/sorts/stream.rs
Line 176 in c89cb70
and
datafusion/datafusion/physical-plan/src/sorts/sort.rs
Line 785 in c89cb70
to
I think the issues are as follows:
So could we fix it in this way, or are there any better solutions?
To Reproduce
No response
Expected behavior
No response
Additional context
No response