Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Backup Issue in S3 bucket #212

Closed
JJSWAIN2018 opened this issue Aug 28, 2018 · 3 comments
Closed

Backup Issue in S3 bucket #212

JJSWAIN2018 opened this issue Aug 28, 2018 · 3 comments
Labels
Milestone

Comments

@JJSWAIN2018
Copy link

Backup Issue in S3 bucket

Choose one: BUG REPORT
Backup Issue in S3 bucket

Versions

MySQL Operator Version: 0.2.0

Environment:

  • Kubernetes version (use kubectl version): 1.11
  • Cloud provider or hardware configuration: GCP
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Others:

What happened?

When we take backup in both on-demand as well as schedule backup . multiple database .sql.gz files
are stored in S3 bucket .
Name Size Type Storage class Last modified Private access Encryption
db-cluster-db-backup.20180827153653.sql.gz 891.6 KB — Regional 8/27/18, 9:06 PM

db-cluster-db-backup.20180827153654.sql.gz 891.6 KB — Regional 8/27/18, 9:06 PM

db-cluster-db-backup.20180827153656.sql.gz 891.6 KB — Regional 8/27/18, 9:06 PM

What you expected to happen?

Only one backup file should be stored in s3 bucket in on-demand backup .

How to reproduce it (as minimally and precisely as possible)?

Anything else we need to know?

@Simon-Li
Copy link

see this too, may look into it when have a chance.

@prydie prydie added the bug label Aug 28, 2018
@prydie
Copy link

prydie commented Aug 28, 2018

Thanks for the bug report @JJSWAIN2018.

I believe the issue is that the agent backup and restore controllers only check if the backup/restore is scheduled before processing rather than also checking the v1alpha1.{Backup,Restore}Complete condition too.

UpdateFunc: func(oldObj, newObj interface{}) {
new := newObj.(*v1alpha1.Backup)
_, cond := backuputil.GetBackupCondition(&new.Status, v1alpha1.BackupScheduled)
if cond != nil && cond.Status == corev1.ConditionTrue && new.Spec.ScheduledMember == c.podName {
key, err := cache.MetaNamespaceKeyFunc(new)
if err != nil {
glog.Errorf("Error creating queue key, item not added to queue: %v", err)
return
}
c.queue.Add(key)
glog.V(2).Infof("Backup %q queued", kubeutil.NamespaceAndName(new))
return
}
glog.V(2).Infof("Backup %q is not Scheduled, skipping.", kubeutil.NamespaceAndName(new))
},

UpdateFunc: func(oldObj, newObj interface{}) {
new := newObj.(*v1alpha1.Restore)
_, cond := restoreutil.GetRestoreCondition(&new.Status, v1alpha1.RestoreScheduled)
if cond != nil && cond.Status == corev1.ConditionTrue && new.Spec.ScheduledMember == c.podName {
key, err := cache.MetaNamespaceKeyFunc(new)
if err != nil {
glog.Errorf("Error creating queue key, item not added to queue: %v", err)
return
}
c.queue.Add(key)
return
}
glog.V(4).Infof("Restore %q is not Scheduled on this agent")
},

@prydie
Copy link

prydie commented Aug 31, 2018

Resolved by #213

@prydie prydie closed this as completed Aug 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants