mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
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.
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user