pgsql: Improve error reporting in code that checks for buffer refcount

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve error reporting in code that checks for buffer refcount
Date: 2013-03-15 16:26:32
Message-ID: E1UGXSi-0003pN-KC@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve error reporting in code that checks for buffer refcount leaks.

Formerly we just Assert'ed that each refcount was zero, which was quick
and easy but failed to provide a good overview of what was wrong.
Change the code so that we'll call PrintBufferLeakWarning() for each
buffer with a nonzero refcount, and then Assert at the end of the loop.
This costs nothing in runtime and might ease diagnosis of some bugs.

Greg Smith, reviewed by Satoshi Nagayasu, further tweaked by me

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/dcafdbcde1baf256891be6af77868b84889b435d

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 24 ++++++++++++++++++------
src/backend/storage/buffer/localbuf.c | 22 +++++++++++++++++++---
2 files changed, 37 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-03-15 21:42:06 pgsql: Improve the documentation about commit_delay.
Previous Message Tom Lane 2013-03-15 02:57:15 pgsql: Extend format() to handle field width and left/right alignment.