Re: pg_control is missing a field for LOBLKSIZE

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_control is missing a field for LOBLKSIZE
Date: 2014-06-18 19:50:14
Message-ID: CA+TgmoaP=zWnenQ81r=9XH4nCc1wWuLT3wSACDv86OhQuNOLyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 18, 2014 at 3:28 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Wed, Jun 18, 2014 at 2:55 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> The net behavior would be the same, but I thought it might be easier to
>>> code by thinking of it this way. Or maybe it wouldn't --- it's just a
>>> suggestion.
>
>> Well, the difference is that if we just don't check it, there can
>> never be an error. Basically, it's the user's job to DTRT. If we
>> check it against some semi-arbitrary value, we'll catch the case where
>> the old cluster was modified with a custom setting and the new one was
>> not - but couldn't we also get false positives under obscure
>> circumstances?
>
> Huh? What we'd be checking is the LOBLKSIZE compiled into pg_upgrade
> versus that stored into pg_control by the new postmaster. If those
> are different, then pg_upgrade didn't come from the same build as the
> new postmaster, which is already a pretty hazardous situation (especially
> if the user is fooling with low-level stuff like this).

OK, I agree that checking that wouldn't hurt anything.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2014-06-18 19:51:52 Re: Is analyze_new_cluster.sh still useful?
Previous Message Andres Freund 2014-06-18 19:32:43 Re: pgsql: Reduce the number of semaphores used under --disable-spinlocks.