isolation2 lockmodes fails on cassert builds: extra AccessShareLock on partition root

Aperta Adatta ai principianti
#2,356 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@tuhaihe ci sta già lavorando.

Dal 19/11/2026.

  • #2357 di @tuhaihe — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, postgresql
Ambito
databases, testing

Direzione di ricerca

Inizia con il test lockmodes di isolation2 e i relativi file di output attesi; l’issue identifica il caso GDD-off INSERT INTO t_lockmods_part_tbl_dml e spiega il comportamento di cassert relcache. Termina la sessione 1 prima di quel caso, poi aggiorna i file attesi. Il lavoro è completo quando il test passa nelle build con assert abilitati e ORCA e l’output dei lock atteso corrisponde.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The isolation2 lockmodes test fails on assert-enabled builds (--enable-cassert) with ORCA on. Seen on the Debug workflow in #2328, same diff on two runs:

 1: select * from show_locks_lockmodes;
  locktype | mode             | granted | relation
 ----------+------------------+---------+---------------------------------
+ relation | AccessShareLock  | t       | t_lockmods_part_tbl_dml
  relation | RowExclusiveLock | t       | t_lockmods_part_tbl_dml
  relation | RowExclusiveLock | t       | t_lockmods_part_tbl_dml_1_prt_1
  relation | RowExclusiveLock | t       | t_lockmods_part_tbl_dml_1_prt_2
-(3 rows)
+(4 rows)

https://github.com/apache/cloudberry/actions/runs/44457186410/job/135340162927

This is the GDD-off INSERT INTO t_lockmods_part_tbl_dml ... case. The test already explains why the extra lock appears: with cassert, RELCACHE_FORCE_RELEASE drops the relcache entry on close, so generate_partition_qual() reopens the root with AccessShareLock. That's why the later cases start with 1q:, so they always run without a cached relcache.

The INSERT case (added in 454814d0e8f) sits before that comment and reuses session 1. On a Release build the root is still cached, so there's no lock; on a cassert build there is.

Fix: quit session 1 before the INSERT case and update the expected files.

Lingua principale
C
Stelle
1.4k
Fork
273
Merge medio
4g 6h
PR unite (30g)
105

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/cloudberry

Tutte le issue di apache/cloudberry

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.