mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
Flip argument order in XLogSegNoOffsetToRecPtr
Commit fc49e24fa69a added an input argument after the existing output argument. Flip those. Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20180708182345.imdgovmkffgtihhk@alvherre.pgsql
This commit is contained in:
parent
01783ac36d
commit
a22445ff0b
@ -1971,7 +1971,7 @@ XLogBytePosToRecPtr(uint64 bytepos)
|
|||||||
seg_offset += fullpages * XLOG_BLCKSZ + bytesleft + SizeOfXLogShortPHD;
|
seg_offset += fullpages * XLOG_BLCKSZ + bytesleft + SizeOfXLogShortPHD;
|
||||||
}
|
}
|
||||||
|
|
||||||
XLogSegNoOffsetToRecPtr(fullsegs, seg_offset, result, wal_segment_size);
|
XLogSegNoOffsetToRecPtr(fullsegs, seg_offset, wal_segment_size, result);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -2017,7 +2017,7 @@ XLogBytePosToEndRecPtr(uint64 bytepos)
|
|||||||
seg_offset += fullpages * XLOG_BLCKSZ + bytesleft + SizeOfXLogShortPHD;
|
seg_offset += fullpages * XLOG_BLCKSZ + bytesleft + SizeOfXLogShortPHD;
|
||||||
}
|
}
|
||||||
|
|
||||||
XLogSegNoOffsetToRecPtr(fullsegs, seg_offset, result, wal_segment_size);
|
XLogSegNoOffsetToRecPtr(fullsegs, seg_offset, wal_segment_size, result);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -747,7 +747,7 @@ XLogReaderValidatePageHeader(XLogReaderState *state, XLogRecPtr recptr,
|
|||||||
XLByteToSeg(recptr, segno, state->wal_segment_size);
|
XLByteToSeg(recptr, segno, state->wal_segment_size);
|
||||||
offset = XLogSegmentOffset(recptr, state->wal_segment_size);
|
offset = XLogSegmentOffset(recptr, state->wal_segment_size);
|
||||||
|
|
||||||
XLogSegNoOffsetToRecPtr(segno, offset, recaddr, state->wal_segment_size);
|
XLogSegNoOffsetToRecPtr(segno, offset, state->wal_segment_size, recaddr);
|
||||||
|
|
||||||
if (hdr->xlp_magic != XLOG_PAGE_MAGIC)
|
if (hdr->xlp_magic != XLOG_PAGE_MAGIC)
|
||||||
{
|
{
|
||||||
|
@ -2782,7 +2782,7 @@ ReorderBufferSerializedPath(char *path, ReplicationSlot *slot, TransactionId xid
|
|||||||
{
|
{
|
||||||
XLogRecPtr recptr;
|
XLogRecPtr recptr;
|
||||||
|
|
||||||
XLogSegNoOffsetToRecPtr(segno, 0, recptr, wal_segment_size);
|
XLogSegNoOffsetToRecPtr(segno, 0, wal_segment_size, recptr);
|
||||||
|
|
||||||
snprintf(path, MAXPGPATH, "pg_replslot/%s/xid-%u-lsn-%X-%X.snap",
|
snprintf(path, MAXPGPATH, "pg_replslot/%s/xid-%u-lsn-%X-%X.snap",
|
||||||
NameStr(MyReplicationSlot->data.name),
|
NameStr(MyReplicationSlot->data.name),
|
||||||
|
@ -352,7 +352,7 @@ FindStreamingStart(uint32 *tli)
|
|||||||
if (!high_ispartial)
|
if (!high_ispartial)
|
||||||
high_segno++;
|
high_segno++;
|
||||||
|
|
||||||
XLogSegNoOffsetToRecPtr(high_segno, 0, high_ptr, WalSegSz);
|
XLogSegNoOffsetToRecPtr(high_segno, 0, WalSegSz, high_ptr);
|
||||||
|
|
||||||
*tli = high_tli;
|
*tli = high_tli;
|
||||||
return high_ptr;
|
return high_ptr;
|
||||||
|
@ -933,8 +933,8 @@ RewriteControlFile(void)
|
|||||||
* Adjust fields as needed to force an empty XLOG starting at
|
* Adjust fields as needed to force an empty XLOG starting at
|
||||||
* newXlogSegNo.
|
* newXlogSegNo.
|
||||||
*/
|
*/
|
||||||
XLogSegNoOffsetToRecPtr(newXlogSegNo, SizeOfXLogLongPHD,
|
XLogSegNoOffsetToRecPtr(newXlogSegNo, SizeOfXLogLongPHD, WalSegSz,
|
||||||
ControlFile.checkPointCopy.redo, WalSegSz);
|
ControlFile.checkPointCopy.redo);
|
||||||
ControlFile.checkPointCopy.time = (pg_time_t) time(NULL);
|
ControlFile.checkPointCopy.time = (pg_time_t) time(NULL);
|
||||||
|
|
||||||
ControlFile.state = DB_SHUTDOWNED;
|
ControlFile.state = DB_SHUTDOWNED;
|
||||||
|
@ -248,7 +248,7 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
|
|||||||
XLogSegNo targetSegNo;
|
XLogSegNo targetSegNo;
|
||||||
|
|
||||||
XLByteToSeg(targetPagePtr, targetSegNo, WalSegSz);
|
XLByteToSeg(targetPagePtr, targetSegNo, WalSegSz);
|
||||||
XLogSegNoOffsetToRecPtr(targetSegNo + 1, 0, targetSegEnd, WalSegSz);
|
XLogSegNoOffsetToRecPtr(targetSegNo + 1, 0, WalSegSz, targetSegEnd);
|
||||||
targetPageOff = XLogSegmentOffset(targetPagePtr, WalSegSz);
|
targetPageOff = XLogSegmentOffset(targetPagePtr, WalSegSz);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1039,7 +1039,7 @@ main(int argc, char **argv)
|
|||||||
XLogFromFileName(fname, &private.timeline, &segno, WalSegSz);
|
XLogFromFileName(fname, &private.timeline, &segno, WalSegSz);
|
||||||
|
|
||||||
if (XLogRecPtrIsInvalid(private.startptr))
|
if (XLogRecPtrIsInvalid(private.startptr))
|
||||||
XLogSegNoOffsetToRecPtr(segno, 0, private.startptr, WalSegSz);
|
XLogSegNoOffsetToRecPtr(segno, 0, WalSegSz, private.startptr);
|
||||||
else if (!XLByteInSeg(private.startptr, segno, WalSegSz))
|
else if (!XLByteInSeg(private.startptr, segno, WalSegSz))
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
@ -1053,7 +1053,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
/* no second file specified, set end position */
|
/* no second file specified, set end position */
|
||||||
if (!(optind + 1 < argc) && XLogRecPtrIsInvalid(private.endptr))
|
if (!(optind + 1 < argc) && XLogRecPtrIsInvalid(private.endptr))
|
||||||
XLogSegNoOffsetToRecPtr(segno + 1, 0, private.endptr, WalSegSz);
|
XLogSegNoOffsetToRecPtr(segno + 1, 0, WalSegSz, private.endptr);
|
||||||
|
|
||||||
/* parse ENDSEG if passed */
|
/* parse ENDSEG if passed */
|
||||||
if (optind + 1 < argc)
|
if (optind + 1 < argc)
|
||||||
@ -1076,8 +1076,8 @@ main(int argc, char **argv)
|
|||||||
argv[optind + 1], argv[optind]);
|
argv[optind + 1], argv[optind]);
|
||||||
|
|
||||||
if (XLogRecPtrIsInvalid(private.endptr))
|
if (XLogRecPtrIsInvalid(private.endptr))
|
||||||
XLogSegNoOffsetToRecPtr(endsegno + 1, 0, private.endptr,
|
XLogSegNoOffsetToRecPtr(endsegno + 1, 0, WalSegSz,
|
||||||
WalSegSz);
|
private.endptr);
|
||||||
|
|
||||||
/* set segno to endsegno for check of --end */
|
/* set segno to endsegno for check of --end */
|
||||||
segno = endsegno;
|
segno = endsegno;
|
||||||
|
@ -101,7 +101,7 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
|
|||||||
#define XLogSegmentsPerXLogId(wal_segsz_bytes) \
|
#define XLogSegmentsPerXLogId(wal_segsz_bytes) \
|
||||||
(UINT64CONST(0x100000000) / (wal_segsz_bytes))
|
(UINT64CONST(0x100000000) / (wal_segsz_bytes))
|
||||||
|
|
||||||
#define XLogSegNoOffsetToRecPtr(segno, offset, dest, wal_segsz_bytes) \
|
#define XLogSegNoOffsetToRecPtr(segno, offset, wal_segsz_bytes, dest) \
|
||||||
(dest) = (segno) * (wal_segsz_bytes) + (offset)
|
(dest) = (segno) * (wal_segsz_bytes) + (offset)
|
||||||
|
|
||||||
#define XLogSegmentOffset(xlogptr, wal_segsz_bytes) \
|
#define XLogSegmentOffset(xlogptr, wal_segsz_bytes) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user