Invalid resource manager ID in primary checkpoint record error
warning
Be aware there may be data loss if you follow the steps below and your system is heavily corrupted. Please make sure you have a backup of your data before proceeding.
-
Get access to Container shell using following command:
kubectl exec -it <pod-name> -n <namespace> -- /bin/sh
In docker container, you can use following command:
docker exec -it <container-id> /bin/sh
If you cannot get access to container shell, because of the crashloop, make following changes in the deployment manifest and apply it again.
spec:
containers:
- name: postgres
image: postgres:13.2
imagePullPolicy: IfNotPresent
command: ["/bin/sh"]
args: ["-c", "while true; do sleep 30; done;"] -
Run following command to reset WAL log files:
You will need be run following commands as postgres user.
su - postgres
# dry run
pg_resetwal --dry-run /var/lib/postgresql/datapg_resetwal -f /var/lib/postgresql/data
-
Restart the PostgreSQL container and remove the command and args from the deployment manifest if you have made any changes in the previous step.