avamingli opened a new issue, #1665:
URL: https://github.com/apache/cloudberry/issues/1665
### Apache Cloudberry version
main
### What happened
Running `VACUUM ANALYZE` on a heap table (or any AO table whose auxiliary
`aoseg` table is) stored in a **non-default tablespace** crashes a segment
with a segmentation fault on the **first** vacuum execution (before the FSM
and VM forks have ever been created).
### What you think should happen instead
_No response_
### How to reproduce
```sql
[61/1198]
-- 1. Create a non-default tablespace
CREATE TABLESPACE
crash_ts LOCATION '/tmp/crash_ts_dir';
-- 2. Create a heap table in it and insert data
CREATE TABLE t (id int, val text) TABLESPACE crash_ts DISTRIBUTED BY (id);
INSERT INTO t SELECT i, repeat('x', 80) FROM generate_series(1, 500) i;
-- 3. Run VACUUM for the first time ← crashes
VACUUM ANALYZE t;
The same crash occurs with an AO table, because vacuum_rel recursively
vacuums the aoseg auxiliary heap table, which lives in the same non-default
tablespace.
```
Observed Behavior
A segment process crashes with SIGSEGV. The coordinator reports:
ERROR: Error on receive from seg2 127.0.0.1:XXXXX pid=NNNN:
server closed the connection unexpectedly
Core backtrace:
```
Program terminated with signal SIGSEGV, Segmentation fault.
#0 fsm_extend (rel=..., fsm_nblocks=3) at freespace.c:637
#1 fsm_readbuf (...) at freespace.c:561
#2 fsm_set_and_search (...) at freespace.c:667
#3 RecordPageWithFreeSpace (...) at freespace.c:192
#4 lazy_scan_heap (...) at vacuumlazy.c:1599
#5 heap_vacuum_rel (...) at vacuumlazy.c:664
#6 table_relation_vacuum (...) at tableam.h:1923
#7 vacuum_rel (relid=<aoseg oid>, ...) at vacuum.c:2727
#8 vacuum_rel (relid=<ao table oid>, ...) at vacuum.c:2817 ← AO case
```
### Operating System
any
### Anything else
_No response_
### Are you willing to submit PR?
- [x] Yes, I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]