PSMDB editing storage is not reflected on the next backup taken, only on the second and later

Description

Steps to reproduce:
If you create backup storage, create a cluster and then later edit backup storage and change bucket name and/or credentials, it will do the backup in the old bucket/credentials or sometimes fail, but then on the subsequent try it will start using the new info.

$ k get psmdb-backup
NAME CLUSTER STORAGE DESTINATION TYPE STATUS COMPLETED AGE
backup-bbq mongodb-tio tomislav-backup-test s3://tomislav-backup-test/mongodb-tio/35751325-b3f1-4d22-8fd0-9e9a82703e28/2024-05-17T12:11:56Z logical ready 3s 38s
backup-ruf mongodb-tio tomislav-backup-test s3://tomislav-backup-test/mongodb-tio/35751325-b3f1-4d22-8fd0-9e9a82703e28/2024-05-17T12:06:46Z logical ready 5m14s 5m48s
cron-mongodb-tio-20240517114500-mczqv mongodb-tio tomislav-backup-test s3://tomislav-backup-test/mongodb-tio/35751325-b3f1-4d22-8fd0-9e9a82703e28/2024-05-17T11:45:21Z logical ready 26m 27m
cron-mongodb-tio-20240517115500-vbhsc mongodb-tio tomislav-backup-test s3://tomislav-backup-test/mongodb-tio/35751325-b3f1-4d22-8fd0-9e9a82703e28/2024-05-17T11:55:42Z logical ready 16m 17m

As you can see all backups are done to tomislav-backup-test bucket, but backup-bbq should have been done to tomislav-backup-test-binlogs bucket since I edited the backup storage and changed the bucket name.

So if you change credentials like I did later (I changed the account completely, bucket, and credentials)  the backup will fail, but then the next one will succeed.

apiVersion: psmdb.percona.com/v1
kind: PerconaServerMongoDBBackup
metadata:
creationTimestamp: "2024-05-17T12:35:16Z"
generation: 1
name: backup-jt2
namespace: test
ownerReferences:

  • apiVersion: everest.percona.com/v1alpha1
    blockOwnerDeletion: true
    kind: DatabaseClusterBackup
    name: backup-jt2
    uid: cf84417d-69f6-48c9-9c11-071f584a3b7b
    resourceVersion: "145647"
    uid: 2faea974-6fc0-45c8-bce2-4ba35c8e3034
    spec:
    clusterName: mongodb-tio
    storageName: tomislav-backup-test
    status:
    destination: s3://tomislav-backup-test-binlogs/mongodb-tio/35751325-b3f1-4d22-8fd0-9e9a82703e28/2024-05-17T12:35:37Z
    error: "oplog: write data: upload to S3: AccessDenied: Access Denied\n\tstatus code:
    403, request id: xxx, host id: xxx."
    lastTransition: "2024-05-17T12:35:49Z"
    pbmName: "2024-05-17T12:35:37Z"
    pbmPod: mongodb-tio-rs0-2
    replsetNames:

  • rs0
    s3:
    bucket: tomislav-backup-test-binlogs
    credentialsSecret: tomislav-backup-test
    endpointUrl:
    prefix: mongodb-tio/35751325-b3f1-4d22-8fd0-9e9a82703e28
    region: us-west-2
    serverSideEncryption: {}
    start: "2024-05-17T12:35:38Z"
    state: error
    storageName: tomislav-backup-test
    type: logical

Environment

None

Attachments

3

Activity

Details

Assignee

Reporter

Labels

Priority

Smart Checklist

Created June 25, 2024 at 11:35 AM
Updated June 25, 2024 at 11:35 AM