mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
Allow WAL record header to be split across pages.
This saves a few bytes of WAL space, but the real motivation is to make it predictable how much WAL space a record requires, as it no longer depends on whether we need to waste the last few bytes at end of WAL page because the header doesn't fit. The total length field of WAL record, xl_tot_len, is moved to the beginning of the WAL record header, so that it is still always found on the first page where a WAL record begins. Bump WAL version number again as this is an incompatible change.
This commit is contained in:
@@ -51,7 +51,7 @@ typedef struct BkpBlock
|
||||
/*
|
||||
* Each page of XLOG file has a header like this:
|
||||
*/
|
||||
#define XLOG_PAGE_MAGIC 0xD073 /* can be used as WAL version indicator */
|
||||
#define XLOG_PAGE_MAGIC 0xD074 /* can be used as WAL version indicator */
|
||||
|
||||
typedef struct XLogPageHeaderData
|
||||
{
|
||||
@@ -63,9 +63,7 @@ typedef struct XLogPageHeaderData
|
||||
/*
|
||||
* When there is not enough space on current page for whole record, we
|
||||
* continue on the next page. xlp_rem_len is the number of bytes
|
||||
* remaining from a previous page. (However, the XLogRecord header will
|
||||
* never be split across pages; if there's less than SizeOfXLogRecord
|
||||
* space left at the end of a page, we just waste it.)
|
||||
* remaining from a previous page.
|
||||
*
|
||||
* Note that xl_rem_len includes backup-block data; that is, it tracks
|
||||
* xl_tot_len not xl_len in the initial header. Also note that the
|
||||
|
||||
Reference in New Issue
Block a user