/* *EachpageofXLOGfilehasaheaderlikethis:
*/ #define XLOG_PAGE_MAGIC 0xD118 /* can be used as WAL version indicator */
typedefstruct XLogPageHeaderData
{
uint16 xlp_magic; /* magic value for correctness checks */
uint16 xlp_info; /* flag bits, see below */
TimeLineID xlp_tli; /* TimeLineID of first record on page */
XLogRecPtr xlp_pageaddr; /* XLOG address of this page */
/* *Whenthereisnotenoughspaceoncurrentpageforwholerecord,we *continueonthenextpage.xlp_rem_lenisthenumberofbytes *remainingfromapreviouspage;ittracksxl_tot_lenintheinitial *header.Notethatthecontinuationdataisn'tnecessarilyaligned.
*/
uint32 xlp_rem_len; /* total len of remaining data for record */
} XLogPageHeaderData;
/* *WhentheXLP_LONG_HEADERflagisset,westoreadditionalfieldsinthe *pageheader.(Thisisordinarilydonejustinthefirstpageofan *XLOGfile.)Theadditionalfieldsservetoidentifythefileaccurately.
*/ typedefstruct XLogLongPageHeaderData
{
XLogPageHeaderData std; /* standard header fields */
uint64 xlp_sysid; /* system identifier from pg_control */
uint32 xlp_seg_size; /* just as a cross-check */
uint32 xlp_xlog_blcksz; /* just as a cross-check */
} XLogLongPageHeaderData;
/* When record crosses page boundary, set this flag in new page's header */ #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 /* All defined flag bits in xlp_info (used for validity checking of header) */ #define XLP_ALL_FLAGS 0x000F
/* wal_segment_size can range from 1MB to 1GB */ #define WalSegMinSize 1024 * 1024 #define WalSegMaxSize 1024 * 1024 * 1024 /* default number of min and max wal segments */ #define DEFAULT_MIN_WAL_SEGS 5 #define DEFAULT_MAX_WAL_SEGS 64
/* check that the given size is a valid wal_segment_size */ #define IsPowerOf2(x) (x > 0 && ((x) & ((x)-1)) == 0) #define IsValidWalSegSize(size) \
(IsPowerOf2(size) && \
((size) >= WalSegMinSize && (size) <= WalSegMaxSize))
/* *Informationloggedwhenwedetectachangeinoneoftheparameters *importantforHotStandby.
*/ typedefstruct xl_parameter_change
{ int MaxConnections; int max_worker_processes; int max_wal_senders; int max_prepared_xacts; int max_locks_per_xact; int wal_level; bool wal_log_hints; bool track_commit_timestamp;
} xl_parameter_change;
/* End of recovery mark, when we don't do an END_OF_RECOVERY checkpoint */ typedefstruct xl_end_of_recovery
{
TimestampTz end_time;
TimeLineID ThisTimeLineID; /* new TLI */
TimeLineID PrevTimeLineID; /* previous TLI we forked off from */ int wal_level;
} xl_end_of_recovery;
/* *Thefunctionsinxloginsert.cconstructachainofXLogRecDatastructs *torepresentthefinalWALrecord.
*/ typedefstruct XLogRecData
{ struct XLogRecData *next; /* next struct in chain, or NULL */ constvoid *data; /* start of rmgr data to include */
uint32 len; /* length of rmgr data to include */
} XLogRecData;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.