summaryrefslogtreecommitdiff
path: root/src/include/access/xlogreader.h
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2019-07-15 17:03:46 +1200
committerThomas Munro <tmunro@postgresql.org>2019-07-15 17:04:29 +1200
commit67b9b3ca328392f9afc4e66fe03564f5fc87feff (patch)
tree4297fdc8925b8d36fc413e03cbce0ac79f5ca094 /src/include/access/xlogreader.h
parent5925e5549890416bcf588334d9d0bc99f8ad6c7f (diff)
Provide XLogRecGetFullXid().
In order to be able to work with FullTransactionId values during replay without increasing the size of the WAL, infer the epoch. In general we can't do that safely, but during replay we can because we know that nextFullXid can't advance concurrently. Prevent frontend code from seeing this new function, due to the above restriction. Perhaps in future it will be possible to extract the value entirely from independent WAL records, and then this restriction can be lifted. Author: Thomas Munro, based on earlier code from Andres Freund Discussion: https://postgr.es/m/CA%2BhUKG%2BmLmuDjMi6o1dxkKvGRL56Y2Rz%2BiXAcrZV03G9ZuFQ8Q%40mail.gmail.com
Diffstat (limited to 'src/include/access/xlogreader.h')
-rw-r--r--src/include/access/xlogreader.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/access/xlogreader.h b/src/include/access/xlogreader.h
index 04228e2a871..a12c94cba67 100644
--- a/src/include/access/xlogreader.h
+++ b/src/include/access/xlogreader.h
@@ -25,6 +25,10 @@
#ifndef XLOGREADER_H
#define XLOGREADER_H
+#ifndef FRONTEND
+#include "access/transam.h"
+#endif
+
#include "access/xlogrecord.h"
typedef struct XLogReaderState XLogReaderState;
@@ -240,6 +244,10 @@ extern bool DecodeXLogRecord(XLogReaderState *state, XLogRecord *record,
#define XLogRecBlockImageApply(decoder, block_id) \
((decoder)->blocks[block_id].apply_image)
+#ifndef FRONTEND
+extern FullTransactionId XLogRecGetFullXid(XLogReaderState *record);
+#endif
+
extern bool RestoreBlockImage(XLogReaderState *recoder, uint8 block_id, char *dst);
extern char *XLogRecGetBlockData(XLogReaderState *record, uint8 block_id, Size *len);
extern bool XLogRecGetBlockTag(XLogReaderState *record, uint8 block_id,