mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
etcd: fix rollback
This commit is contained in:
parent
b3a89cc988
commit
f63bb69b20
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user