pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedWhat do you do with a long running rollback
3+ messages / 2 participants
[nested] [flat]
* What do you do with a long running rollback
@ 2021-11-26 18:33 Chris Cawley <cj_cawley@yahoo.com>
2021-11-26 18:42 ` Re: What do you do with a long running rollback Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Chris Cawley @ 2021-11-26 18:33 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
It's been like that for several days already.
ThanksChris
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: What do you do with a long running rollback
2021-11-26 18:33 What do you do with a long running rollback Chris Cawley <cj_cawley@yahoo.com>
@ 2021-11-26 18:42 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-11-26 19:44 ` Re: What do you do with a long running rollback Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2021-11-26 18:42 UTC (permalink / raw)
To: Chris Cawley <cj_cawley@yahoo.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Chris Cawley <cj_cawley@yahoo.com> writes:
> It's been like that for several days already.
Really? Rollback is O(1) in Postgres.
I could possibly believe that it's blocked on a lock, but even
that would be a bug, because transaction abort should never try
to take any new locks.
A perhaps-more-plausible theory is that you've enabled synchronous
commit but your replica is failing to ack the transmission of the
abort's WAL record.
What are you looking at exactly?
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: What do you do with a long running rollback
2021-11-26 18:33 What do you do with a long running rollback Chris Cawley <cj_cawley@yahoo.com>
2021-11-26 18:42 ` Re: What do you do with a long running rollback Tom Lane <tgl@sss.pgh.pa.us>
@ 2021-11-26 19:44 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2021-11-26 19:44 UTC (permalink / raw)
To: Chris Cawley <cj_cawley@yahoo.com>; +Cc: pgsql-general@lists.postgresql.org
Chris Cawley <cj_cawley@yahoo.com> writes:
> Here's the query :
> | SELECT pid, age(clock_timestamp(), query_start), usename, query |
> | | FROM pg_stat_activity |
> | | WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
> | | ORDER BY query_start desc; |
> Return output is pid | 4 days | user | ROLLBACK
I think the fault's in your query; it's presuming a long-obsolete
convention about how idle sessions are represented in pg_stat_activity.
These days you should be filtering on "state" or "wait_event_type".
This output is just telling you that the last thing that session
did, four days ago, was a ROLLBACK.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-11-26 19:44 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26 18:33 What do you do with a long running rollback Chris Cawley <cj_cawley@yahoo.com>
2021-11-26 18:42 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-11-26 19:44 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox