* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.19 2006/07/13 16:49:13 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.20 2006/07/20 00:46:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Truncate the SLRU files. This could be done at any time, but
- * checkpoint seems a reasonable place for it.
+ * checkpoint seems a reasonable place for it. There is one exception:
+ * if we are called during xlog recovery, then shared->latest_page_number
+ * isn't valid (because StartupMultiXact hasn't been called yet) and
+ * so SimpleLruTruncate would get confused. It seems best not to risk
+ * removing any data during recovery anyway, so don't truncate.
*/
- TruncateMultiXact();
+ if (!InRecovery)
+ TruncateMultiXact();
}
/*