pgsql: Don't allow to disable backend assertions via the debug_assertio

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't allow to disable backend assertions via the debug_assertio
Date: 2014-06-20 09:10:01
Message-ID: E1Wxupd-0001DY-BK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't allow to disable backend assertions via the debug_assertions GUC.

The existance of the assert_enabled variable (backing the
debug_assertions GUC) reduced the amount of knowledge some static code
checkers (like coverity and various compilers) could infer from the
existance of the assertion. That could have been solved by optionally
removing the assertion_enabled variable from the Assert() et al macros
at compile time when some special macro is defined, but the resulting
complication doesn't seem to be worth the gain from having
debug_assertions. Recompiling is fast enough.

The debug_assertions GUC is still available, but readonly, as it's
useful when diagnosing problems. The commandline/client startup option
-A, which previously also allowed to enable/disable assertions, has
been removed as it doesn't serve a purpose anymore.

While at it, reduce code duplication in bufmgr.c and localbuf.c
assertions checking for spurious buffer pins. That code had to be
reindented anyway to cope with the assert_enabled removal.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3bdcf6a5a7555035810e2ba2b8a0fb04dc5c66b8

Modified Files
--------------
doc/src/sgml/config.sgml | 46 ++++++++++------------
doc/src/sgml/ref/postgres-ref.sgml | 12 ------
src/backend/access/gin/ginpostinglist.c | 1 -
src/backend/commands/event_trigger.c | 1 -
src/backend/postmaster/postmaster.c | 6 +--
src/backend/storage/buffer/bufmgr.c | 62 +++++++++++++-----------------
src/backend/storage/buffer/localbuf.c | 51 +++++++++++-------------
src/backend/storage/lmgr/proc.c | 3 --
src/backend/tcop/postgres.c | 6 +--
src/backend/utils/cache/catcache.c | 51 ++++++++++++------------
src/backend/utils/cache/relfilenodemap.c | 1 -
src/backend/utils/misc/guc.c | 30 +++------------
src/include/c.h | 4 +-
src/include/postgres.h | 9 ++---
14 files changed, 106 insertions(+), 177 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2014-06-20 09:11:06 pgsql: Do all-visible handling in lazy_vacuum_page() outside its critic
Previous Message Noah Misch 2014-06-20 03:02:21 Re: pgsql: Let installcheck-world pass against a server requiring a passwor