Re: Do we need to handle orphaned prepared transactions in the server? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Do we need to handle orphaned prepared transactions in the server?
Date
Msg-id CA+TgmoYnUv_OnGN=dBS_0OO4HHygVG2LnOL+zoYrMraspYm7iQ@mail.gmail.com
Whole thread Raw
In response to Re: Do we need to handle orphaned prepared transactions in the server?  (Hamid Akhtar <hamid.akhtar@gmail.com>)
Responses Re: Do we need to handle orphaned prepared transactions in the server?
List pgsql-hackers
On Wed, Feb 19, 2020 at 10:05 AM Hamid Akhtar <hamid.akhtar@gmail.com> wrote:
> Attached is version 1 of POC patch for notifying of orphaned
> prepared transactions via warnings emitted to a client
> application and/or log file. It applies to PostgreSQL branch
> "master" on top of "e2e02191" commit.

I think this is a bad idea and that we should reject the patch. It's
true that forgotten prepared transactions are a problem, but it's also
true that you can monitor for that yourself using the
pg_prepared_xacts view. If you do, you will have a lot more
flexibility than this patch gives you, or than any similar patch ever
can give you.

Generally, people don't pay attention to warnings in logs, so they're
just clutter. Moreover, there are tons of different things for which
you should probably monitor (wraparound perils, slow checkpoints,
bloated tables, etc.) and so the real solution is to run some
monitoring software. So even if you do pay attention to your logs, and
even if the GUCs this provides you sufficient flexibility for your
needs in this one area, you still need to run some monitoring
software. At which point, you don't also need this.

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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_basebackup, manifests and backends older than ~12
Next
From: David Steele
Date:
Subject: Re: documenting the backup manifest file format