Description of problem:
The etcd pod will have discovery logic that will archive the data directory if it exists and if the member is in unstarted state. This is to avoid conflicting cluster ids. The discovery logic does not archive the directory correctly.
Tried to verify from QE angle in 4.5.0-0.nightly-2020-03-22-224936 env after reading the code:
Given run on one master:
[root@xxia03-ff29h-m-0 manifests]# mkdir /tmp/xxia; mv etcd-pod.yaml /tmp/xxia/manifests-etcd-pod.yaml
$ oc delete po etcd-xxia03-ff29h-m-0.c.openshift-qe.internal -n openshift-etcd
$ oc rsh -c etcd -n openshift-etcd <another etcd pod>:
sh-4.2# cp -r /var/lib/etcd/member/ /tmp/xxia/member
sh-4.2# export ETCDCTL_API=3 ETCDCTL_CACERT=/etc/kubernetes/static-pod-resources/configmaps/etcd-serving-ca/ca-bundle.crt ETCDCTL_CERT=`find /etc/kubernetes/static-pod-resources -name "*etcd-peer*.crt" | head -n 1` ETCDCTL_KEY=`find /etc/kubernetes/static-pod-resources -name "*etcd*peer*.key" | head -n 1`
sh-4.2# discover-etcd-initial-cluster --cacert $ETCDCTL_CACERT --cert $ETCDCTL_CERT --key $ETCDCTL_KEY --endpoints localhost:2379 --data-dir /tmp/xxia/member --target-peer-url-host 10.0.0.5 --target-name xxia03-ff29h-m-0.c.openshift-qe.internal
Since no much idea how to make it goes to code `case targetMember != nil && len(targetMember.Name) == 0 && memberDirExists:`, no idea to verify it. Thus, per https://github.com/openshift/etcd/pull/34#issuecomment-592097774 verification, moving to VERIFIED
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.