1
0
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:
Heikki Linnakangas
2012-06-24 18:51:37 +03:00
parent 061e7efb1b
commit 0ab9d1c4b3
28 changed files with 279 additions and 357 deletions

View File

@ -951,7 +951,7 @@ RecordTransactionCommit(void)
if (XLogStandbyInfoActive())
nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
&RelcacheInitFileInval);
wrote_xlog = (XactLastRecEnd.xrecoff != 0);
wrote_xlog = (XactLastRecEnd != 0);
/*
* If we haven't been assigned an XID yet, we neither can, nor do we want
@ -1200,7 +1200,7 @@ RecordTransactionCommit(void)
SyncRepWaitForLSN(XactLastRecEnd);
/* Reset XactLastRecEnd until the next transaction writes something */
XactLastRecEnd.xrecoff = 0;
XactLastRecEnd = 0;
cleanup:
/* Clean up local data */
@ -1402,7 +1402,7 @@ RecordTransactionAbort(bool isSubXact)
{
/* Reset XactLastRecEnd until the next transaction writes something */
if (!isSubXact)
XactLastRecEnd.xrecoff = 0;
XactLastRecEnd = 0;
return InvalidTransactionId;
}
@ -1501,7 +1501,7 @@ RecordTransactionAbort(bool isSubXact)
/* Reset XactLastRecEnd until the next transaction writes something */
if (!isSubXact)
XactLastRecEnd.xrecoff = 0;
XactLastRecEnd = 0;
/* And clean up local data */
if (rels)
@ -2170,7 +2170,7 @@ PrepareTransaction(void)
*/
/* Reset XactLastRecEnd until the next transaction writes something */
XactLastRecEnd.xrecoff = 0;
XactLastRecEnd = 0;
/*
* Let others know about no transaction in progress by me. This has to be