| -- test for Github Issue 15278 |
| -- QD should reset InterruptHoldoffCount |
| -- start_ignore |
| create extension if not exists gp_inject_fault; |
| -- end_ignore |
| select gp_inject_fault('start_prepare', 'error', dbid, current_setting('gp_session_id')::int) |
| from gp_segment_configuration where content = 0 and role = 'p'; |
| gp_inject_fault |
| ----------------- |
| Success: |
| (1 row) |
| |
| create table t_15278(a int, b int); |
| NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. |
| HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. |
| ERROR: fault triggered, fault name:'start_prepare' fault type:'error' (seg0 127.0.1.1:6002 pid=764409) |
| -- Without fix, the above transaction will lead |
| -- QD's global var InterruptHoldoffCount not reset to 0 |
| -- thus the below SQL will return t. After fixing, now |
| -- the below SQL will print an error message, this is |
| -- the correct behavior. |
| select pg_cancel_backend(pg_backend_pid()); |
| ERROR: canceling statement due to user request |
| select gp_inject_fault('start_prepare', 'reset', dbid, current_setting('gp_session_id')::int) |
| from gp_segment_configuration where content = 0 and role = 'p'; |
| gp_inject_fault |
| ----------------- |
| Success: |
| (1 row) |
| |