117 #define XL_ROUTINE(...) &(XLogReaderRoutine){__VA_ARGS__}
327 return (
state->decode_queue_head != NULL) ||
state->errormsg_deferred;
408 #define XLogRecGetTotalLen(decoder) ((decoder)->record->header.xl_tot_len)
409 #define XLogRecGetPrev(decoder) ((decoder)->record->header.xl_prev)
410 #define XLogRecGetInfo(decoder) ((decoder)->record->header.xl_info)
411 #define XLogRecGetRmid(decoder) ((decoder)->record->header.xl_rmid)
412 #define XLogRecGetXid(decoder) ((decoder)->record->header.xl_xid)
413 #define XLogRecGetOrigin(decoder) ((decoder)->record->record_origin)
414 #define XLogRecGetTopXid(decoder) ((decoder)->record->toplevel_xid)
415 #define XLogRecGetData(decoder) ((decoder)->record->main_data)
416 #define XLogRecGetDataLen(decoder) ((decoder)->record->main_data_len)
417 #define XLogRecHasAnyBlockRefs(decoder) ((decoder)->record->max_block_id >= 0)
418 #define XLogRecMaxBlockId(decoder) ((decoder)->record->max_block_id)
419 #define XLogRecGetBlock(decoder, i) (&(decoder)->record->blocks[(i)])
420 #define XLogRecHasBlockRef(decoder, block_id) \
421 (((decoder)->record->max_block_id >= (block_id)) && \
422 ((decoder)->record->blocks[block_id].in_use))
423 #define XLogRecHasBlockImage(decoder, block_id) \
424 ((decoder)->record->blocks[block_id].has_image)
425 #define XLogRecBlockImageApply(decoder, block_id) \
426 ((decoder)->record->blocks[block_id].apply_image)
427 #define XLogRecHasBlockData(decoder, block_id) \
428 ((decoder)->record->blocks[block_id].has_data)
#define FLEXIBLE_ARRAY_MEMBER
static pg_noinline void Size size
struct DecodedXLogRecord * next
TransactionId toplevel_xid
RepOriginId record_origin
DecodedBkpBlock blocks[FLEXIBLE_ARRAY_MEMBER]
WALSegmentCloseCB segment_close
WALSegmentOpenCB segment_open
XLogRecPtr missingContrecPtr
DecodedXLogRecord * record
size_t decode_buffer_size
DecodedXLogRecord * decode_queue_head
XLogRecPtr currTLIValidUntil
DecodedXLogRecord * decode_queue_tail
XLogReaderRoutine routine
char * decode_buffer_head
XLogRecPtr overwrittenRecPtr
char * decode_buffer_tail
bool XLogRecGetBlockTagExtended(XLogReaderState *record, uint8 block_id, RelFileLocator *rlocator, ForkNumber *forknum, BlockNumber *blknum, Buffer *prefetch_buffer)
void XLogReaderSetDecodeBuffer(XLogReaderState *state, void *buffer, size_t size)
static bool XLogReaderHasQueuedRecordOrError(XLogReaderState *state)
struct DecodedXLogRecord DecodedXLogRecord
bool WALRead(XLogReaderState *state, char *buf, XLogRecPtr startptr, Size count, TimeLineID tli, WALReadError *errinfo)
struct WALReadError WALReadError
void(* WALSegmentCloseCB)(XLogReaderState *xlogreader)
DecodedXLogRecord * XLogNextRecord(XLogReaderState *state, char **errormsg)
void XLogReaderResetError(XLogReaderState *state)
bool XLogReaderValidatePageHeader(XLogReaderState *state, XLogRecPtr recptr, char *phdr)
FullTransactionId XLogRecGetFullXid(XLogReaderState *record)
void XLogReaderFree(XLogReaderState *state)
void XLogRecGetBlockTag(XLogReaderState *record, uint8 block_id, RelFileLocator *rlocator, ForkNumber *forknum, BlockNumber *blknum)
DecodedXLogRecord * XLogReadAhead(XLogReaderState *state, bool nonblocking)
XLogReaderState * XLogReaderAllocate(int wal_segment_size, const char *waldir, XLogReaderRoutine *routine, void *private_data)
bool DecodeXLogRecord(XLogReaderState *state, DecodedXLogRecord *decoded, XLogRecord *record, XLogRecPtr lsn, char **errormsg)
struct WALOpenSegment WALOpenSegment
struct XLogRecord * XLogReadRecord(XLogReaderState *state, char **errormsg)
char * XLogRecGetBlockData(XLogReaderState *record, uint8 block_id, Size *len)
size_t DecodeXLogRecordRequiredSpace(size_t xl_tot_len)
XLogRecPtr XLogFindNextRecord(XLogReaderState *state, XLogRecPtr RecPtr)
void XLogBeginRead(XLogReaderState *state, XLogRecPtr RecPtr)
struct WALSegmentContext WALSegmentContext
bool RestoreBlockImage(XLogReaderState *record, uint8 block_id, char *page)
void(* WALSegmentOpenCB)(XLogReaderState *xlogreader, XLogSegNo nextSegNo, TimeLineID *tli_p)
int(* XLogPageReadCB)(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, int reqLen, XLogRecPtr targetRecPtr, char *readBuf)
struct XLogReaderRoutine XLogReaderRoutine
XLogRecPtr XLogReleasePreviousRecord(XLogReaderState *state)
static XLogReaderState * xlogreader