Backup sidecar crashes endlessly after minikube restart
I've got etcd-operator running in minikube with a PersistentVolume providing backup. It seems to have trouble when the minikube VM is restarted. The backup sidecar crashes in an endless loop. This is the output of the backup sidecar:
time="2017-11-11T01:00:09Z" level=info msg="listening on 0.0.0.0:19999"
time="2017-11-11T01:00:31Z" level=info msg="received a backup request"
time="2017-11-11T01:00:31Z" level=info msg="getMaxRev: member etcd-cluster-0018 revision (9)"
time="2017-11-11T01:00:31Z" level=info msg="skipped creating new backup: no change since last time"
panic: runtime error: index out of range
goroutine 14 [running]:
github.com/coreos/etcd-operator/pkg/backup.(*BackupController).Run(0xc420151560)
/Users/haseeb/work/go-space/src/github.com/coreos/etcd-operator/pkg/backup/backup.go:186 +0x625
created by main.main
/Users/haseeb/work/go-space/src/github.com/coreos/etcd-operator/cmd/backup/main.go:91 +0x2d1
I had expected it to restore from a previous backup and resume normal operations. It has done so successfully in the past (more or less). I'm not sure what's special about this time. Maybe the backup data is somehow corrupted?
Happy to provide more information if it will help.
Incidentally, the etcd cluster is unusable in this state. The etcd pods keep crashing. The logs end with a critical message:
2017-11-11 01:11:35.546194 C | etcdmain: error validating peerURLs {ClusterID:38fcbe20f5752b06 Members:[&{ID:1fda48838ce69890 RaftAttributes:{PeerURLs:[http://etcd-cluster-0003.etcd-cluster.etcd.svc:2380]} Attributes:{Name: ClientURLs:[]}} &{ID:e615ba7a5bca48a2 RaftAttributes:{PeerURLs:[http://etcd-cluster-0002.etcd-cluster.etcd.svc:2380]} Attributes:{Name:etcd-cluster-0002 ClientURLs:[http://etcd-cluster-0002.etcd-cluster.etcd.svc:2379]}}] RemovedMemberIDs:[]}: unmatched member while checking PeerURLs
@fanminshi Can you look into it? Any potential problem in 0.7.0 etcd operator?
@hongchaodeng will take a look.
@zhaytee What's the version of etcd operator? How to reproduce the failure? Please let us know more info so that we can help you.
@zhaytee what's the etcd operator version that you were using?
This is the same issue as https://github.com/coreos/etcd-operator/issues/1613
It is caused by that we return nil backupStatus if there isn't newer revision than the current backup one: https://github.com/coreos/etcd-operator/blob/v0.6.1/pkg/backup/backup_manager.go#L85
Then it skipped updating the array: https://github.com/coreos/etcd-operator/blob/v0.6.1/pkg/backup/backup.go#L175
Finally it caused panic here: https://github.com/coreos/etcd-operator/blob/v0.6.1/pkg/backup/backup.go#L186
Closing as this logic is not an issue anymore
@fanminshi I'm using version 0.6.1.
It seems to break when minikube is restarted, such as when my laptop sleeps and wakes, causing the underlying VM to pause and then resume. I can't seem to reproduce it manually right now (of course), but I'll post here the next time it happens.
@zhaytee it is a bug in 0.6.1. @hongchaodeng and I have figured the cause. However, from v0.7.0 this issue shouldn't appear anymore since we have move the backup logic out of etcd operator to etcd back operator. Please take a look of the 0.7.0 release note to learn about the etcd backup operator.
@fanminshi Sounds good, thank you.