Repository navigation
Description
Description
TPC-DS 1 TB query4 fails on current MatrixOne main. The server first records the real HashBuild memory-budget exhaustion, but the SQL client only receives internal error: context canceled. The original product error is lost during pipeline cancellation/cleanup, making the failure misleading and hard to diagnose.
Environment
- Branch:
main - Commit:
e31ee06042bc708ac5620a579715e07ec31c21b6 - Deployment: 129 single node / one CN, TPC-DS SF=1000 (1 TB)
- Query process limitation in logs:
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 10:00:29–10:01:14 CST
Steps to reproduce
Load TPC-DS SF=1000 and execute the exact generated SQL:
with year_total as (
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,c_preferred_cust_flag customer_preferred_cust_flag
,c_birth_country customer_birth_country
,c_login customer_login
,c_email_address customer_email_address
,d_year dyear
,sum(((ss_ext_list_price-ss_ext_wholesale_cost-ss_ext_discount_amt)+ss_ext_sales_price)/2) year_total
,'s' sale_type
from customer
,store_sales
,date_dim
where c_customer_sk = ss_customer_sk
and ss_sold_date_sk = d_date_sk
group by c_customer_id
,c_first_name
,c_last_name
,c_preferred_cust_flag
,c_birth_country
,c_login
,c_email_address
,d_year
union all
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,c_preferred_cust_flag customer_preferred_cust_flag
,c_birth_country customer_birth_country
,c_login customer_login
,c_email_address customer_email_address
,d_year dyear
,sum((((cs_ext_list_price-cs_ext_wholesale_cost-cs_ext_discount_amt)+cs_ext_sales_price)/2) ) year_total
,'c' sale_type
from customer
,catalog_sales
,date_dim
where c_customer_sk = cs_bill_customer_sk
and cs_sold_date_sk = d_date_sk
group by c_customer_id
,c_first_name
,c_last_name
,c_preferred_cust_flag
,c_birth_country
,c_login
,c_email_address
,d_year
union all
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,c_preferred_cust_flag customer_preferred_cust_flag
,c_birth_country customer_birth_country
,c_login customer_login
,c_email_address customer_email_address
,d_year dyear
,sum((((ws_ext_list_price-ws_ext_wholesale_cost-ws_ext_discount_amt)+ws_ext_sales_price)/2) ) year_total
,'w' sale_type
from customer
,web_sales
,date_dim
where c_customer_sk = ws_bill_customer_sk
and ws_sold_date_sk = d_date_sk
group by c_customer_id
,c_first_name
,c_last_name
,c_preferred_cust_flag
,c_birth_country
,c_login
,c_email_address
,d_year
)
select * from ( select
t_s_secyear.customer_id
,t_s_secyear.customer_first_name
,t_s_secyear.customer_last_name
,t_s_secyear.customer_email_address
from year_total t_s_firstyear
,year_total t_s_secyear
,year_total t_c_firstyear
,year_total t_c_secyear
,year_total t_w_firstyear
,year_total t_w_secyear
where t_s_secyear.customer_id = t_s_firstyear.customer_id
and t_s_firstyear.customer_id = t_c_secyear.customer_id
and t_s_firstyear.customer_id = t_c_firstyear.customer_id
and t_s_firstyear.customer_id = t_w_firstyear.customer_id
and t_s_firstyear.customer_id = t_w_secyear.customer_id
and t_s_firstyear.sale_type = 's'
and t_c_firstyear.sale_type = 'c'
and t_w_firstyear.sale_type = 'w'
and t_s_secyear.sale_type = 's'
and t_c_secyear.sale_type = 'c'
and t_w_secyear.sale_type = 'w'
and t_s_firstyear.dyear = 2001
and t_s_secyear.dyear = 2001+1
and t_c_firstyear.dyear = 2001
and t_c_secyear.dyear = 2001+1
and t_w_firstyear.dyear = 2001
and t_w_secyear.dyear = 2001+1
and t_s_firstyear.year_total > 0
and t_c_firstyear.year_total > 0
and t_w_firstyear.year_total > 0
and case when t_c_firstyear.year_total > 0 then t_c_secyear.year_total / t_c_firstyear.year_total else null end
> case when t_s_firstyear.year_total > 0 then t_s_secyear.year_total / t_s_firstyear.year_total else null end
and case when t_c_firstyear.year_total > 0 then t_c_secyear.year_total / t_c_firstyear.year_total else null end
> case when t_w_firstyear.year_total > 0 then t_w_secyear.year_total / t_w_firstyear.year_total else null end
order by t_s_secyear.customer_id
,t_s_secyear.customer_first_name
,t_s_secyear.customer_last_name
,t_s_secyear.customer_email_address
) where rownum <= 100;Actual behavior
The query failed after 44.407 seconds. The client received only:
ERROR 20101 (HY000) at line 1: internal error: context canceled
However, the server sequence shows the initiating failure before the client error:
- pipeline MPool reached
41877357976bytes (39.001 GiB); - global MPool reached
55854839680bytes (52.019 GiB); out of memoryrecords began;- an operator diagnostic reported:
resource exhausted: hash build memory budget exceeded requested=10240 used=42949663808 limit=42949672960 - cleanup/cancellation produced 122
internal error: context canceledrecords; - the client received only the cancellation error.
Expected behavior
The client must receive the original actionable HashBuild resource-exhausted error. Pipeline cancellation and cleanup must not replace an already-known execution failure with generic context canceled.
The underlying HashBuild budget/spill failure is tracked separately in #26742; this issue specifically tracks error propagation and preservation.
Stability and controls
- Reproducer: observed in one official full TPC-DS SF=1000 run; no manual rerun before filing.
- Control: query64 in the same run returned its HashBuild error directly rather than only
context canceled. - Failure state: MatrixOne stayed alive and later queries continued.
Evidence
- Actions run/job linked above.
- Exact generated SQL and
query4.errare in the run'stpcds-resultartifact. - Loki logs for host
10-222-1-129contain the ordered resource-exhausted and context-canceled records.
Code analysis
The first failure is HashBuild budget exhaustion, but the pipeline's cancellation/cleanup path loses or overrides the durable original error before the client response. This is an error-precedence/propagation bug separate from whether HashBuild should have spilled successfully.
Regression coverage
Add a focused regression where HashBuild returns a known resource-exhausted error while downstream pipeline operators are active. Assert that the client receives the original error and that cleanup completes without replacing it with context canceled.
Related
- Underlying TPC-DS query64 HashBuild budget issue: [Bug]: TPC-DS 1TB Q64 exhausts HashBuild budget instead of spilling #26742
- Shared-budget issue: [Bug]: shuffle HashBuild can strand TPCH Q9 spill recovery under a shared budget #26586
- Prior pipeline error-masking issue: [Bug]: pipeline cleanup fallback masks the original execution error #26322
- Source run: https://github.com/matrixorigin/mo-auto-test/actions/runs/30991050343
Activity
fix(pipeline): make terminal completion durable and preserve root err…
fix(pipeline): make terminal completion durable and preserve root err…
fix(pipeline): make terminal completion durable and preserve root err…
fix(pipeline): make terminal completion durable and preserve root err…