Repository navigation
Description
Description
TPC-DS 1 TB query80 fails on single-CN MatrixOne main when join-spill reaches the 40 GiB process memory ceiling. The spill path cannot admit even its minimum scatter/codec allocation, so the supported query aborts instead of continuing through spill.
Environment
- Branch:
main - Commit:
e31ee06042bc708ac5620a579715e07ec31c21b6 - Deployment: 129 single node / one CN, TPC-DS SF=1000 (1 TB)
- Query process limitation:
42949672960bytes (40 GiB) - Run: https://github.com/matrixorigin/mo-auto-test/actions/runs/30991050343
- Job: https://github.com/matrixorigin/mo-auto-test/actions/runs/30991050343/job/92258474435
- Query window: 2026-08-05 17:18:38–17:20:32 CST
Steps to reproduce
Load TPC-DS SF=1000 and execute the exact generated SQL:
with ssr as
(select s_store_id as store_id,
sum(ss_ext_sales_price) as sales,
sum(coalesce(sr_return_amt, 0)) as returns,
sum(ss_net_profit - coalesce(sr_net_loss, 0)) as profit
from store_sales left outer join store_returns on
(ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number),
date_dim,
store,
item,
promotion
where ss_sold_date_sk = d_date_sk
and d_date between cast('1998-08-04' as date)
and (cast('1998-08-04' as date) + 30 days)
and ss_store_sk = s_store_sk
and ss_item_sk = i_item_sk
and i_current_price > 50
and ss_promo_sk = p_promo_sk
and p_channel_tv = 'N'
group by s_store_id)
,
csr as
(select cp_catalog_page_id as catalog_page_id,
sum(cs_ext_sales_price) as sales,
sum(coalesce(cr_return_amount, 0)) as returns,
sum(cs_net_profit - coalesce(cr_net_loss, 0)) as profit
from catalog_sales left outer join catalog_returns on
(cs_item_sk = cr_item_sk and cs_order_number = cr_order_number),
date_dim,
catalog_page,
item,
promotion
where cs_sold_date_sk = d_date_sk
and d_date between cast('1998-08-04' as date)
and (cast('1998-08-04' as date) + 30 days)
and cs_catalog_page_sk = cp_catalog_page_sk
and cs_item_sk = i_item_sk
and i_current_price > 50
and cs_promo_sk = p_promo_sk
and p_channel_tv = 'N'
group by cp_catalog_page_id)
,
wsr as
(select web_site_id,
sum(ws_ext_sales_price) as sales,
sum(coalesce(wr_return_amt, 0)) as returns,
sum(ws_net_profit - coalesce(wr_net_loss, 0)) as profit
from web_sales left outer join web_returns on
(ws_item_sk = wr_item_sk and ws_order_number = wr_order_number),
date_dim,
web_site,
item,
promotion
where ws_sold_date_sk = d_date_sk
and d_date between cast('1998-08-04' as date)
and (cast('1998-08-04' as date) + 30 days)
and ws_web_site_sk = web_site_sk
and ws_item_sk = i_item_sk
and i_current_price > 50
and ws_promo_sk = p_promo_sk
and p_channel_tv = 'N'
group by web_site_id)
select * from ( select channel
, id
, sum(sales) as sales
, sum(returns) as returns
, sum(profit) as profit
from
(select 'store channel' as channel
, 'store' || store_id as id
, sales
, returns
, profit
from ssr
union all
select 'catalog channel' as channel
, 'catalog_page' || catalog_page_id as id
, sales
, returns
, profit
from csr
union all
select 'web channel' as channel
, 'web_site' || web_site_id as id
, sales
, returns
, profit
from wsr
) x
group by rollup (channel, id)
order by channel
,id
) where rownum <= 100;Actual behavior
The query failed after 114.623 seconds:
ERROR 1105 (HY000) at line 1:
minimum allocation cannot be admitted:
owner=join-spill
site=scatter-selected-or-codec
used=42872692992
limit=42949672960
Server evidence:
- pipeline MPool reached
42949737400bytes, approximately 40.0 GiB; - 169
minimum allocation cannot be admittedrecords were logged; - the failing owner/site was the join-spill scatter/codec path;
- 27 follow-on
context canceledrecords were logged; - MatrixOne did not panic or restart.
Expected behavior
The join-spill path should reserve enough bounded recovery/scatter capacity to spill admitted state and complete the supported TPC-DS query while honoring the hard process limit. It should not consume the full ceiling and then fail its own minimum recovery allocation.
Stability and controls
- Reproducer: observed in one official full TPC-DS SF=1000 run; no manual rerun before filing.
- Control: 84 of 99 queries completed successfully in the same run.
- Failure state: MatrixOne stayed alive and later queries continued.
Evidence
- Actions run/job linked above.
- Exact generated SQL and
query80.errare in the run'stpcds-resultartifact. - Loki logs for host
10-222-1-129show the allocation-admission series and MPool peak.
Code analysis
This is a join-spill allocation/reservation failure, distinct from the HashBuild budget error reported for query4/query64. The spill path reaches the process limit before reserving the minimum scatter-selected/codec allocation needed to make forward progress. The follow-on context cancellations are consequences, not the initiating error.
The workflow's intended GOMEMLIMIT was placed after command redirection and was not exported to mo-service; that infrastructure problem will be fixed separately. The error here is nevertheless MatrixOne's explicit query process-limit/spill-recovery failure at 40 GiB.
Regression coverage
Add large-data join-spill coverage for the query80 plan shape under a finite process limit. Assert query completion, result correctness, bounded peak memory, spill cleanup, and successful execution of a following statement.
Related
- Source run: https://github.com/matrixorigin/mo-auto-test/actions/runs/30991050343
- HashBuild shared-budget issue (different owner/path): [Bug]: shuffle HashBuild can strand TPCH Q9 spill recovery under a shared budget #26586
Activity
Ariznawlll commentedon Nov 16, 2026
结论
测试通过。兼容改写后的 Q80 在本次复测中三次正常完成,未复现原 issue 报错;按本次查询复测结果,原问题已解决。
关键证据
main@4349e7321825639c0f9001e4271df278127060cf;processLimitationSize=42949672960(40 GiB),服务MemoryMax=180 GiB。DATE_ADD、派生表加别名、使用外层ORDER BY ... LIMIT 100,并将三处字符串||改为CONCAT。日期边界和相关 ID 列的 NULL/空字符串检查见测试产物,其中保留了 SQL 及哈希。9bdeebba980e213903fbb141c6bee880e5bda2446b11dc1ee3a896c9fc5cb176。待解决点
Ariznawlll commentedon Nov 17, 2026
重新打开:此前关闭时没有已核实存在的对应 motr 用例 PR,不符合“先完成回归交付,再关闭”的要求。现恢复 Open;原验证证据与未覆盖边界保留,待补齐可核查的 motr 回归交付后再统一给出关闭结论。
Ariznawlll commentedon Nov 17, 2026
补充专用环境 motr 草案(尚未验收,保持 OPEN)
matrixorigin/motr#358 已加入原始 TPC-DS Q80 SQL 和专用环境场景草案:
script/14_issue_regression/issue_26744_query80.sqlscript/14_issue_regression/issue_26744_tpcds_query80_join_spill.py该 PR 当前 OPEN、尚未合入,4 项离线 CI 通过;这不代表 #26744 已通过。草案没有通过 baseline,未配置专用环境时返回 77/SKIP,启用后参数、文件、断言或实际 spill 证据缺失必须失败。
草案要求独立参考引擎的完整结果及 SF1000 数据身份,不能从同一 MatrixOne 基表重算相似查询充当独立 oracle;并要求原始 Q80 的 100 行结果、40 GiB 强制资源边界、实际
__spill文件观察、spill 清理和后续查询。ROLLUP 行语义由独立结果完整比对,不假定固定尾部为 NULL;已移除没有依据的 SIGUSR1 探针,保留的 signal 0 只检查进程存在。当前仍未完成真实 SF1000+40 GiB 强制边界+实际 join-spill 的验收,也未验收 Linux RLIMIT_AS/macOS resource receipt 协议。因此本 issue 继续保持 OPEN,不以草案或 SKIP 作为通过证明。