Re: Relations being opened without any lock whatever
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@lists.postgresql.org
Date: 2018-10-01T07:19:58Z
Lists: pgsql-hackers
On 2018/10/01 4:20, Tom Lane wrote: > Running the regression tests with the patch I showed in > https://www.postgresql.org/message-id/16565.1538327894@sss.pgh.pa.us > exposes two places where HEAD is opening relations without having > any lock at all on them: Maybe you've noticed but the relation_open calls coming from bootstrap.c all pass NoLock which trigger the WARNING: $ initdb -D /tmp/foo <snip> WARNING: relation_open: no lock held on pg_type WARNING: relation_open: no lock held on pg_attrdef WARNING: relation_open: no lock held on pg_constraint WARNING: relation_open: no lock held on pg_inherits WARNING: relation_open: no lock held on pg_index WARNING: relation_open: no lock held on pg_operator WARNING: relation_open: no lock held on pg_opfamily <so on> Do we need to do something about that, like teaching boot_openrel() and gettype() in bootstrap.c to pass AccessShareLock instead of NoLock? Thanks, Amit
Commits
-
Fix tuple_data_split() to not open a relation without any lock.
- ec5f71aeadf9 9.6.11 landed
- b66827ca7c5a 12.0 landed
- 370b28ccd430 10.6 landed
- 1f25c7a8fc99 11.0 landed
-
Lock relation used to generate fresh data for RMV.
- de0bea8d4d81 9.3.25 landed
-
Fix ALTER COLUMN TYPE to not open a relation without any lock.
- db01fc97ad80 10.6 landed
- 26318c4b858a 9.4.20 landed
- 0360c539f2a2 9.6.11 landed
- 00d00b5b0d12 9.3.25 landed
- 0031e9d6ab80 9.5.15 landed
- e27453bd839f 12.0 landed
- 4c985549fe82 11.0 landed