Using Debian Wheezy, Postgresql 9.3
My database went down because the section in which it stores WAL files was full. So, I deleted everything inside ./pg_xlog/ because I didnβt know what they were (yes, incredibly stupid from me). Now the Postgres service will not start, although the problem is according to syslog:
00000: could not open tablespace directory "pg_tblspc/16386/PG_9.3_201306121": File or directory not found LOCAL: RelationCacheInitFileRemoveInDir, relcache.c:4895 00000: Primary checkpoint record is invalid LOCAL: ReadCheckpointRecord, xlog.c:6543 00000: Secondary checkpoint record is invalid LOCAL: ReadCheckpointRecord, xlog.c:6547 PANIC: XX000: could not locate a valid checkpoint record LOCAL: StartupXLOG, xlog.c:5228
I'm not quite sure the problem is that it cannot find the correct pg_tblspc or the complete absence of WAL checkpoint files. The actual path to the database storage location is /dados/PG_9.3_201306121 . What can I do to start the service again?
EDIT1: Well, I was able to bring this news back online. Some databases have been corrupted. I managed to execute DROPDB two of them (they could not even connect to them without forcibly restarting the service). I tried to do this with the other that got damaged, but the error was again related to xlog. I tried to do a clean recovery on it, but the recovery was incomplete. Then I created a new database and tried to restore the old backup of this database. It was also incomplete.
Now I canβt refuse any databases and not create new ones, I always get xlog flush request not satisfied . I tried running pg_resetxlog , but it didn't seem to do anything. Other that the error shows: cannot write to block 1 of pg_tblspc/16385/PG_9.3_201306121/36596452/11773 , write error may be permanent .
EDIT2: Part of the problem above was with this 11773 file. I renamed it to 11773.corrupt, and now the database allows me to create and drop again.
source share