PrivateRefCount patch has got issues - Mailing list pgsql-hackers

From Tom Lane
Subject PrivateRefCount patch has got issues
Date
Msg-id 15028.1418772313@sss.pgh.pa.us
Whole thread Raw
Responses Re: PrivateRefCount patch has got issues  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
I just happened to look into bufmgr.c for the first time in awhile, and
noticed the privaterefcount-is-no-longer-a-simple-array stuff.  It doesn't
look too well thought out to me.  In particular, PinBuffer_Locked calls
GetPrivateRefCountEntry while holding a buffer-header spinlock.  That
seems completely unacceptable.  It's certainly a huge violation of our
design principle that spinlocks should be held for only a few
instructions; and I rather suspect that a palloc failure down inside the
hashtable entry-allocation code would leave things in a bad state.  It's
also depressing that the very common code path ReleaseBuffer->UnpinBuffer
results in a double search of the array/hashtable; that should be
refactored to avoid that.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Commitfest problems
Next
From: Jaime Casanova
Date:
Subject: Re: Commitfest problems