[Bug] REINDEX DATABASE CONCURRENTLY breaks temporary PAX tables created with ON COMMIT DELETE ROWS
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
Direzione di ricerca
Start with the reproduction in the issue, then read how the aux table is created in pax_aux_table.cc and how ON COMMIT DELETE ROWS truncation reaches heap_truncate_one_rel through CPaxNontransactionalTruncateTable. FindAuxIndexOid and the check at pax_manifest.cc:753 explain why the leftover _ccnew index breaks later inserts. Done means REINDEX DATABASE CONCURRENTLY leaves the temporary PAX table usable, with a regression test covering it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Apache Cloudberry version
main
What happened
Reproduce:
CREATE TEMP TABLE p(a int) USING pax ON COMMIT DELETE ROWS DISTRIBUTED BY (a);
REINDEX DATABASE CONCURRENTLY <current_database>;
-- ERROR: index "pg_pax_blocks_<oid>_idx_ccnew" already contains data (nbtsort.c:327)
INSERT INTO p VALUES (1);
-- ERROR: .../pax_manifest.cc:753 C ERROR detail: (PG message: unexpected number of index of aux table: 2)
After this, every INSERT into p fails for the rest of the session.
Expected: REINDEX succeeds and the table stays usable, as it does with a non-concurrent REINDEX DATABASE, a plain PAX table, a temporary PAX table without ON COMMIT DELETE ROWS, or a heap table with ON COMMIT
DELETE ROWS.
Cause (from reading the code):
- The aux table of a temporary PAX table is created as permanent (pax_aux_table.cc). PostgreSQL's rule of never reindexing temporary relations concurrently therefore doesn't apply, and the aux index is rebuilt
concurrently. - Between the concurrent reindex's transactions, the ON COMMIT DELETE ROWS truncation (CPaxNontransactionalTruncateTable, which calls heap_truncate_one_rel) re-initializes every index on the aux table,
including the unbuilt _ccnew index. The build step then fails. - The failed reindex leaves _ccnew behind. FindAuxIndexOid counts invalid indexes too, so every later write fails.
What you think should happen instead
No response
How to reproduce
CREATE TEMP TABLE p(a int) USING pax ON COMMIT DELETE ROWS DISTRIBUTED BY (a);
REINDEX DATABASE CONCURRENTLY <current_database>;
-- ERROR: index "pg_pax_blocks_<oid>_idx_ccnew" already contains data (nbtsort.c:327)
INSERT INTO p VALUES (1);
-- ERROR: .../pax_manifest.cc:753 C ERROR detail: (PG message: unexpected number of index of aux table: 2)
After this, every INSERT into p fails for the rest of the session.
Operating System
any
Anything else
No response
Are you willing to submit PR?
- Yes, I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct.
- Lingua principale
- C
- Stelle
- 1.4k
- Fork
- 260
- Merge medio
- 4g 19h
- PR unite (30g)
- 54
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/cloudberry
-
[Bug] Expand fails to recognize user-defined tablespacesForse già presa @nix-oss l’ha presa 58 giorni fa. Apertatype: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/cloudberry#1885 · 2 reazioni ·
I maintainer di solito rispondono entro 3 giorni
-
gpexpand first stage fails: 'SyncPackages' object has no attribute 'ret' (extension sync never runs; regression)Forse già presa @talmacschen-arch l’ha presa 119 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
apache/cloudberry#1825 ·
I maintainer di solito rispondono entro 3 giorni
-
type: Bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 58/100
apache/cloudberry#2137 ·
I maintainer di solito rispondono entro 3 giorni
-
type: Proposal
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
apache/cloudberry#2136 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
apache/cloudberry#2135 ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di apache/cloudberry
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ChrisTitusTech/dwm-titus#397 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue help wanted language:fr translation
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
mrvi0/cli-cheatsheet#160 ·
-
Test modules use volatile int for cross-thread flags instead of atomicsForse già presa @rahimuddin140 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
valkey-io/valkey#4899 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Profiler (Remotery) leaks a socket for every connection that fails the WebSocket handshakeForse già presa @rthery l’ha presa oggi. Apertatriage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno