Re: simplifying emode_for_corrupt_record
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <bruce@momjian.us>, Magnus Hagander <magnus@hagander.net>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, Simon Riggs <simon@2ndquadrant.com>, Fujii Masao <masao.fujii@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-06-28T19:42:52Z
Lists: pgsql-hackers
On Fri, Jun 25, 2010 at 5:07 PM, Robert Haas <robertmhaas@gmail.com> wrote: > I spend a little bit of time analyzing this today and it appears to me > that all of the calls to emode_for_corrupt_record() arrive via > ReadRecord(), which itself takes an emode argument that is always > passed by the caller as either LOG or PANIC. Therefore, the effect of > the first "if" test in emode_for_corrupt_record() is to reduce the > logging level of messages coming from SR or the archive from LOG to > WARNING. (WARNING would be higher in an interactive session, but not > here, per Tom's point.) This seems clearly a bad idea, so I propose > to rip it out, which simplifies this function considerably. Proposed > patch attached. Since this appears to be non-controversial, I'm going to go ahead and commit it. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Postgres Company