Re: [HACKERS] pg_upgrade to clusters with a different WAL segment size
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: "Bossart, Nathan" <bossartn@amazon.com>,
Robert Haas <robertmhaas@gmail.com>,
Jeremy Schneider <schneider@ardentperf.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier
<michael.paquier@gmail.com>, Andres Freund <andres@anarazel.de>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2018-03-03T18:22:01Z
Lists: pgsql-hackers
On 2/7/18 13:34, Bossart, Nathan wrote: > Here is a patch to allow users to change the WAL segment size of a cluster with > pg_resetwal. Like the '--wal-segize' option in initdb, the new '-s' option > accepts segment sizes in megabytes. Or how about we call the new option, um, --wal-segsize? > The first is a division-by-zero error caused when the control data must be > guessed. If the control data is damaged, WalSegSz will not be set to the > guessed WAL segment size, resulting in an error during XLogFromFileName(). The > attached patch resolves this issue by ensuring WalSegSz is set to a valid value > after either reading or guessing the control values. I noticed this issue in pg_controldata too. Maybe that should be combined in a separate patch. > Note that some segment size changes will cause old WAL file names to be reused. > The new documentation for '-s' contains a note warning of this side effect. I > considered a couple of strategies to prevent this, but I chose not to include > any in the patch based on previous correspondence in this thread. If file name > overlap is an issue, users can already use the '-l' option to set a safe WAL > starting address. The patch "Configurable file mode mask" contains the beginning of a test suite for pg_resetwal. It would be great if we could get a test case for this new functionality implemented. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
pg_resetwal: Prevent division-by-zero errors
- f1a074b146c9 11.0 landed
-
Make WAL segment size configurable at initdb time.
- fc49e24fa69a 11.0 cited