ryapandt opened a new issue, #1749:
URL: https://github.com/apache/cloudberry/issues/1749
### Apache Cloudberry version
2.1
### What happened
PAX DELETE can crash with SIGSEGV when `bloomfilter_columns` are not
included in `minmax_columns`
The crash happens in the DELETE visibility-map path:
```
pax::TableDeleter::DeleteWithVisibilityMap
pax::TableDeleter::UpdateStatsInAuxTable
pax::MicroPartitionStatsUpdater::Update
pax::MicroPartitionStats::AddRow
```
**Workaround:**
Temporarily reset bloom filter columns before DELETE
### What you think should happen instead
The DELETE should complete successfully and PAX auxiliary statistics should
be updated correctly.
### How to reproduce
```
DROP TABLE IF EXISTS pax_delete_bloom_crash;
CREATE TABLE pax_delete_bloom_crash (
id int,
k int,
payload text
)
USING pax
WITH (
minmax_columns = 'id',
bloomfilter_columns = 'payload'
);
INSERT INTO pax_delete_bloom_crash
SELECT
i,
i % 10,
'payload-' || i::text
FROM generate_series(1, 10000) AS i;
-- This DELETE triggers PAX visibility map update and statistics refresh.
-- On affected builds, a segment may crash with SIGSEGV.
DELETE FROM pax_delete_bloom_crash
WHERE id BETWEEN 1 AND 100;
```
### Operating System
rocky 9.6
### Anything else
**Suggested Fix (From CODEX)** :
When building stats_updater_projection in
TableDeleter::DeleteWithVisibilityMap(), include all columns required by
statistics refresh, not only minmax_columns.
For example, use the union of:
```
cbdb::GetMinMaxColumnIndexes(rel_)
cbdb::GetBloomFilterColumnIndexes(rel_)
```
Then pass that union to:
`stats_updater_projection->SetColumnProjection(...)`
while still passing the original minmax and bloom filter column lists to
UpdateStatsInAuxTable().
### Are you willing to submit PR?
- [ ] 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]