Re: Use a signal to trigger a memory context dump?

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use a signal to trigger a memory context dump?
Date: 2014-06-23 13:10:52
Message-ID: 20140623131052.GK16098@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres,

* Andres Freund (andres(at)2ndquadrant(dot)com) wrote:
> On 2014-06-23 08:36:02 -0400, Stephen Frost wrote:
> > I'd tend to think this would be sufficient. You're suggesting a case
> > where you need to debug prior to SQL access (not specifically sure what
> > you mean by that) or processes which are hopefully less likely to have
> > memory issues, but you don't have gdb..
>
> prior to SQL access := Before crash recovery finished/hot standby
> reached consistency.
>
> And I don't agree that memory dumps from non-plain backends are that
> uninteresting. E.g. background workers and logical decoding walsenders
> both can be interesting.

I didn't mean they're uninteresting- I meant that if you're dealing with
those kinds of issues, having gdb isn't as huge a hurdle..

> > Another thought along the lines of getting information about running
> > processes would be to see the call stack or execution plan.. I seem to
> > recall there being a patch for the latter at one point?
>
> I think these are *much* more complicated. I don't want to tackle them
> at the same time, otherwise we'll never get anywhere.

Sure, just some things to keep in mind as you're thinking about changes
in this area. Just to toss another random thought out there, what about
an SQL function which does a LISTEN and then sends a signal to another
backend which throws a NOTIFY with payload including the requested info?
That'd be *very* useful as there are lots of cases where access to the
logs isn't trivial (particularly if they've been properly locked down
due to the sensetive info they can contain..).

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-06-23 13:57:22 Re: [bug fix] multibyte messages are displayed incorrectly on the client
Previous Message Kevin Grittner 2014-06-23 13:10:24 Re: tab completion for setting search_path