Re: clog_redo causing very long recovery time

Alvaro Herrera <alvherre@commandprompt.com>

From: Alvaro Herrera <alvherre@commandprompt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joseph Conway <mail@joeconway.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-05-06T03:29:13Z
Lists: pgsql-hackers
Excerpts from Tom Lane's message of vie may 06 00:22:43 -0300 2011:

> I think a more elegant fix might be to just swap the order of the 
> ExtendCLOG and ExtendSUBTRANS calls in GetNewTransactionId.  The
> reason that would help is that pg_subtrans isn't WAL-logged, so if
> we succeed doing ExtendSUBTRANS and then fail in ExtendCLOG, we
> won't have written any XLOG entry, and thus repeated failures will not
> result in repeated XLOG entries.  I seem to recall having considered
> exactly that point when the clog WAL support was first done, but the
> scenario evidently wasn't considered when subtransactions were stuck
> in :-(.

I'm pretty sure it would have never occured to me to consider such a
scenario.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support