Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] mongo dump backup failed to get target pods by backup policy #5530

Closed
JashBook opened this issue Oct 19, 2023 · 0 comments · Fixed by #5534
Closed

[BUG] mongo dump backup failed to get target pods by backup policy #5530

JashBook opened this issue Oct 19, 2023 · 0 comments · Fixed by #5534
Assignees
Labels
bug kind/bug Something isn't working severity/major Great chance user will encounter the same problem
Milestone

Comments

@JashBook
Copy link
Collaborator

Describe the bug
mongo dump backup failed to get target pods by backup policy.
the role follower is inconsistent with the secondary

kbcli version
Kubernetes: v1.26.7-gke.500
KubeBlocks: 0.7.0-beta.7
kbcli: 0.7.0-beta.7

To Reproduce
Steps to reproduce the behavior:

  1. create monogo cluster
  2. do dump backup
  3. See error
kubectl get backup -A
NAMESPACE       NAME                                                  POLICY                                      METHOD          REPO                    STATUS    TOTAL-SIZE   DURATION   CREATION-TIME          COMPLETION-TIME   EXPIRATION-TIME
ns-mexjqeccug   backup-ns-mexjqeccug-mongo-zawqhb-20231019021536      mongo-zawqhb-mongodb-backup-policy          dump                                    Failed                            2023-10-19T02:15:36Z                     

drescribe backup

kubectl describe backup -n ns-mexjqeccug backup-ns-mexjqeccug-mongo-zawqhb-20231019021536
Name:         backup-ns-mexjqeccug-mongo-zawqhb-20231019021536
Namespace:    ns-mexjqeccug
Labels:       kubeblocks.io/backup-protection=retain
Annotations:  <none>
API Version:  dataprotection.kubeblocks.io/v1alpha1
Kind:         Backup
Metadata:
  Creation Timestamp:  2023-10-19T02:15:36Z
  Generation:          1
  Resource Version:    80997
  UID:                 ba3dde53-9e7f-4104-9391-72d27a47aa62
Spec:
  Backup Method:       dump
  Backup Policy Name:  mongo-zawqhb-mongodb-backup-policy
  Deletion Policy:     Delete
Status:
  Failure Reason:  failed to get target pods by backup policy ns-mexjqeccug/mongo-zawqhb-mongodb-backup-policy
  Phase:           Failed
Events:
  Type     Reason               Age   From               Message
  ----     ------               ----  ----               -------
  Warning  FailedCreatedBackup  22m   backup-controller  Creating backup failed, error: failed to get target pods by backup policy ns-mexjqeccug/mongo-zawqhb-mongodb-backup-policy

get BackupPolicy yaml : the role follower is inconsistent with the secondary

kubectl get BackupPolicy -n ns-mexjqeccug   -oyaml
apiVersion: v1
items:
- apiVersion: dataprotection.kubeblocks.io/v1alpha1
  kind: BackupPolicy
  metadata:
    annotations:
      apps.kubeblocks.io/backup-policy-template: mongodb-backup-policy-template
      dataprotection.kubeblocks.io/is-default-policy: "true"
    creationTimestamp: "2023-10-19T01:50:41Z"
    finalizers:
    - cluster.kubeblocks.io/finalizer
    - dataprotection.kubeblocks.io/finalizer
    generation: 1
    labels:
      app.kubernetes.io/instance: mongo-zawqhb
      app.kubernetes.io/managed-by: kubeblocks
      apps.kubeblocks.io/component-def-ref: mongodb
    name: mongo-zawqhb-mongodb-backup-policy
    namespace: ns-mexjqeccug
    ownerReferences:
    - apiVersion: apps.kubeblocks.io/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: Cluster
      name: mongo-zawqhb
      uid: f4d7a678-8edc-4a80-a03c-275407571721
    resourceVersion: "32009"
    uid: ce5a8b0f-1365-48eb-a8fe-95792a45d1ee
  spec:
    backupMethods:
    - actionSetName: mongodb-physical-backup
      name: datafile
      snapshotVolumes: false
      targetVolumes:
        volumeMounts:
        - mountPath: /data/mongodb
          name: data
    - actionSetName: mongodb-volumesnapshot
      name: volume-snapshot
      snapshotVolumes: true
      targetVolumes:
        volumeMounts:
        - mountPath: /data/mongodb
          name: data
        volumes:
        - data
    - actionSetName: mongodb-dump
      name: dump
      snapshotVolumes: false
    pathPrefix: /mongo-zawqhb-f4d7a678-8edc-4a80-a03c-275407571721/mongodb
    target:
      connectionCredential:
        passwordKey: password
        secretName: mongo-zawqhb-conn-credential
        usernameKey: username
      podSelector:
        matchLabels:
          app.kubernetes.io/instance: mongo-zawqhb
          app.kubernetes.io/managed-by: kubeblocks
          apps.kubeblocks.io/component-name: mongodb
          kubeblocks.io/role: follower
        strategy: Any
      serviceAccountName: kb-mongo-zawqhb
  status:
    observedGeneration: 1
    phase: Available
kind: List
metadata:
  resourceVersion: ""

Expected behavior
mongo dump backup success.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@JashBook JashBook added kind/bug Something isn't working severity/major Great chance user will encounter the same problem labels Oct 19, 2023
@JashBook JashBook added this to the Release 0.7.0 milestone Oct 19, 2023
@wangyelei wangyelei linked a pull request Oct 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug kind/bug Something isn't working severity/major Great chance user will encounter the same problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants