From 0ab9d1c4b31622e9176472b4276f3e9831e3d6ba Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Sun, 24 Jun 2012 18:51:37 +0300 Subject: 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. --- src/backend/postmaster/checkpointer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/backend/postmaster/checkpointer.c') diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index 7e5db863daf..417e3bb0d1b 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -631,7 +631,7 @@ CheckArchiveTimeout(void) * If the returned pointer points exactly to a segment boundary, * assume nothing happened. */ - if ((switchpoint.xrecoff % XLogSegSize) != 0) + if ((switchpoint % XLogSegSize) != 0) ereport(DEBUG1, (errmsg("transaction log switch forced (archive_timeout=%d)", XLogArchiveTimeout))); @@ -778,10 +778,7 @@ IsCheckpointOnSchedule(double progress) if (!RecoveryInProgress()) { recptr = GetInsertRecPtr(); - elapsed_xlogs = - (((double) ((uint64) (recptr.xlogid - ckpt_start_recptr.xlogid) << 32L)) + - ((double) recptr.xrecoff - (double) ckpt_start_recptr.xrecoff) / XLogSegSize) / - CheckPointSegments; + elapsed_xlogs = (((double) (recptr - ckpt_start_recptr)) / XLogSegSize) / CheckPointSegments; if (progress < elapsed_xlogs) { -- cgit v1.2.3