agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedcommit not completing - how to investigate?
4+ messages / 2 participants
[nested] [flat]
* commit not completing - how to investigate?
@ 2017-07-21 11:32 Tim Dudgeon <tdudgeon.ml@gmail.com>
2017-07-21 14:14 ` Re: commit not completing - how to investigate? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Tim Dudgeon @ 2017-07-21 11:32 UTC (permalink / raw)
To: pgsql-sql
I have a situation where the pg_stat_activity view shows that can have
some processes that are idle and not completing. In some cases the
statement being executed is COMMIT.
How can I investigate WHY these processes are not completing. Presumably
they are waiting on something, but I'm not sure how to work out what
this is.
Thanks
Tim
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: commit not completing - how to investigate?
2017-07-21 11:32 commit not completing - how to investigate? Tim Dudgeon <tdudgeon.ml@gmail.com>
@ 2017-07-21 14:14 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-07-21 15:18 ` Re: commit not completing - how to investigate? Tim Dudgeon <tdudgeon.ml@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2017-07-21 14:14 UTC (permalink / raw)
To: Tim Dudgeon <tdudgeon.ml@gmail.com>; +Cc: pgsql-sql
Tim Dudgeon <tdudgeon.ml@gmail.com> writes:
> I have a situation where the pg_stat_activity view shows that can have
> some processes that are idle and not completing. In some cases the
> statement being executed is COMMIT.
Are you sure you're interpreting the view properly? If the session
state is shown as idle, it's idle. We used to show the query field
as empty in that case, but recent PG versions allow the query field
to continue to show the last-completed command.
regards, tom lane
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: commit not completing - how to investigate?
2017-07-21 11:32 commit not completing - how to investigate? Tim Dudgeon <tdudgeon.ml@gmail.com>
2017-07-21 14:14 ` Re: commit not completing - how to investigate? Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-07-21 15:18 ` Tim Dudgeon <tdudgeon.ml@gmail.com>
2017-07-21 17:23 ` Re: commit not completing - how to investigate? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Tim Dudgeon @ 2017-07-21 15:18 UTC (permalink / raw)
To: pgsql-sql
Maybe I'm not interpreting it correctly.
I was assuming that if the view reported a row then that row was still
"happening".
Yes, the state is "idle", and the command is "COMMIT".
But if the COMMIT has completed then the process should finish and the
row not be present?
So is what you are suggesting that in my case I'm using a connection
pool, and the COMMIT has completed successfully, the connection released
back to the pool, but not yet closed, so that process is still running?
Tim
On 21/07/2017 15:14, Tom Lane wrote:
> Tim Dudgeon <tdudgeon.ml@gmail.com> writes:
>> I have a situation where the pg_stat_activity view shows that can have
>> some processes that are idle and not completing. In some cases the
>> statement being executed is COMMIT.
> Are you sure you're interpreting the view properly? If the session
> state is shown as idle, it's idle. We used to show the query field
> as empty in that case, but recent PG versions allow the query field
> to continue to show the last-completed command.
>
> regards, tom lane
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: commit not completing - how to investigate?
2017-07-21 11:32 commit not completing - how to investigate? Tim Dudgeon <tdudgeon.ml@gmail.com>
2017-07-21 14:14 ` Re: commit not completing - how to investigate? Tom Lane <tgl@sss.pgh.pa.us>
2017-07-21 15:18 ` Re: commit not completing - how to investigate? Tim Dudgeon <tdudgeon.ml@gmail.com>
@ 2017-07-21 17:23 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2017-07-21 17:23 UTC (permalink / raw)
To: Tim Dudgeon <tdudgeon.ml@gmail.com>; +Cc: pgsql-sql
Tim Dudgeon <tdudgeon.ml@gmail.com> writes:
> Yes, the state is "idle", and the command is "COMMIT".
> But if the COMMIT has completed then the process should finish and the
> row not be present?
Well, that's up to the connected client whether it's going to terminate
the session or not.
> So is what you are suggesting that in my case I'm using a connection
> pool, and the COMMIT has completed successfully, the connection released
> back to the pool, but not yet closed, so that process is still running?
That's sort of the point of a connection pooler, to re-use database
sessions rather than establishing new ones all the time. But the
database doesn't know that a pooler is in use; it just sees a client
connection that's not doing anything right now.
regards, tom lane
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2017-07-21 17:23 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21 11:32 commit not completing - how to investigate? Tim Dudgeon <tdudgeon.ml@gmail.com>
2017-07-21 14:14 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-07-21 15:18 ` Tim Dudgeon <tdudgeon.ml@gmail.com>
2017-07-21 17:23 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox