|
|
|
@ -626,7 +626,7 @@ typedef struct XLogCtlData |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* These values do not change after startup, although the pointed-to pages |
|
|
|
|
* and xlblocks values certainly do. xlblock values are protected by |
|
|
|
|
* and xlblocks values certainly do. xlblocks values are protected by |
|
|
|
|
* WALBufMappingLock. |
|
|
|
|
*/ |
|
|
|
|
char *pages; /* buffers for unwritten XLOG pages */ |
|
|
|
@ -743,7 +743,7 @@ static ControlFileData *ControlFile = NULL; |
|
|
|
|
*/ |
|
|
|
|
#define UsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD) |
|
|
|
|
|
|
|
|
|
/* Convert min_wal_size_mb and max wal_size_mb to equivalent segment count */ |
|
|
|
|
/* Convert min_wal_size_mb and max_wal_size_mb to equivalent segment count */ |
|
|
|
|
#define ConvertToXSegs(x, segsize) \ |
|
|
|
|
(x / ((segsize) / (1024 * 1024))) |
|
|
|
|
|
|
|
|
@ -903,7 +903,7 @@ static XLogRecord *ReadRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr, |
|
|
|
|
int emode, bool fetching_ckpt); |
|
|
|
|
static void CheckRecoveryConsistency(void); |
|
|
|
|
static XLogRecord *ReadCheckpointRecord(XLogReaderState *xlogreader, |
|
|
|
|
XLogRecPtr RecPtr, int whichChkpti, bool report); |
|
|
|
|
XLogRecPtr RecPtr, int whichChkpt, bool report); |
|
|
|
|
static bool rescanLatestTimeLine(void); |
|
|
|
|
static void WriteControlFile(void); |
|
|
|
|
static void ReadControlFile(void); |
|
|
|
@ -3049,9 +3049,9 @@ XLogBackgroundFlush(void) |
|
|
|
|
else if (TimestampDifferenceExceeds(lastflush, now, WalWriterDelay)) |
|
|
|
|
{ |
|
|
|
|
/*
|
|
|
|
|
* Flush the writes at least every WalWriteDelay ms. This is important |
|
|
|
|
* to bound the amount of time it takes for an asynchronous commit to |
|
|
|
|
* hit disk. |
|
|
|
|
* Flush the writes at least every WalWriterDelay ms. This is |
|
|
|
|
* important to bound the amount of time it takes for an asynchronous |
|
|
|
|
* commit to hit disk. |
|
|
|
|
*/ |
|
|
|
|
WriteRqst.Flush = WriteRqst.Write; |
|
|
|
|
lastflush = now; |
|
|
|
@ -8442,7 +8442,7 @@ LogCheckpointEnd(bool restartpoint) |
|
|
|
|
* Update the estimate of distance between checkpoints. |
|
|
|
|
* |
|
|
|
|
* The estimate is used to calculate the number of WAL segments to keep |
|
|
|
|
* preallocated, see XLOGFileSlop(). |
|
|
|
|
* preallocated, see XLOGfileslop(). |
|
|
|
|
*/ |
|
|
|
|
static void |
|
|
|
|
UpdateCheckPointDistanceEstimate(uint64 nbytes) |
|
|
|
|