Re: [HACKERS] pg_upgrade to clusters with a different WAL segment size
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-11-13T21:11:42Z
Lists: pgsql-hackers
Hi, On 2017-11-10 15:46:11 +0000, Bossart, Nathan wrote: > The thread for the recent change to allow setting the WAL segment size at > initdb time [0] included a bit of discussion regarding pg_upgrade [1], > where it was suggested that relaxing an error check (presumably in > check_control_data()) might be enough to upgrade servers to a different WAL > segment size. > > We've had success with our initial testing of upgrades to larger WAL > segment sizes, including post-upgrade pgbench runs. Beyond adjusting > check_control_data(), it looks like the 'pg_resetwal -l' call in > copy_xact_xlog_xid() may need to be adjusted to ensure that the WAL > starting address is set to a valid value. > > Allowing changes to the WAL segment size during pg_upgrade seems like a > nice way to avoid needing a dump and load, so I would like to propose > adding support for this. I'd be happy to submit patches for this in the > next commitfest. Hm. I'm not really on-board with doing this in pg_upgrade. A more logical place seems to be pg_resetwal or something - there's no need to force a pg_upgrade cycle (which is pretty expensive on clusters with a significant number of objects) for somebody that wants to change the segment size of a cluster without changing the major version. pg_resetwal or a new tool seems like a more appropriate places for this. Greetings, Andres Freund
Commits
-
pg_resetwal: Prevent division-by-zero errors
- f1a074b146c9 11.0 landed
-
Make WAL segment size configurable at initdb time.
- fc49e24fa69a 11.0 cited