static void
AdvanceXLInsertBuffer(XLogRecPtr upto, TimeLineID tli, bool opportunistic)
{
- XLogCtlInsert *Insert = &XLogCtl->Insert;
int nextidx;
XLogRecPtr OldPageRqstPtr;
XLogwrtRqst WriteRqst;
/* NewPage->xlp_rem_len = 0; */ /* done by memset */
- /*
- * If online backup is not in progress, mark the header to indicate
- * that WAL records beginning in this page have removable backup
- * blocks. This allows the WAL archiver to know whether it is safe to
- * compress archived WAL data by transforming full-block records into
- * the non-full-block format. It is sufficient to record this at the
- * page level because we force a page switch (in fact a segment
- * switch) when starting a backup, so the flag will be off before any
- * records can be written during the backup. At the end of a backup,
- * the last page will be marked as all unsafe when perhaps only part
- * is unsafe, but at worst the archiver would miss the opportunity to
- * compress a few records.
- */
- if (Insert->runningBackups == 0)
- NewPage->xlp_info |= XLP_BKP_REMOVABLE;
-
/*
* If first page of an XLOG segment file, make it a long header.
*/
* pg_wal directory was not included in the base backup and the WAL
* archive was cleared too before starting the backup.
*
- * This also ensures that we have emitted a WAL page header that has
- * XLP_BKP_REMOVABLE off before we emit the checkpoint record.
- * Therefore, if a WAL archiver (such as pglesslog) is trying to
- * compress out removable backup blocks, it won't remove any that
- * occur after this point.
- *
* During recovery, we skip forcing XLOG file switch, which means that
* the backup taken during recovery is not available for the special
* recovery case described above.
/*
* Each page of XLOG file has a header like this:
*/
-#define XLOG_PAGE_MAGIC 0xD11B /* can be used as WAL version indicator */
+#define XLOG_PAGE_MAGIC 0xD11C /* can be used as WAL version indicator */
typedef struct XLogPageHeaderData
{
#define XLP_FIRST_IS_CONTRECORD 0x0001
/* This flag indicates a "long" page header */
#define XLP_LONG_HEADER 0x0002
-/* This flag indicates backup blocks starting in this page are optional */
-#define XLP_BKP_REMOVABLE 0x0004
/* Replaces a missing contrecord; see CreateOverwriteContrecordRecord */
-#define XLP_FIRST_IS_OVERWRITE_CONTRECORD 0x0008
+#define XLP_FIRST_IS_OVERWRITE_CONTRECORD 0x0004
/* All defined flag bits in xlp_info (used for validity checking of header) */
-#define XLP_ALL_FLAGS 0x000F
+#define XLP_ALL_FLAGS 0x0007
#define XLogPageHeaderSize(hdr) \
(((hdr)->xlp_info & XLP_LONG_HEADER) ? SizeOfXLogLongPHD : SizeOfXLogShortPHD)