Re: Parallel index creation does not properly cleanup after error
David Rowley <david.rowley@2ndquadrant.com>
From: David Rowley <david.rowley@2ndquadrant.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Robert Haas <robertmhaas@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-03-14T12:16:47Z
Lists: pgsql-hackers
On 12 March 2018 at 08:41, Peter Geoghegan <pg@bowt.ie> wrote: > On Sun, Mar 11, 2018 at 3:22 AM, David Rowley >> A perhaps simple fix would be just to have ResetReindexPending() only >> reset the list to NIL again and not try to raise any error. > > I noticed a very similar bug in ResetReindexProcessing() just before > parallel CREATE INDEX was committed. The fix there was simply not > throwing a "can't happen" error. I agree that the same fix should be > used here. It's not worth enforcing !IsInParallelMode() in the reset > functions; just enforcing !IsInParallelMode() in the set functions is > sufficient. Attached patch does this. Thanks for putting the patch together. Although in regards to your proposed commit message in the patch, I'd disagree with me having just reported it. I also investigated it and suggested a fix, which happens to be exactly the fix you've used in the patch. I've added this to the open items list for PG11. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Fix possible failure in parallel index build.
- 47cb9ca49a61 11.0 landed