mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Replace XLogRecPtr struct with a 64-bit integer.
This simplifies code that needs to do arithmetic on XLogRecPtrs. To avoid changing on-disk format of data pages, the LSN on data pages is still stored in the old format. That should keep pg_upgrade happy. However, we have XLogRecPtrs embedded in the control file, and in the structs that are sent over the replication protocol, so this changes breaks compatibility of pg_basebackup and server. I didn't do anything about this in this patch, per discussion on -hackers, the right thing to do would to be to change the replication protocol to be architecture-independent, so that you could use a newer version of pg_receivexlog, for example, against an older server version.
This commit is contained in:
@ -185,8 +185,8 @@ RequestXLogStreaming(XLogRecPtr recptr, const char *conninfo)
|
||||
* being created by XLOG streaming, which might cause trouble later on if
|
||||
* the segment is e.g archived.
|
||||
*/
|
||||
if (recptr.xrecoff % XLogSegSize != 0)
|
||||
recptr.xrecoff -= recptr.xrecoff % XLogSegSize;
|
||||
if (recptr % XLogSegSize != 0)
|
||||
recptr -= recptr % XLogSegSize;
|
||||
|
||||
SpinLockAcquire(&walrcv->mutex);
|
||||
|
||||
@ -204,8 +204,7 @@ RequestXLogStreaming(XLogRecPtr recptr, const char *conninfo)
|
||||
* If this is the first startup of walreceiver, we initialize receivedUpto
|
||||
* and latestChunkStart to receiveStart.
|
||||
*/
|
||||
if (walrcv->receiveStart.xlogid == 0 &&
|
||||
walrcv->receiveStart.xrecoff == 0)
|
||||
if (walrcv->receiveStart == 0)
|
||||
{
|
||||
walrcv->receivedUpto = recptr;
|
||||
walrcv->latestChunkStart = recptr;
|
||||
|
Reference in New Issue
Block a user