Re: BUG #14941: Vacuum crashes
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: "Bossart, Nathan" <bossartn@amazon.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Lyes Ameddah <lyes.amd@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "pgsql-bugs@postgresql.org" <pgsql-bugs@postgresql.org>
Date: 2018-04-03T05:11:46Z
Lists: pgsql-bugs, pgsql-hackers
On Fri, Mar 30, 2018 at 05:19:46PM -0700, Andres Freund wrote: > On 2018-03-30 18:39:01 +0000, Bossart, Nathan wrote: >> I think the most straightforward approach for fixing this is to add >> skip-locked functionality in find_all_inheritors(), >> find_inheritance_children(), and vac_open_indexes(), but I am curious >> what others think. For vac_open_indexes() it may make the most sense to introduce a new try_open_index which wraps on top of try_relation_open with checks on the opened relation's relkind. > I'm actually wondering if we shouldn't just ignore this problem. While > the other cases VACUUM (SKIP LOCKED) are intended to solve seem common, > these seem less so. But it'd be a bit weird, too.. Wouldn't that cause deadlocks if one session has VACUUM (SKIP_LOCKED) and another session running vacuum or autovacuum if simply ignored? That looks dangerous to me than simply skipping a lock that cannot be taken. -- Michael
Commits
-
Add option SKIP_LOCKED to VACUUM and ANALYZE
- 803b1301e8c9 12.0 landed
-
Rename VACOPT_NOWAIT to VACOPT_SKIP_LOCKED
- edc6b41bd4a8 12.0 landed
-
Add parenthesized options syntax for ANALYZE.
- 854dd8cff523 11.0 landed
-
Don't allow VACUUM VERBOSE ANALYZE VERBOSE.
- 921059bd66c7 11.0 landed
-
Fix inadequate locking during get_rel_oids().
- 19de0ab23ccb 11.0 cited
-
Avoid having autovacuum workers wait for relation locks.
- 32896c40ca76 9.1.0 cited