aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/xlogutils.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-11-25 15:04:54 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-11-25 15:04:54 -0300
commit0dc8ead46363fec6f621a12c7e1f889ba73b55a9 (patch)
treeae1eb1d20970c69eeac44e57a44f4315b5223ea0 /src/include/access/xlogutils.h
parent5883f5fe27d7b52c812dd0f8cbda67373a14c451 (diff)
downloadpostgresql-0dc8ead46363fec6f621a12c7e1f889ba73b55a9.tar.gz
postgresql-0dc8ead46363fec6f621a12c7e1f889ba73b55a9.zip
Refactor WAL file-reading code into WALRead()
XLogReader, walsender and pg_waldump all had their own routines to read data from WAL files to memory, with slightly different approaches according to the particular conditions of each environment. There's a lot of commonality, so we can refactor that into a single routine WALRead in XLogReader, and move the differences to a separate (simpler) callback that just opens the next WAL-segment. This results in a clearer (ahem) code flow. The error reporting needs are covered by filling in a new error-info struct, WALReadError, and it's the caller's responsibility to act on it. The backend has WALReadRaiseError() to do so. We no longer ever need to seek in this interface; switch to using pg_pread(). Author: Antonin Houska, with contributions from Álvaro Herrera Reviewed-by: Michaël Paquier, Kyotaro Horiguchi Discussion: https://postgr.es/m/14984.1554998742@spoje.net
Diffstat (limited to 'src/include/access/xlogutils.h')
-rw-r--r--src/include/access/xlogutils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h
index 2df98e45b20..0572b241927 100644
--- a/src/include/access/xlogutils.h
+++ b/src/include/access/xlogutils.h
@@ -54,4 +54,6 @@ extern int read_local_xlog_page(XLogReaderState *state,
extern void XLogReadDetermineTimeline(XLogReaderState *state,
XLogRecPtr wantPage, uint32 wantLength);
+extern void WALReadRaiseError(WALReadError *errinfo);
+
#endif