Re: "recovering prepared transaction" after server restart message

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: joe(at)mcknight(dot)de
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "recovering prepared transaction" after server restart message
Date: 2006-11-03 06:48:05
Message-ID: 27067.1162536485@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

"Joachim Wieland" <joe(at)mcknight(dot)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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Simon Riggs 2006-11-03 08:06:55 Re: "recovering prepared transaction" after serverrestart message
Previous Message Joachim Wieland 2006-11-03 04:30:16 "recovering prepared transaction" after server restart message

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2006-11-03 07:05:05 Re: Design Considerations for New Authentication Methods
Previous Message Tom Lane 2006-11-03 06:18:10 Re: bug in timestamp and out of range values