Re: [PATCH] Log crashed backend's query (activity string) - Mailing list pgsql-hackers

From Marti Raudsepp
Subject Re: [PATCH] Log crashed backend's query (activity string)
Date
Msg-id CABRT9RBCnU5ceeQd48WrR2aDkdXNnai41DrAyOn2LpxiQSm4UA@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Log crashed backend's query (activity string)  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Sat, Sep 24, 2011 at 22:23, Robert Haas <robertmhaas@gmail.com> wrote:
> It's not the reviewer's job to convince Tom of anything in particular,
> but I think it's helpful for them to state their opinion, whatever it
> may be (agreeing with Tom, disagreeing with Tom, or whatever).

My opinion is that this can be made safe enough and I explained why I
think so here: http://archives.postgresql.org/pgsql-hackers/2011-09/msg00308.php

Launching another process to read 1kB out of shared memory and print
it to log sounds like overkill. But if that's deemed necessary, I'm
willing to code it up too.

However, I now realize that it does make sense to write a separate
simpler function for the crashed backend case with no
vbeentry->st_changecount check loops, no checkUser, etc. That would be
more robust and easier to review.

I'll try to send a new patch implementing this in a few days.

> IMHO, the most compelling argument against the OP's approach made so
> far is the encoding issue.  I was hoping someone (maybe the OP?) would
> have an opinion on that, an idea how to work around it, or something.

I propsed replacing non-ASCII characters with '?' earlier. That would
be simpler to code, but obviously wouldn't preserve non-ASCII
characters in case the crash has anything to do with those. Since
nobody else weighed in on the '\x##' vs '?' choice, I didn't implement
it yet; but I will in my next submission.

Regards,
Marti


pgsql-hackers by date:

Previous
From: Joshua Berkus
Date:
Subject: Re: unite recovery.conf and postgresql.conf
Next
From: Joshua Berkus
Date:
Subject: Re: Satisfy extension dependency by one of multiple extensions