Because of manual cleanup of WAL files, my DB is corrupted. PostGres is throwing this error :
2017-08-10 20:44:41.887 UTC 2661 LOG: database system was interrupted;
last known up at 2017-08-03 04:07:25 UTC
2017-08-10 20:44:42 INFO: preparing to get xlog FROM: /ghostcache6/postgresql9.1/drupal_db_1/wal_incoming/192.168.44.167/00000021.history.??????????.gz TO: pg_xlog/RECOVERYHISTORY
2017-08-10 20:44:42 INFO: Skip processing '.history' file.
2017-08-10 20:44:42.040 UTC 2661 LOG: starting archive recovery
2017-08-10 20:44:42 INFO: preparing to get xlog FROM: /ghostcache6/postgresql9.1/drupal_db_1/wal_incoming/192.168.44.167/0000002100000FD2000000A1.??????????.gz TO: pg_xlog/RECOVERYXLOG
2017-08-10 20:44:42 INFO: SWITCH TO LIVE MASTER DB TRIGGERED
2017-08-10 20:44:42.048 UTC 2661 LOG: could not open file "pg_xlog/0000002100000FD2000000A1" (log file 4050, segment 161): No such file or directory
2017-08-10 20:44:42.048 UTC 2661 LOG: invalid primary checkpoint record
2017-08-10 20:44:42 INFO: preparing to get xlog FROM: /ghostcache6/postgresql9.1/drupal_db_1/wal_incoming/192.168.44.167/0000002100000FD20000009F.??????????.gz TO: pg_xlog/RECOVERYXLOG
2017-08-10 20:44:42 INFO: SWITCH TO LIVE MASTER DB TRIGGERED
2017-08-10 20:44:42.055 UTC 2661 LOG: could not open file "pg_xlog/0000002100000FD20000009F" (log file 4050, segment 159): No such file or directory
2017-08-10 20:44:42.055 UTC 2661 LOG: invalid secondary checkpoint record
2017-08-10 20:44:42.055 UTC 2661 PANIC: could not locate a valid checkpoint record
2017-08-10 20:44:42.055 UTC 2660 LOG: startup process (PID 2661) was terminated by signal 6: Aborted
2017-08-10 20:44:42.055 UTC 2660 LOG: aborting startup due to startup process failure
Thankfully i have backup of data folder, which i extracted in data folder back. But Postgres is still down with the same error. Can i run pg_resetxlog in this case? Please suggest.