-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2 backup can not be restored for etcd 3.1.7 #8331
Comments
Do you store only v2 keys? Related #7615. |
We store both v2 and v3. |
I was able to restore with precreating db file |
@r7vme |
@r7vme does your restored cluster needs both v2 and v3 keys? the |
@fanminshi the complaint is etcd is refusing to start because the backup command isn't creating a db file. The e2e test TestCtlV2Backup checks restoring from a v2 backup already, so why isn't it working here? |
reproducible steps: etcd 3.1.7 43b7507 func TestCtlV2BackupFromExistingSnapshot(t *testing.T) {
defer testutil.AfterTest(t)
backupDir, err := ioutil.TempDir("", "testbackup0.etcd")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(backupDir)
cfg := configNoTLS
cfg.snapCount = 5
epc1 := setupEtcdctlTest(t, &cfg, false)
// trigger snapshot
for i := 0; i < cfg.snapCount; i++ {
if err := etcdctlSet(epc1, "foo", "bar"); err != nil {
t.Fatal(err)
}
}
if err := etcdctlBackup(epc1, epc1.procs[0].cfg.dataDirPath, backupDir); err != nil {
t.Fatal(err)
}
if err := epc1.Close(); err != nil {
t.Fatalf("error closing etcd processes (%v)", err)
}
// restart from the backup directory
cfg2 := configNoTLS
cfg2.dataDirPath = backupDir
cfg2.keepDataDir = true
cfg2.forceNewCluster = true
epc2 := setupEtcdctlTest(t, &cfg2, false)
// check if backup went through correctly
if err := etcdctlGet(epc2, "foo", "bar", false); err != nil {
t.Fatal(err)
}
if err := epc2.Close(); err != nil {
t.Fatalf("error closing etcd processes (%v)", err)
}
}
output: ../bin/etcd-24520: 2017-08-30 16:37:16.539271 C | etcdmain: database file (/var/folders/bk/ph52lmzd5hxcx_0jvqr3rh5h0000gn/T/testbackup0.etcd227233542/member/snap/db) of the backend is missing
--- FAIL: TestCtlV2BackupFromExistingSnapshot (1.05s)
ctl_v2_test.go:514: could not start etcd process cluster (EOF)
FAIL
exit status 1 |
When running The backup code create a etcd starts with Even though backend file doesn't exist; However, When run The backup code create a etcd starts and gets cluster revision from the snapshot. Since backend file doesn't exist and |
Fixed by #8479 |
I have etcd 3.1.7 (etcdctl 3.2.0) and i'm doing v2 backup like this
while i'm trying to start etcd from this backup i'm getting
This issue reproduced on two independent environments already.
The text was updated successfully, but these errors were encountered: