diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2016-03-30 18:56:13 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2016-03-30 18:56:13 -0300 |
commit | 3b02ea4f0780ccce7dc116010201dad7ee50a401 (patch) | |
tree | 454f6e13e1d029acdb6cc79e9df65963273c67a8 /src/include/access/xlogreader.h | |
parent | 50861cd683e86d5ef2dc1cb669fb503225e4eb98 (diff) |
XLogReader general code cleanup
Some minor tweaks and comment additions, for cleanliness sake and to
avoid having the upcoming timeline-following patch be polluted with
unrelated cleanup.
Extracted from a larger patch by Craig Ringer, reviewed by Andres
Freund, with some additions by myself.
Diffstat (limited to 'src/include/access/xlogreader.h')
-rw-r--r-- | src/include/access/xlogreader.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h index 7553cc44cb3..deaa7f5128b 100644 --- a/src/include/access/xlogreader.h +++ b/src/include/access/xlogreader.h @@ -139,16 +139,22 @@ struct XLogReaderState * ---------------------------------------- */ - /* Buffer for currently read page (XLOG_BLCKSZ bytes) */ + /* + * Buffer for currently read page (XLOG_BLCKSZ bytes, valid up to at least + * readLen bytes) + */ char *readBuf; + uint32 readLen; - /* last read segment, segment offset, read length, TLI */ + /* last read segment, segment offset, TLI for data currently in readBuf */ XLogSegNo readSegNo; uint32 readOff; - uint32 readLen; TimeLineID readPageTLI; - /* beginning of last page read, and its TLI */ + /* + * beginning of prior page read, and its TLI. Doesn't necessarily + * correspond to what's in readBuf; used for timeline sanity checks. + */ XLogRecPtr latestPagePtr; TimeLineID latestPageTLI; @@ -174,6 +180,9 @@ extern void XLogReaderFree(XLogReaderState *state); extern struct XLogRecord *XLogReadRecord(XLogReaderState *state, XLogRecPtr recptr, char **errormsg); +/* Invalidate read state */ +extern void XLogReaderInvalReadState(XLogReaderState *state); + #ifdef FRONTEND extern XLogRecPtr XLogFindNextRecord(XLogReaderState *state, XLogRecPtr RecPtr); #endif /* FRONTEND */ |