Re: [BUGS] Breakage with VACUUM ANALYSE + partitions

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions
Date: 2016-04-25 12:55:54
Message-ID: CA+TgmobW=RrpTHo6ghH33bvhJL78zSudf_3c1dub48sSpswx5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Fri, Apr 22, 2016 at 5:26 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Apr 22, 2016 at 1:07 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>> The attached patch basically adds the segment size checks to
>> _mdfd_getseg(), and doesn't perform extension, even in recovery, if
>> EXTENSION_REALLY_RETURN_NULL is passed.
>>
>> This fixes the issue for me, both in the originally reported variant,
>> and in some more rudely setup version (i.e. rm'ing files).
>
> I think this looks broadly reasonable. Some specific comments:
>
> + /*
> + * Normally we will create new segments only if authorized by
> + * the caller (i.e., we are doing mdextend()). But when doing
> + * WAL recovery, create segments anyway; this allows cases
> + * such as replaying WAL data that has a write into a
> + * high-numbered segment of a relation that was later deleted.
> + * We want to go ahead and create the segments so we can
> + * finish out the replay.
>
> Add something like: "However, if the caller has specified
> EXTENSION_REALLY_RETURN_NULL, then extension is not desired even in
> recovery; we won't reach this point in that case."
>
> + errno = ENOENT; /* some callers check errno, yuck */
>
> I think a considerably more detailed comment would be warranted.
>
> + else
> + {
> + ereport(ERROR,
> + (errcode_for_file_access(),
> + errmsg("could not open file \"%s\"
> (target block %u): previous segment is only %u blocks",
> + _mdfd_segpath(reln, forknum, nextsegno),
> + blkno, nblocks)));
> + }
>
> The else and its ensuing level of indentation are unnecessary.

Andres, this issue has now been open for more than a month, which is
frankly kind of ridiculous given the schedule we're trying to hit for
beta. Do you think it's possible to commit something RSN without
compromising the quality of PostgreSQL 9.6?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thom Brown 2016-04-25 13:12:39 Re: [BUGS] Breakage with VACUUM ANALYSE + partitions
Previous Message bgrundmann 2016-04-25 12:03:28 BUG #14111: After minor upgrade (9.2.6 -> 9.2.16): ERROR: failed to build any 2-way joins

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2016-04-25 13:12:39 Re: [BUGS] Breakage with VACUUM ANALYSE + partitions
Previous Message Craig Ringer 2016-04-25 12:44:23 Re: Confusing comment in pg_upgrade in regards to VACUUM FREEZE