Re: clog_redo causing very long recovery time
Simon Riggs <simon@2ndquadrant.com>
From: Simon Riggs <simon@2ndQuadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joseph Conway <mail@joeconway.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-05-09T07:22:40Z
Lists: pgsql-hackers
On Fri, May 6, 2011 at 4:22 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> The attached fix-clogredo diff is my proposal for a fix for this. > > That seems pretty grotty :-( > > 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 agree with Tom about the need for a fix that prevents generation of repeated WAL records. OTOH, I also like Joe's fix in the recovery code to avoid responding to repeated records. Can we have both please? -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services