PGO Cluster Upgrade from V-4.6.0 to V-5.3.4

64 views
Skip to first unread message

Mohammad Shumon

unread,
Sep 21, 2023, 8:58:53 AM9/21/23
to Postgres Operator
K8s Version: 1.22.17
Old PGO Version: 4.6.0
New PGO Version: 5.3.4

I have created a backup and delete pgo-v4 cluster while keeping the backups. 
Then I am trying to create pgo-v5 cluster restoring from that backup. 
The yaml file contents are given below:
---
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
  name: pgo-v5-hippo
  namespace: pgo
spec:
  image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-15.4-0
  postgresVersion: 15
  supplementalGroups:
    - 26
  dataSource:
    volumes:
      #pgDataVolume:
        #pvcName: pgo-v4-test-db
        #directory: "pgo-v4-test-db"
      pgBackRestVolume:
        pvcName: hippo-pgbr-repo
        directory: "hippo-backrest-shared-repo"
    postgresCluster:
      repoName: repo1

  instances:
    - name: pgo-v5-hippo-01
      #containers:
        #securityContext:
          #runAsGroup: 26
      dataVolumeClaimSpec:
        accessModes:
        - "ReadWriteOnce"
        resources:
          requests:
            storage: 1Gi
  backups:
    pgbackrest:
      image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.47-0
      repos:
      - name: repo1
        volume:
          volumeClaimSpec:
            storageClassName: rook-ceph-block
            accessModes:
            - "ReadWriteOnce"
            resources:
              requests:
                storage: 1Gi
---

After applying this pod pgo-v5-hippo-move-pgbackrest-repo-dir-59s99 gets error which is

Preparing cluster pgo-v5-hippo pgBackRest repo volume for PGO v5.x
repo_pvc=hippo-pgbr-repo
pgbackrest directory:
total 20K
drwxr-sr-x 4 2000 postgres 4.0K Sep 20 06:53 hippo-backrest-shared-repo
drwxrws--- 2 root postgres  16K Sep 20 06:52 lost+found
Current pgBackRest repo directory volume contents:
total 8.0K
drwxr-s--- 3 2000 postgres 4.0K Sep 20 06:53 archive
drwxr-s--- 3 2000 postgres 4.0K Sep 20 06:53 backup
Now updating repo directory...
mv: cannot move '/pgbackrest/hippo-backrest-shared-repo/archive' to '/pgbackrest/archive': Permission denied

Can someone help me on this. 

TJ Moore

unread,
Sep 21, 2023, 6:08:28 PM9/21/23
to Mohammad Shumon, Postgres Operator
Hello Mohammad,

Sorry to hear that you are hitting this issue. After reviewing the information you provided, it seems likely that you may be hitting the permission issue we mention in our upgrade documentation (see https://access.crunchydata.com/documentation/postgres-operator/latest/upgrade/v4tov5/upgrade-method-2-backups#step-1-prepare-the-pgo-v4-cluster-for-migration). 

The warning block in that section mentions that certain storage options have a known issue related to how fsGroups are applied. As mentioned, " When migrating from PGO v4, this will require the user to manually set the group value of the pgBackRest repo directory, and all subdirectories, to 26 to match the postgres group used in PGO v5." That said, you will want to set the relevant file permissions to ensure the appropriate v5 permissions are in place so the move can complete successfully. I hope this helps!

Regards,

TJ
--
TJ Moore

Crunchy Data
Enterprise PostgreSQL 

(Office):  843.593.8613
(Extension): 1018

162 Seven Farms Drive, Suite 220
Charleston, SC  29492
Reply all
Reply to author
Forward
0 new messages