Re: Improve behavior of concurrent ANALYZE/VACUUM
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: Postgres hackers <pgsql-hackers@postgresql.org>, "horiguchi.kyotaro@lab.ntt.co.jp" <horiguchi.kyotaro@lab.ntt.co.jp>
Date: 2018-08-23T05:08:13Z
Lists: pgsql-hackers
Attachments
- vacuum_permission_checks_v2.patch (text/x-diff) patch v2
On Wed, Aug 22, 2018 at 03:49:16PM +0000, Bossart, Nathan wrote: > I think so, since this is the only ownership checks we do on > individual partitions. Another simple way to test this would be to > create a partitioned table with a different owner than the partitions > and to run VACUUM as the partitioned table owner. In this case, we > would still rely on the checks in vacuum_rel() and analyze_rel(). IMO > this is a reason to avoid skipping gathering the individual partitions > based upon the ownership of the partitioned table. It's true that > this wouldn't fix the locking issue for partitions, but the > aforementioned edge case is still present with 0002 anyway. Plus, it > would add a bit more consistency to partition handling in VACUUM. Normal regression tests are less costly than isolation tests, so let's use them as possible. What you attached is covering only a portion of all the scenarios though, as it is as well interesting to see what happens if another user owns only the partitioned table, only one partition, and the partitioned as well as at least one partition. I have extended your patch as attached. It applies on top of HEAD. Once applied with the other patch one can easily stop the difference in behavior, and this stresses the ownership checks in vacuum_rel() and analyze_rel() as well. Perhaps we could begin by that? > We should probably return false here. Oh, my compiler complained here as well. Fixed it on my branch. -- Michael
Commits
-
Improve VACUUM and ANALYZE by avoiding early lock queue
- a556549d7e6d 12.0 landed
-
Add more tests for VACUUM skips with partitioned tables
- a569eea6998a 12.0 landed
-
Add regression tests for VACUUM and ANALYZE with relation skips
- 98abc738027e 12.0 landed