Monday, July 27, 2015

Postgresql: Corruption: FATAL: invalid page header in block

VM crashed and took the postgresql with it. It failed to come back up when the VM restarted with the following error. There was no complete recent backup and unable to start the database. This does not leave a lot of room to wiggle around.

portgres postgres FATAL : the database system is starting up
portgres postgres FATAL : the database system is starting up
portgres postgres FATAL : the database system is starting up
       FATAL: invalid page header in block 903213 of relation pg_tblspc/16385/PG_9.0_201106101/16386/17694
       LOG: startup process (PID 27451) exited with exit code 1
       LOG: aborting startup due to startup process failure
       LOG: database system was interrupted while in recovery at 2015-07-20 21:00:01 UTC
       HINT: This is probably means that some data is corrupted and yo will have to use the last backup for recovery.
       LOG: database system was not properly shut down; automatic recovery in progress
       LOG: redo starts at 33E/D06C5FXX
       LOG: record with Zero length at 33E/D06C5FXX
       LOG: last completed transaction was at log time  ..........
 ... . .. .. . .. .


The file does exist but corrupted.
ls -as 17694

1349454 17694



Added zero_damaged_pages = on to postgresql.conf and was about to start up the database. Would suggest  to perform a VACUUM FULL and get a backup right after that.

No comments:

Post a Comment