Is this non-volatile pointer access OK? - Mailing list pgsql-hackers

From Daniel Farina
Subject Is this non-volatile pointer access OK?
Date
Msg-id CAAZKuFbr+KnpDgCP4tCDxMzKEqD096FzipMP_8Ra_iZF9nsnMg@mail.gmail.com
Whole thread Raw
Responses Re: Is this non-volatile pointer access OK?  (Peter Geoghegan <peter@2ndquadrant.com>)
List pgsql-hackers
http://doxygen.postgresql.org/xlog_8c_source.html#l08197

On line 8197 of xlog.c:

08194     /* Get a local copy of the last safe checkpoint record. */
08195     SpinLockAcquire(&xlogctl->info_lck);
08196     lastCheckPointRecPtr = xlogctl->lastCheckPointRecPtr;
08197     memcpy(&lastCheckPoint, &XLogCtl->lastCheckPoint, sizeof(CheckPoint));
08198     SpinLockRelease(&xlogctl->info_lck);

Note the use of capital XLogCtl->lastCheckPoint, which is not the
volatile pointer.

I found this while scouring the code trying to figure out Bug #6291,
which is the (to my latest knowledge) is when the epoch is not
incremented (sometimes) when passing wraparound.

-- 
fdr



pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: [GENERAL] Multiple Slave Failover with PITR
Next
From: Dave Page
Date:
Subject: Re: _USE_32BIT_TIME_T Patch