diff options
| author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-11-11 19:21:49 +0200 | 
|---|---|---|
| committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-11-11 19:32:07 +0200 | 
| commit | 9dba66c0e5248ad70f0a45b1b39ece6b1f549d53 (patch) | |
| tree | 9ec5f0ca4d47c3b4f94c02711fea6f0d812920f6 /src | |
| parent | 01670b8be6caca08fd99f4cc3927d94a8d8ca694 (diff) | |
Fix bug introduced by the recent patch to check that the checkpoint redo
location read from backup label file can be found: wasShutdown was set
incorrectly when a backup label file was found.
Jeff Davis, with a little tweaking by me.
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/access/transam/xlog.c | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 1b90f9ae72e..af53e42430f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5830,6 +5830,7 @@ StartupXLOG(void)  		if (record != NULL)  		{  			memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint)); +			wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);  			ereport(DEBUG1,  					(errmsg("checkpoint record is at %X/%X",  							checkPointLoc.xlogid, checkPointLoc.xrecoff))); @@ -5854,6 +5855,7 @@ StartupXLOG(void)  			ereport(FATAL,  					(errmsg("could not locate required checkpoint record"),  					 errhint("If you are not restoring from a backup, try removing the file \"%s/backup_label\".", DataDir))); +			wasShutdown = false; /* keep compiler quiet */  		}  		/* set flag to delete it later */  		haveBackupLabel = true; @@ -5898,10 +5900,10 @@ StartupXLOG(void)  					 (errmsg("could not locate a valid checkpoint record")));  		}  		memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint)); +		wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);  	}  	LastRec = RecPtr = checkPointLoc; -	wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);  	ereport(DEBUG1,  			(errmsg("redo record is at %X/%X; shutdown %s", | 
