pgsql: Try to log current the query string when a backend crashes.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Try to log current the query string when a backend crashes.
Date: 2011-10-21 17:40:49
Message-ID: E1RHJ5N-00056y-79@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Try to log current the query string when a backend crashes.

To avoid minimize risk inside the postmaster, we subject this feature
to a number of significant limitations. We very much wish to avoid
doing any complex processing inside the postmaster, due to the
posssibility that the crashed backend has completely corrupted shared
memory. To that end, no encoding conversion is done; instead, we just
replace anything that doesn't look like an ASCII character with a
question mark. We limit the amount of data copied to 1024 characters,
and carefully sanity check the source of that data. While these
restrictions would doubtless be unacceptable in a general-purpose
logging facility, even this limited facility seems like an improvement
over the status quo ante.

Marti Raudsepp, reviewed by PDXPUG and myself

Branch
------
master

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

Modified Files
--------------
src/backend/postmaster/pgstat.c | 73 ++++++++++++++++++++++++++++++++++-
src/backend/postmaster/postmaster.c | 22 ++++++++--
src/backend/utils/adt/ascii.c | 34 ++++++++++++++++
src/include/pgstat.h | 2 +
src/include/utils/ascii.h | 1 +
5 files changed, 125 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-10-21 17:50:44 pgsql: More cleanup after failed reduced-lock-levels-for-DDL feature.
Previous Message Robert Haas 2011-10-21 13:13:57 pgsql: Fix DROP OPERATOR FAMILY IF EXISTS.