[Bug]: Broadcast hash join fails on wide key-only builds and retains pending matches after reset
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Affected revisions
Confirmed on main at d58476485f and on the 4.2-dev backport candidate #33242 at 5ad4415c94. Related to #32143 and #32917.
A wide equality key fails when the query only counts probe rows
On one CN with max DOP 1, the default MPool allocation limit and an 8 GiB query budget, we inserted 8,192 build rows with IDs 1–8,192. The join key was MEDIUMTEXT, 262,150 bytes per row, drawn from 20 distinct values. The probe had one matching row for each of the 20 values and 16,364 unmatched rows. We inserted the long and short probe keys separately and checked source IDs, lengths and digests before the join.
| SQL | Expected | Observed |
|---|---|---|
SELECT SUM(b.id) FROM p LEFT JOIN b ON p.k=b.k |
33,558,528 | 33,558,528 |
SELECT COUNT(p.id) FROM p LEFT JOIN b ON p.k=b.k |
24,556 | Allocation failure, main 1105 / 4.2 candidate 20101 |
The build key requires 2,147,532,800 bytes if all 8,192 rows are packed together, above the 2,147,483,631-byte single-allocation limit. HashBuild still needs these input vectors while constructing the hash map, even when the probe consumes only the map. Its batching decision currently depends on whether the consumer retains build payload.
An early-finished probe retains part of its match group after reset
A normal MySQL LEFT JOIN with LIMIT 1 returned the expected row. Read-only observation on each branch showed 852 unconsumed selections immediately before and after HashJoin.Reset. Focused operator checks with a smaller byte limit left two selections after reset when the first output contained 11 of 13 wide matches. The fully emitted control left zero. These checks exercised the cleanup boundary; we did not observe a subsequent client query returning incorrect rows.
Expected behavior
Build temporary key batches within the single-allocation limit and preserve the query budget. Only consumers retaining payload need the physical row directory. Releasing a JoinMap should also discard pending selections owned by that map, so the next probe starts with an empty group.
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 312
- Avg merge
- 22h 59m
- Merged PRs (30d)
- 736
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from matrixorigin/matrixone
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
matrixorigin/matrixone#33363 ·
Maintainers usually reply within 1 day
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
matrixorigin/matrixone#33362 ·
Maintainers usually reply within 1 day
-
SLEEP rejects NULL and negative durations that MySQL acceptsPossibly taken @XuPeng-SH claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
matrixorigin/matrixone#32653 ·
Maintainers usually reply within 1 day
-
[Bug]: TestChangeWatchProxy loses its first tenant connection during PingContext in Ubuntu CIPossibly taken @XuPeng-SH claimed this today. Openkind/bug needs-triage
matrixorigin/matrixone#33371 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug]: TestDaemonClaimSQLRoundTrip exhausts its shared deadline during the stale claim update in Ubuntu CIPossibly taken @XuPeng-SH claimed this today. Openkind/bug needs-triage
matrixorigin/matrixone#33370 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in matrixorigin/matrixone
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zalando/postgres-operator#3257 ·
Maintainers usually reply within 2 days
-
[inputs.internal] README lists go_version tag on internal_gather instead of internal_agentPossibly taken @cvas22 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
influxdata/telegraf#20264 ·
Maintainers usually reply within 1 day
-
[Bug] Standalone migration breaks existing Ingress routes using the envoy-http Service port nameOpenaccepted bug wg/enterprise-environment
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#7483 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
stacklok/toolhive-catalog#2076 ·
Maintainers usually reply within 1 day