make auto-flush logic for distribute-aggregate a bit saner