]> granicus.if.org Git - postgresql/commit
Make WAL segment size configurable at initdb time.
authorAndres Freund <andres@anarazel.de>
Wed, 20 Sep 2017 05:03:48 +0000 (22:03 -0700)
committerAndres Freund <andres@anarazel.de>
Wed, 20 Sep 2017 05:03:48 +0000 (22:03 -0700)
commitfc49e24fa69a15efacd5b8958115ed9c43c48f9a
treea1399d0d533c1cfa864e545a17000e7b6df6f43d
parent5ada1fcd0c30be1b0b793a802cf6da386a6c1925
Make WAL segment size configurable at initdb time.

For performance reasons a larger segment size than the default 16MB
can be useful. A larger segment size has two main benefits: Firstly,
in setups using archiving, it makes it easier to write scripts that
can keep up with higher amounts of WAL, secondly, the WAL has to be
written and synced to disk less frequently.

But at the same time large segment size are disadvantageous for
smaller databases. So far the segment size had to be configured at
compile time, often making it unrealistic to choose one fitting to a
particularly load. Therefore change it to a initdb time setting.

This includes a breaking changes to the xlogreader.h API, which now
requires the current segment size to be configured.  For that and
similar reasons a number of binaries had to be taught how to recognize
the current segment size.

Author: Beena Emerson, editorialized by Andres Freund
Reviewed-By: Andres Freund, David Steele, Kuntal Ghosh, Michael
    Paquier, Peter Eisentraut, Robert Hass, Tushar Ahuja
Discussion: https://postgr.es/m/CAOG9ApEAcQ--1ieKbhFzXSQPw_YLmepaa4hNdnY5+ZULpt81Mw@mail.gmail.com
46 files changed:
configure
configure.in
contrib/pg_standby/pg_standby.c
doc/src/sgml/backup.sgml
doc/src/sgml/installation.sgml
doc/src/sgml/ref/initdb.sgml
doc/src/sgml/wal.sgml
src/backend/access/transam/twophase.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogarchive.c
src/backend/access/transam/xlogfuncs.c
src/backend/access/transam/xlogreader.c
src/backend/access/transam/xlogutils.c
src/backend/bootstrap/bootstrap.c
src/backend/postmaster/checkpointer.c
src/backend/replication/basebackup.c
src/backend/replication/logical/logical.c
src/backend/replication/logical/reorderbuffer.c
src/backend/replication/slot.c
src/backend/replication/walreceiver.c
src/backend/replication/walreceiverfuncs.c
src/backend/replication/walsender.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/pg_controldata.c
src/backend/utils/misc/postgresql.conf.sample
src/bin/initdb/initdb.c
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_receivewal.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_basebackup/streamutil.c
src/bin/pg_basebackup/streamutil.h
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_resetwal/pg_resetwal.c
src/bin/pg_rewind/parsexlog.c
src/bin/pg_rewind/pg_rewind.c
src/bin/pg_rewind/pg_rewind.h
src/bin/pg_test_fsync/pg_test_fsync.c
src/bin/pg_upgrade/test.sh
src/bin/pg_waldump/pg_waldump.c
src/include/access/xlog.h
src/include/access/xlog_internal.h
src/include/access/xlogreader.h
src/include/catalog/pg_control.h
src/include/pg_config.h.in
src/include/pg_config_manual.h
src/tools/msvc/Solution.pm