Changing wal segment size on existing database cluster - Mailing list pgsql-general

From James Lucas
Subject Changing wal segment size on existing database cluster
Date
Msg-id CAAFmbbPKkNYwf=kKBR4H3qGW4OJSJFcqkLEE5K2dLCLKZANafA@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi all,

I have a high traffic database, where I'm interested in changing the
wal segment size to a larger value.  I haven't found much
documentation about how to change the segment size of an existing
database.  The obvious, safe solution would be to create a new
database cluster and dump/reload.  This isn't ideal for a large
database though.

Pg_resetwal has a wal-segsize option, but the documentation doesn't
provide much guidance beyond that it's there.  The pg_resetwal manpage
also has big warnings all over it about how the tool can corrupt your
database cluster.  So my question is, is it safe to change wal-segsize
using pg_resetwal following a clean shutdown of the database?  Just
reading the docs, it seems like the corruption issues are more around
non-graceful shutdowns or crash scenarios, with incomplete
transactions being wiped out by a wal reset.  If the database was
shutdown cleanly this doesn't *seem* like it would be an issue.

Has anyone had experience doing this?  I assume this would break any
physical replication standbys.  Any other gotchas I should be looking
out for?

I've tested on a trivial (empty) database cluster, and everything
seems okay.  But corruption might be difficult to detect until it's
too late.

Thanks,
James Lucas



pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: Can't remove default permissions entry
Next
From: Adrian Klaver
Date:
Subject: Re: Can't remove default permissions entry