Re: pg_stat_activity crashes

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_activity crashes
Date: 2016-04-25 14:26:49
Message-ID: CA+TgmoZDcaGCF0n9PaF5kzwj0CNRa-E+tDgzW80GVxg77gPdSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 21, 2016 at 9:47 PM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> A lock was already held in BackendPidGetProc(). Is it also
> needless? If so, we should use BackendPidGetProcWithLock() instad
> (the name seems a bit confusing, though).

Oh, that's really sad. No, that lock is definitely needed. We should
probably try to figure out some day if there is a way to make this
completely lockless, but that'll have to be 9.7 material or later.
:-(

> What I did in the patch was just extending the lock duration
> until reading the pointer proc. I didn't added any additional
> lock.

Sorry, I didn't realize that. Good point.

>> > The
>> > only thing we need to do is to prevent the value from being read
>> > twice, and we already have precedent for how to prevent that in
>> > freelist.c.
>
> However, I don't have objections for the patch applied.

OK, let's leave it like that for now, then.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2016-04-25 14:41:46 Re: Updated backup APIs for non-exclusive backups
Previous Message Stephen Frost 2016-04-25 14:24:54 pg_dump - tar format and compression