Re: Improve behavior of concurrent ANALYZE/VACUUM - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Improve behavior of concurrent ANALYZE/VACUUM
Date
Msg-id 20180823050813.GB1158@paquier.xyz
Whole thread Raw
In response to Re: Improve behavior of concurrent ANALYZE/VACUUM  ("Bossart, Nathan" <bossartn@amazon.com>)
Responses Re: Improve behavior of concurrent ANALYZE/VACUUM
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Windows vs C99 (was Re: C99 compliance for src/port/snprintf.c)
Next
From: Michael Paquier
Date:
Subject: Re: plan_cache_mode and postgresql.conf.sample