| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Andres Freund <andres(at)2ndquadrant(dot)com> |
| Cc: | pgsql-hackers(at)postgreSQL(dot)org |
| Subject: | PrivateRefCount patch has got issues |
| Date: | 2014-12-16 23:25:13 |
| Message-ID: | 15028.1418772313@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jaime Casanova | 2014-12-17 00:09:40 | Re: Commitfest problems |
| Previous Message | Tom Lane | 2014-12-16 23:00:11 | Re: Commitfest problems |