GiST concurrency

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: GiST concurrency
Date: 2005-06-21 11:30:20
Message-ID: 42B7FA4C.9010107@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Now I basically finished recovery for GiST (of course, it's need a hard testing)
and go to concurrency. As it described in Kornaker, Mohan and Hellerstein's
paper
(http://www.sai.msu.su/~megera/postgres/gist/papers/concurrency/sigmod97-gist.pdf)
it's need a way to get global LSN, in our case - XLogRecPtr of last changed
page. As I understand, I can't use ProcLastRecPtr because it is one-process
wide, I need value stored in shared memory. So, may I add method to xlog.c like
this:

/*
* The returning recptr is the beginning of the current record to fill.
* This value is already stored as LSN for changed data pages.
*/

XLogRecPtr
GetCurrentRecPtr(void) {
XLogCtlInsert *Insert = &XLogCtl->Insert;
XLogRecPtr RecPtr;

LWLockAcquire(WALInsertLock, LW_SHARED);
INSERT_RECPTR(RecPtr, Insert, Insert->curridx);
LWLockRelease(WALInsertLock);

return RecPtr;
}

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2005-06-21 11:47:57 Re: query plan ignoring check constraints
Previous Message Andreas Pflug 2005-06-21 09:40:58 Re: Server instrumentation