Re: "recovering prepared transaction" after server restart message - Mailing list pgsql-hackers

From Tom Lane
Subject Re: "recovering prepared transaction" after server restart message
Date
Msg-id 27067.1162536485@sss.pgh.pa.us
Whole thread Raw
In response to "recovering prepared transaction" after server restart message  ("Joachim Wieland" <joe@mcknight.de>)
Responses Re: "recovering prepared transaction" after serverrestart message  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
"Joachim Wieland" <joe@mcknight.de> writes:
> There have been several reports that people could not vacuum any more or
> observed strange locks even after server restart. The reason was that they
> still had uncommitted prepared transactions around.

> I wonder if it could help to change the log level from
>     ereport(LOG,
>             (errmsg("recovering prepared transaction %u", xid)));
> to WARNING maybe in order to make that message more striking within the
> normal startup messages.

That doesn't seem like a good idea.  In the first place, recovering
prepared xacts is exactly what system restart is *supposed* to do, and
so calling it a WARNING seems out of line.  (I'm not real sure why that
message is even LOG level, rather than DEBUG1 or below.)  In the second
place, this wouldn't help anyone unless they tried to fix their problem
by restarting the server --- a mentality suited only for Windows users,
and certainly not something a production system is going to do lightly
--- and then thought to look in the postmaster log, which the average
Windows user wouldn't.

I agree that there's a usability issue here though; I've been burnt by
forgotten prepared xacts myself (eg by control-C'ing pg_regress at just
the wrong time).  Would it help if we included prepared xacts in the
pg_stat_activity view?  Is there any other place we could make them
more visible during normal server operation?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] bug in timestamp and out of range values
Next
From: "Magnus Hagander"
Date:
Subject: Re: Design Considerations for New Authentication Methods