Closed ywkim312 closed 3 months ago
After updating the chart, then deployed. The log shows the incompatibility
2024-06-24 21:13:49.167 GMT [1] FATAL: database files are incompatible with server
2024-06-24 21:13:49.167 GMT [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 16.3.```
Here's the general process
One very important thing is that to make datawolf to work, the database must be backup using the higher version of pg_dump For example, in this case, the current postgres is 11.14.0 and is being updated to 16.3.0. Then, when the database get backed up, the pg_dump must be the version 16.3. So the version 16.3 version of pg_dump dumps that databases in the 11.14. So, the following step 1, the pg_dump must be 16.3 otherwise datawolf will not work after get restored.
Other thing consider is that, after database get updated, when there is no actual data in the database, if the datawolf pod is alive, it will generated the necessary tables in the database. So to avoid this, after do all the following steps, scale datawolf and postgres down to zero. Then remove the PVC, and PV. Then scale up the postgres to necessary number. Then restore the database. Then scale up the datawolf.
If you need to redo the things or trouble shooting
If you need to have a pod that controls the mounted volume (this might needed after postgres pod is one)
apiVersion: v1
kind: Pod
metadata:
name: temp-pod
spec:
containers:
- name: temp-container
image: busybox
volumeMounts:
- mountPath: "/mnt"
name: postgres-volume
command: ['sh', '-c', 'echo Container is Running; sleep 3600']
volumes:
- name: postgres-volume
persistentVolumeClaim:
claimName: postgres-pvc # Adjust this to match your PersistentVolumeClaim
deploy by
kubectl apply -f temp-pod.yaml
go inside the pod
kubectl exec -it temp-pod -- /bin/sh
to remove the pod
kubectl delete pod <pod-name>
to get the claimName
kubectl get pvc -n incore
the volume is mounted on /mnt/
There was two unusual databases in dev hedgedoc (user rhedgedoc) wiki (user wiki)
There must be an upgrade of back up process in incore-dev and incore-prod cluster in gitlab chart
incore-postgresql-headless -> incore-postgresql-hl postgresqlPassword -> poastPassword
Postgres is old. It has to be upgraded to newer version