Re: Relations being opened without any lock whatever - Mailing list pgsql-hackers

From Amit Langote
Subject Re: Relations being opened without any lock whatever
Date
Msg-id eda81aff-89c2-aed4-2997-548d1b4615e5@lab.ntt.co.jp
Whole thread Raw
In response to Relations being opened without any lock whatever  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Relations being opened without any lock whatever  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] SERIALIZABLE with parallel query
Next
From: Amit Langote
Date:
Subject: Re: partition tree inspection functions