Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2015-06-23 Thread Abhijit Menon-Sen
At 2014-08-20 11:07:44 +0300, hlinnakan...@vmware.com wrote: > > I don't think the new GetBufferWithoutRelcache function is in line > with the existing ReadBuffer API. I think it would be better to add a > new ReadBufferMode - RBM_CACHE_ONLY? - that only returns the buffer if > it's already in cach

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-08-20 Thread Heikki Linnakangas
On 07/07/2014 11:46 AM, Abhijit Menon-Sen wrote: At 2014-07-07 14:02:15 +0530, amit.khande...@enterprisedb.com wrote: Other than some minor comments as mentioned below, I don't have any more issues, it looks all good. Thank you. (Updated patch attached.) I don't think the new GetBufferWitho

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-07 Thread Abhijit Menon-Sen
At 2014-07-07 14:02:15 +0530, amit.khande...@enterprisedb.com wrote: > > Other than some minor comments as mentioned below, I don't have any > more issues, it looks all good. Thank you. (Updated patch attached.) -- Abhijit diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtr

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-07 Thread Amit Khandekar
On 4 July 2014 19:11, Abhijit Menon-Sen wrote: > Updated patch attached, thanks. > > Amit: what's your conclusion from the review? > Other than some minor comments as mentioned below, I don't have any more issues, it looks all good. XLogLockBlockRangeForCleanup() function header comments has th

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-04 Thread Abhijit Menon-Sen
Updated patch attached, thanks. Amit: what's your conclusion from the review? -- Abhijit diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c index 5f9fc49..dc90c02 100644 --- a/src/backend/access/nbtree/nbtxlog.c +++ b/src/backend/access/nbtree/nbtxlog.c @@ -501

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-04 Thread Amit Khandekar
On 3 July 2014 16:59, Simon Riggs wrote: > > I think we should say this though > > LockBufHdr(buf); > valid = ((buf->flags & BM_VALID) != 0); > if (valid) > PinBuffer_Locked(buf); > else > UnlockBufHdr(buf); > > since otherwise we would access the buffer flags without the spinlock > and w

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-03 Thread Simon Riggs
On 3 July 2014 06:45, Amit Khandekar wrote: > In GetBufferWithoutRelcache(), I was wondering, rather than calling > PinBuffer(), if we do this : > LockBufHdr(buf); > PinBuffer_Locked(buf); > valid = ((buf->flags & BM_VALID) != 0); > then we can avoid having the new buffer access strategy BAS_DISC

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-03 Thread Abhijit Menon-Sen
FYI, I've attached a patch that does what you suggested. I haven't done anything else (i.e. testing) with it yet. -- Abhijit diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c index 5f9fc49..dc90c02 100644 --- a/src/backend/access/nbtree/nbtxlog.c +++ b/src/back

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-02 Thread Abhijit Menon-Sen
At 2014-07-03 11:15:53 +0530, amit.khande...@enterprisedb.com wrote: > > In GetBufferWithoutRelcache(), I was wondering, rather than calling > PinBuffer(), if we do this : > LockBufHdr(buf); > PinBuffer_Locked(buf); > valid = ((buf->flags & BM_VALID) != 0); > then we can avoid having the new buffer

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-02 Thread Amit Khandekar
On 13 June 2014 14:10, Abhijit Menon-Sen wrote: > nbtxlog.c:btree_xlog_vacuum() contains the following comment: > > * XXX we don't actually need to read the block, we just need to > * confirm it is unpinned. If we had a special call into the > * buffer manager we could optimise thi

[HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-06-13 Thread Abhijit Menon-Sen
nbtxlog.c:btree_xlog_vacuum() contains the following comment: * XXX we don't actually need to read the block, we just need to * confirm it is unpinned. If we had a special call into the * buffer manager we could optimise this so that if the block is * not in shared_buffers we c