etcd: fix rollback

This commit is contained in:
Xiang Li 2016-11-22 15:32:04 -08:00
parent b3a89cc988
commit f63bb69b20
2 changed files with 2 additions and 1 deletions

View File

@ -230,7 +230,6 @@ if [ "${CURRENT_STORAGE}" = "etcd3" -a "${TARGET_STORAGE}" = "etcd2" ]; then
rm -rf "${ROLLBACK_BACKUP_DIR}"
mkdir -p "${ROLLBACK_BACKUP_DIR}"
cp -r "${DATA_DIRECTORY}" "${ROLLBACK_BACKUP_DIR}"
rm -rf "${DATA_DIRECTORY}"/member/snap/*.snap
echo "Performing etcd3 -> etcd2 rollback"
${ROLLBACK} --data-dir "${DATA_DIRECTORY}"
if [ "$?" -ne "0" ]; then

View File

@ -38,6 +38,7 @@ import (
"github.com/coreos/etcd/store"
"github.com/coreos/etcd/wal"
"github.com/coreos/etcd/wal/walpb"
"github.com/coreos/go-semver/semver"
"github.com/golang/glog"
)
@ -263,6 +264,7 @@ func rebuild(datadir string) ([]byte, *raftpb.HardState, store.Store, error) {
cluster := membership.NewCluster("")
cluster.SetStore(st)
cluster.Recover(func(*semver.Version) {})
applier := etcdserver.NewApplierV2(st, cluster)
for _, ent := range ents {