From 83cb7da7dcd11f658a7fc4aff198923bf76ff8f5 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 27 Jan 2010 16:41:09 +0000 Subject: Fix bug in wasender's xlogid boundary handling, reported by Erik Rijkers. LogwrtRqst.Write can be set to non-existent FF log segment, we mustn't try to send that in XLogSend(). Also fix similar bug in ReadRecord(), which I just introduced in the ReadRecord() refactoring patch. --- src/backend/access/transam/xlog.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/backend/access/transam/xlog.c') diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 60d40d4505b..e8e79b380ee 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.362 2010/01/27 15:27:50 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.363 2010/01/27 16:41:09 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -3574,6 +3574,12 @@ ReadRecord(XLogRecPtr *RecPtr, int emode_arg, bool fetching_ckpt) NextLogPage(tmpRecPtr); /* We will account for page header size below */ } + + if (tmpRecPtr.xrecoff >= XLogFileSize) + { + (tmpRecPtr.xlogid)++; + tmpRecPtr.xrecoff = 0; + } } else { -- cgit v1.2.3