Re: [HACKERS] Shaky coding for vacuuming partitioned relations - Mailing list pgsql-hackers

From Bossart, Nathan
Subject Re: [HACKERS] Shaky coding for vacuuming partitioned relations
Date
Msg-id 3DD93508-8419-4006-B7C9-D3E85B5AC2EA@amazon.com
Whole thread Raw
In response to Re: [HACKERS] Shaky coding for vacuuming partitioned relations  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Shaky coding for vacuuming partitioned relations
List pgsql-hackers
On 9/24/17, 10:12 PM, "Michael Paquier" <michael.paquier@gmail.com> wrote:
> Attached is a proposal of patch.

The patch seems reasonable to me, and I haven't encountered any issues in
my tests, even after applying the vacuum-multiple-relations patch on top
of it.

+         * Take a lock here for the relation lookup. If ANALYZE or VACUUM spawn
+         * multiple transactions, the lock taken here will be gone once the
+         * current transaction running commits, which could cause the relation
+         * to be gone, or the RangeVar might not refer to the OID looked up here.

I think this could be slightly misleading.  Perhaps it would be more
accurate to say that the lock will be gone any time vacuum() creates a new
transaction (either in vacuum_rel() or when use_own_xacts is true).

Nathan


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] Built-in plugin for logical decoding output
Next
From: Alvaro Hernandez
Date:
Subject: Re: [HACKERS] Built-in plugin for logical decoding output