Commit f34f5c8
ExternalSorter: add pool-relative pre-merge spill trigger (0.66)
The self-relative trigger (`sorter.used() > pool_limit / num_workers`)
catches early-finisher partitions but misses the common Q18 pattern:
all partitions transition with their own footprint just below the
fair share (e.g. 470 MiB each on 8 GiB / 16 workers where self_share
is 512 MiB), yet the pool itself is at 7+ GiB because other consumers
are loaded. Self-relative never fires; the merge enters with no
headroom.
Port the pool-relative trigger from the original
`reclaimer-sortmerge-hashagg` branch with a 0.66 threshold (vs. the
old 0.33). On an 8 GiB pool that's ~5.3 GiB — high enough that we
don't spill spuriously on light queries, but well below the
"merge-can't-grow" zone Q18 hits at ~7 GiB.
Now: `sorter.used() > self_share || pool_used > pool_threshold`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 74726fd commit f34f5c8
1 file changed
Lines changed: 34 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
| |||
1595 | 1604 | | |
1596 | 1605 | | |
1597 | 1606 | | |
1598 | | - | |
1599 | | - | |
1600 | | - | |
1601 | | - | |
1602 | | - | |
1603 | | - | |
1604 | | - | |
1605 | | - | |
1606 | | - | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
1607 | 1627 | | |
1608 | 1628 | | |
1609 | 1629 | | |
| |||
1613 | 1633 | | |
1614 | 1634 | | |
1615 | 1635 | | |
1616 | | - | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1617 | 1641 | | |
1618 | 1642 | | |
1619 | 1643 | | |
| |||
0 commit comments