WAL

WAL record format

typedef struct XLogRecord
{
pg_crc32         xl_crc; /* CRC for this record */
XLogRecPtr      xl_prev; /* ptr to previous record in log */
TransactionId   xl_xid; /* xact id */
uint32              xl_tot_len; /* total len of entire record */
uint32              xl_len; /* total len of rmgr data */
uint8                xl_info; /* flag bits, see below */
RmgrId             xl_rmid; /* resource manager for this record */
/* Depending on MAXALIGN, there are either 2 or 6 wasted bytes here */
/* ACTUAL LOG DATA FOLLOWS AT END OF STRUCT */
} XLogRecord;

Tools

• Developer tools
– WAL_DEBUG compile option
– Xlogdump http://xlogviewer.projects.postgresql.org/

PITR tools
– Pglesslog
http://pgfoundry.org/projects/pglesslog/

– Clearxlogtail
http://pgfoundry.org/projects/clearxlogtail

 wal_debug=on

原文地址:https://www.cnblogs.com/songyuejie/p/5542191.html