summaryrefslogtreecommitdiff
path: root/src/include/access/xlogreader.h
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-09-19 22:03:48 -0700
committerAndres Freund <andres@anarazel.de>2017-09-19 22:03:48 -0700
commitfc49e24fa69a15efacd5b8958115ed9c43c48f9a (patch)
treea1399d0d533c1cfa864e545a17000e7b6df6f43d /src/include/access/xlogreader.h
parent5ada1fcd0c30be1b0b793a802cf6da386a6c1925 (diff)
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
Diffstat (limited to 'src/include/access/xlogreader.h')
-rw-r--r--src/include/access/xlogreader.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index 76715983349..3a9ebd43543 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -74,6 +74,11 @@ struct XLogReaderState
*/
/*
+ * Segment size of the to-be-parsed data (mandatory).
+ */
+ int wal_segment_size;
+
+ /*
* Data input callback (mandatory).
*
* This callback shall read at least reqLen valid bytes of the xlog page
@@ -189,7 +194,8 @@ struct XLogReaderState
};
/* Get a new XLogReader */
-extern XLogReaderState *XLogReaderAllocate(XLogPageReadCB pagereadfunc,
+extern XLogReaderState *XLogReaderAllocate(int wal_segment_size,
+ XLogPageReadCB pagereadfunc,
void *private_data);
/* Free an XLogReader */