Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages)

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2019-01-21T21:19:54Z
Lists: pgsql-hackers

Attachments

On Fri, Jan 18, 2019 at 4:06 PM Peter Geoghegan <pg@bowt.ie> wrote:
> > * Objects-to-drop output from DROP ROLE is still unstable.  I suppose
> > this would be fixed by also doing sorting in that code path, but
> > I've not looked into it.
>
> The nbtree patch is not dependent on doing better here, since the
> order here is merely unstable, without leading to incorrect diagnostic
> messages. I can just change the regress output mechanically. That
> said, I cannot be sure that the instability won't become more of an
> annoyance with heap TID being treated as a tie-breaker attribute
> within nbtree. It's probably fine to reserve the option to do better
> here, and do so if and when it becomes clear that it matters. I defer
> to you.

Good news: Testing my patch (with the hacky pg_depend tie-breaker
commit removed) on top of your recent commit f1ad067f confirms the
only "real" remaining problem is with two tests that relate to
partitioning (the multiple DEPENDENCY_INTERNAL_AUTO entry issue). It
seems likely that objects-to-drop output from DROP ROLE can remain
"unstable" without bothering anybody -- I've run "make -Otarget -j10
-s check-world" with the same source tree multiple times, and have yet
to see a test failure. In practice *all* of the instability that's of
practical concern (that could cause buildfarm failures) related to the
two pg_depend indexes. It very much looks that way, at least -- only
the buildfarm can confirm this.

I attach a patch that shows how I'll adjust the harmless
objects-to-drop output from DROP ROLE to make relevant tests pass --
the scope of changes is very limited, and the changes are
harmless/mechanical. Separately, I attach the patch that I'd have to
use to paper over the partitioning/DEPENDENCY_INTERNAL_AUTO issue (a
patch that makes the regression tests actively ignore visible
manifestations of the DEPENDENCY_INTERNAL_AUTO bug). As I said, this
confirms that there are only two "real" remaining tests that fail.

Thanks
-- 
Peter Geoghegan

Commits

  1. Redesign the partition dependency mechanism.

  2. Fix trigger drop procedure

  3. Sort the dependent objects before recursing in findDependentObjects().

  4. Avoid sometimes printing both tables and their columns in DROP CASCADE.