pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_upgrade: Convert old visibility map format to new format.
4+ messages / 4 participants
[nested] [flat]

* pgsql: pg_upgrade: Convert old visibility map format to new format.
@ 2016-03-11 17:36 Robert Haas <rhaas@postgresql.org>
  2016-04-27 00:45 ` Re: pgsql: pg_upgrade: Convert old visibility map format to new format. Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Robert Haas @ 2016-03-11 17:36 UTC (permalink / raw)
  To: pgsql-committers

pg_upgrade: Convert old visibility map format to new format.

Commit a892234f830e832110f63fc0a2afce2fb21d1584 added a second bit per
page to the visibility map, but pg_upgrade has been unaware of it up
until now.  Therefore, a pg_upgrade from an earlier major release of
PostgreSQL to any commit preceding this one and following the one
mentioned above would result in invalid visibility map contents on the
new cluster, very possibly leading to data corruption.  This plugs
that hole.

Masahiko Sawada, reviewed by Jeff Janes, Bruce Momjian, Simon Riggs,
Michael Paquier, Andres Freund, me, and others.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7087166a88fe0c04fc6636d0d6d6bea1737fc1fb

Modified Files
--------------
src/bin/pg_upgrade/file.c        | 154 +++++++++++++++++++++++++++++++++++++++
src/bin/pg_upgrade/pg_upgrade.h  |   6 ++
src/bin/pg_upgrade/relfilenode.c |  48 +++++++++---
3 files changed, 197 insertions(+), 11 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: pg_upgrade: Convert old visibility map format to new format.
  2016-03-11 17:36 pgsql: pg_upgrade: Convert old visibility map format to new format. Robert Haas <rhaas@postgresql.org>
@ 2016-04-27 00:45 ` Bruce Momjian <bruce@momjian.us>
  2016-04-27 01:00   ` Re: [COMMITTERS] pgsql: pg_upgrade: Convert old visibility map format to new format. Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Bruce Momjian @ 2016-04-27 00:45 UTC (permalink / raw)
  To: Robert Haas <rhaas@postgresql.org>; +Cc: pgsql-committers

On Fri, Mar 11, 2016 at 05:36:34PM +0000, Robert Haas wrote:
> pg_upgrade: Convert old visibility map format to new format.
> 
> Commit a892234f830e832110f63fc0a2afce2fb21d1584 added a second bit per
> page to the visibility map, but pg_upgrade has been unaware of it up
> until now.  Therefore, a pg_upgrade from an earlier major release of
> PostgreSQL to any commit preceding this one and following the one
> mentioned above would result in invalid visibility map contents on the
> new cluster, very possibly leading to data corruption.  This plugs
> that hole.
> 
> Masahiko Sawada, reviewed by Jeff Janes, Bruce Momjian, Simon Riggs,
> Michael Paquier, Andres Freund, me, and others.

I have tested the current git trees of all supported versions of
Postgres in all possible pg_upgrade combinations and they all worked
perfectly.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+                     Ancient Roman grave inscription +


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [COMMITTERS] pgsql: pg_upgrade: Convert old visibility map format to new format.
  2016-03-11 17:36 pgsql: pg_upgrade: Convert old visibility map format to new format. Robert Haas <rhaas@postgresql.org>
  2016-04-27 00:45 ` Re: pgsql: pg_upgrade: Convert old visibility map format to new format. Bruce Momjian <bruce@momjian.us>
@ 2016-04-27 01:00   ` Robert Haas <robertmhaas@gmail.com>
  2016-04-27 01:11     ` Re: Re: [COMMITTERS] pgsql: pg_upgrade: Convert old visibility map format to new format. Masahiko Sawada <sawada.mshk@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Robert Haas @ 2016-04-27 01:00 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>

On Tue, Apr 26, 2016 at 8:45 PM, Bruce Momjian <bruce@momjian.us> wrote:
> On Fri, Mar 11, 2016 at 05:36:34PM +0000, Robert Haas wrote:
>> pg_upgrade: Convert old visibility map format to new format.
>>
>> Commit a892234f830e832110f63fc0a2afce2fb21d1584 added a second bit per
>> page to the visibility map, but pg_upgrade has been unaware of it up
>> until now.  Therefore, a pg_upgrade from an earlier major release of
>> PostgreSQL to any commit preceding this one and following the one
>> mentioned above would result in invalid visibility map contents on the
>> new cluster, very possibly leading to data corruption.  This plugs
>> that hole.
>>
>> Masahiko Sawada, reviewed by Jeff Janes, Bruce Momjian, Simon Riggs,
>> Michael Paquier, Andres Freund, me, and others.
>
> I have tested the current git trees of all supported versions of
> Postgres in all possible pg_upgrade combinations and they all worked
> perfectly.

That's good!

All the commits related to this topic could use extra-careful review
and testing.  If Masahiko-san got anything wrong, or I did, this could
eat people's data in ways that are very hard to track down.

So I hope we were both extra-smart while working on this patch.

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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Re: [COMMITTERS] pgsql: pg_upgrade: Convert old visibility map format to new format.
  2016-03-11 17:36 pgsql: pg_upgrade: Convert old visibility map format to new format. Robert Haas <rhaas@postgresql.org>
  2016-04-27 00:45 ` Re: pgsql: pg_upgrade: Convert old visibility map format to new format. Bruce Momjian <bruce@momjian.us>
  2016-04-27 01:00   ` Re: [COMMITTERS] pgsql: pg_upgrade: Convert old visibility map format to new format. Robert Haas <robertmhaas@gmail.com>
@ 2016-04-27 01:11     ` Masahiko Sawada <sawada.mshk@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Masahiko Sawada @ 2016-04-27 01:11 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>

On Wed, Apr 27, 2016 at 10:00 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, Apr 26, 2016 at 8:45 PM, Bruce Momjian <bruce@momjian.us> wrote:
>> On Fri, Mar 11, 2016 at 05:36:34PM +0000, Robert Haas wrote:
>>> pg_upgrade: Convert old visibility map format to new format.
>>>
>>> Commit a892234f830e832110f63fc0a2afce2fb21d1584 added a second bit per
>>> page to the visibility map, but pg_upgrade has been unaware of it up
>>> until now.  Therefore, a pg_upgrade from an earlier major release of
>>> PostgreSQL to any commit preceding this one and following the one
>>> mentioned above would result in invalid visibility map contents on the
>>> new cluster, very possibly leading to data corruption.  This plugs
>>> that hole.
>>>
>>> Masahiko Sawada, reviewed by Jeff Janes, Bruce Momjian, Simon Riggs,
>>> Michael Paquier, Andres Freund, me, and others.
>>
>> I have tested the current git trees of all supported versions of
>> Postgres in all possible pg_upgrade combinations and they all worked
>> perfectly.

Thank you for testing!
Good news for me.

>
> That's good!
>
> All the commits related to this topic could use extra-careful review
> and testing.  If Masahiko-san got anything wrong, or I did, this could
> eat people's data in ways that are very hard to track down.
>

Yeah, we should test this feature in various ways, and I'm going to do so.

Regards,

--
Masahiko Sawada


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-04-27 01:11 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-11 17:36 pgsql: pg_upgrade: Convert old visibility map format to new format. Robert Haas <rhaas@postgresql.org>
2016-04-27 00:45 ` Bruce Momjian <bruce@momjian.us>
2016-04-27 01:00   ` Robert Haas <robertmhaas@gmail.com>
2016-04-27 01:11     ` Masahiko Sawada <sawada.mshk@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox