GiST concurrency - Mailing list pgsql-hackers

From Teodor Sigaev
Subject GiST concurrency
Date
Msg-id 42B7FA4C.9010107@sigaev.ru
Whole thread Raw
Responses Re: GiST concurrency
List 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
changeddata 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@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Alfranio Correia Junior
Date:
Subject: Re: HOOKS for Synchronous Replication
Next
From: Bruno Wolff III
Date:
Subject: Re: query plan ignoring check constraints