Re: Query on pg_stat_activity table got stuck

From: neeraj kumar <neeru(dot)cse(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeremy Schneider <schnjere(at)amazon(dot)com>, pgsql-admin(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: Query on pg_stat_activity table got stuck
Date: 2019-05-10 20:32:54
Message-ID: CAPR3Wj7xT0jsjZDO=TW44x1hMR6-jFebX7uvZ+nCJu15XyL-dg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

--> But the right answer is to fix it on the writing side.
Yes I agree with this part. Even though there is very low probability, a
process can still be killed in middle when writing. So what is your
suggestion on how to recover from this automatically?

On Fri, May 10, 2019 at 9:14 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> neeraj kumar <neeru(dot)cse(at)gmail(dot)com> writes:
> > Also curious why query on pg_stat_activity is considering terminated
> > process ?
>
> The short answer to that is that this bug leaves shared memory in
> a corrupt state. It's not really useful to worry about whether
> readers should react differently to that --- you could spend endless
> amounts of time hypothesizing different kinds of corruption and
> endless amounts of code/cycles trying to work around it. But the
> right answer is to fix it on the writing side.
>
> regards, tom lane
>

--
-------------------------------------
Thanks
Neeraj Kumar,
+1 (206) 427-7267

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2019-05-11 02:57:20 Re: Query on pg_stat_activity table got stuck
Previous Message Tom Lane 2019-05-10 16:13:58 Re: Query on pg_stat_activity table got stuck

Browse pgsql-general by date

  From Date Subject
Next Message Susan Hurst 2019-05-10 22:46:05 TAbles/Columns missing in information schema
Previous Message Scottix 2019-05-10 20:26:08 Re: Optimizing Database High CPU