mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
Don't waste the last segment of each 4GB logical log file.
The comments claimed that wasting the last segment made it easier to do calculations with XLogRecPtrs, because you don't have problems representing last-byte-position-plus-1 that way. In my experience, however, it only made things more complicated, because the there was two ways to represent the boundary at the beginning of a logical log file: logid = n+1 and xrecoff = 0, or as xlogid = n and xrecoff = 4GB - XLOG_SEG_SIZE. Some functions were picky about which representation was used. Also, use a 64-bit segment number instead of the log/seg combination, to point to a certain WAL segment. We assume that all platforms have a working 64-bit integer type nowadays. This is an incompatible change in WAL format, so bumping WAL version number.
This commit is contained in:
@ -267,12 +267,10 @@ extern XLogRecPtr XLogInsert(RmgrId rmid, uint8 info, XLogRecData *rdata);
|
||||
extern void XLogFlush(XLogRecPtr RecPtr);
|
||||
extern bool XLogBackgroundFlush(void);
|
||||
extern bool XLogNeedsFlush(XLogRecPtr RecPtr);
|
||||
extern int XLogFileInit(uint32 log, uint32 seg,
|
||||
bool *use_existent, bool use_lock);
|
||||
extern int XLogFileOpen(uint32 log, uint32 seg);
|
||||
extern int XLogFileInit(XLogSegNo segno, bool *use_existent, bool use_lock);
|
||||
extern int XLogFileOpen(XLogSegNo segno);
|
||||
|
||||
|
||||
extern void XLogGetLastRemoved(uint32 *log, uint32 *seg);
|
||||
extern void XLogGetLastRemoved(XLogSegNo *segno);
|
||||
extern void XLogSetAsyncXactLSN(XLogRecPtr record);
|
||||
|
||||
extern void RestoreBkpBlocks(XLogRecPtr lsn, XLogRecord *record, bool cleanup);
|
||||
@ -280,7 +278,7 @@ extern void RestoreBkpBlocks(XLogRecPtr lsn, XLogRecord *record, bool cleanup);
|
||||
extern void xlog_redo(XLogRecPtr lsn, XLogRecord *record);
|
||||
extern void xlog_desc(StringInfo buf, uint8 xl_info, char *rec);
|
||||
|
||||
extern void issue_xlog_fsync(int fd, uint32 log, uint32 seg);
|
||||
extern void issue_xlog_fsync(int fd, XLogSegNo segno);
|
||||
|
||||
extern bool RecoveryInProgress(void);
|
||||
extern bool HotStandbyActive(void);
|
||||
@ -294,6 +292,7 @@ extern bool RecoveryIsPaused(void);
|
||||
extern void SetRecoveryPause(bool recoveryPause);
|
||||
extern TimestampTz GetLatestXTime(void);
|
||||
extern TimestampTz GetCurrentChunkReplayStartTime(void);
|
||||
extern char *XLogFileNameP(TimeLineID tli, XLogSegNo segno);
|
||||
|
||||
extern void UpdateControlFile(void);
|
||||
extern uint64 GetSystemIdentifier(void);
|
||||
|
Reference in New Issue
Block a user