andygrove commented on code in PR #1452:
URL: https://github.com/apache/datafusion-comet/pull/1452#discussion_r1975560354
##########
native/core/src/execution/shuffle/shuffle_writer.rs:
##########
@@ -472,41 +462,12 @@ impl ShuffleRepartitioner {
.enumerate()
.filter(|(_, (start, end))| start < end)
{
- let mut mem_diff = self
- .append_rows_to_partition(
- input.columns(),
- &shuffled_partition_ids[start..end],
- partition_id,
- )
- .await?;
-
- if mem_diff > 0 {
- let mem_increase = mem_diff as usize;
-
- let try_grow = {
- let mut mempool_timer =
self.metrics.mempool_time.timer();
- let result =
self.reservation.try_grow(mem_increase);
- mempool_timer.stop();
- result
- };
-
- if try_grow.is_err() {
- self.spill().await?;
- let mut mempool_timer =
self.metrics.mempool_time.timer();
- self.reservation.free();
- self.reservation.try_grow(mem_increase)?;
- mempool_timer.stop();
- mem_diff = 0;
- }
- }
-
- if mem_diff < 0 {
- let mem_used = self.reservation.size();
- let mem_decrease = mem_used.min(-mem_diff as usize);
- let mut mempool_timer =
self.metrics.mempool_time.timer();
- self.reservation.shrink(mem_decrease);
- mempool_timer.stop();
- }
Review Comment:
We don't need any of this memory accounting because it is already handled
within `append_rows_to_partition`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]