De server zoekt naar een checkpoint-record in het transactielog dat afwezig of beschadigd is. Controleer of dat echt het geval is:
# Postgres >= 10 pg_resetwal DATADIR # Postgres < 10 pg_resetxlog DATADIR Een beschadigd log geeft iets als:
The database server was not shut down cleanly. Resetting the transaction log might cause data to be lost. If you want to proceed anyway, use
-fto force reset.
Je kunt het dan forceren:
# Postgres >= 10 pg_resetwal -f DATADIR # Postgres < 10 pg_resetxlog -f DATADIR Dat reset het log, maar kan het cluster in een onbepaalde toestand achterlaten, zoals de documentatie over pg_resetwal uitlegt:
If
pg_resetwalcomplains that it cannot determine valid data forpg_control, you can force it to proceed anyway by specifying the-f(force) option. In this case plausible values will be substituted for the missing data. Most of the fields can be expected to match, but manual assistance might be needed for the next OID, next transaction ID and epoch, next multitransaction ID and offset, and WAL starting location fields. These fields can be set using the options discussed below. If you are not able to determine correct values for all these fields,-fcan still be used, but the recovered database must be treated with even more suspicion than usual: an immediate dump and reload is imperative. Do not execute any data-modifying operations in the database before you dump, as any such action is likely to make the corruption worse.
Sluit, voordat je naar -f grijpt, eerst de alledaagse oorzaken uit: een datamap die van de verkeerde plek is aangekoppeld, een verouderde postmaster.pid, of onvoldoende rechten op pg_wal. En maak eerst een kopie op bestandsniveauto van het hele cluster — dit is een hersteloperatie, geen reparatie die je zonder vangnet wilt proberen.