Is this non-volatile pointer access OK?

From: Daniel Farina <daniel(at)heroku(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Is this non-volatile pointer access OK?
Date: 2012-09-03 07:10:58
Message-ID: CAAZKuFbr+KnpDgCP4tCDxMzKEqD096FzipMP_8Ra_iZF9nsnMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2012-09-03 07:57:33 Re: _USE_32BIT_TIME_T Patch
Previous Message Daniel Farina 2012-09-03 06:58:04 Re: [GENERAL] Multiple Slave Failover with PITR