Skip to content

HashAggregationOperator misreports memory usage after spilling #10596

@findepi

Description

@findepi

In some situations, when spilling occurs, HashAggregationOperator doesn't reset memory usage to 0 upon finishing.

Can be reproduced with io.trino.operator.TestHashAggregationOperator#testHashAggregationMemoryReservation

after adding assertions:

// this passes
assertEquals(getOnlyElement(operator.getOperatorContext().getNestedOperatorStats()).getRevocableMemoryReservation().toBytes(), 0);
// this fails in some cases:
assertEquals(getOnlyElement(operator.getOperatorContext().getNestedOperatorStats()).getSystemMemoryReservation().toBytes(), 0);

right after

assertEquals(getOnlyElement(operator.getOperatorContext().getNestedOperatorStats()).getUserMemoryReservation().toBytes(), 0);

cc @sopel39

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions