Fix PostgreSQL invalid primary checkpoint record
ΒΆ
This issue sometimes happens in the staging environment. The fix is to force the DB pod into a bash loop, while we run a shell command that will reset the database.
-
Configure the
indevets-core-staging
deployment:-
Locate the definition for the
indevets-core-staging-db
container.command: - '/bin/bash' - '-c' - '--' args: while true; do sleep 10; done;
-
Save the new configuration and wait for the new deployment to come online.
-
-
Access the
indevets-core-staging-db
pod shell and run the following commands:which pg_resetwal
Copy the output, it will be referenced in the next step as PG_RESETWAL_BIN_LOCATION
```bash
su -l postgres
PG_RESETWAL_BIN_LOCATION /var/lib/postgresql/data/
```
For example, the command could like: `/usr/lib/postgresql/11/bin/pg_resetwal /var/lib/postgresql/data/`