diff options
| author | Alvaro Herrera | 2016-03-30 21:56:13 +0000 |
|---|---|---|
| committer | Alvaro Herrera | 2016-03-30 21:56:13 +0000 |
| commit | 3b02ea4f0780ccce7dc116010201dad7ee50a401 (patch) | |
| tree | 454f6e13e1d029acdb6cc79e9df65963273c67a8 /src/include/access | |
| 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')
| -rw-r--r-- | src/include/access/xlogreader.h | 17 | ||||
| -rw-r--r-- | src/include/access/xlogutils.h | 6 |
2 files changed, 17 insertions, 6 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 */ diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h index 1b9abce9ad3..d027ea173b1 100644 --- a/src/include/access/xlogutils.h +++ b/src/include/access/xlogutils.h @@ -47,7 +47,9 @@ extern Buffer XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum, extern Relation CreateFakeRelcacheEntry(RelFileNode rnode); extern void FreeFakeRelcacheEntry(Relation fakerel); -extern int read_local_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr, - int reqLen, XLogRecPtr targetRecPtr, char *cur_page, TimeLineID *pageTLI); +extern int read_local_xlog_page(XLogReaderState *state, + XLogRecPtr targetPagePtr, int reqLen, + XLogRecPtr targetRecPtr, char *cur_page, + TimeLineID *pageTLI); #endif |
