Esempio n. 1
0
// UpgradeWAL converts an older version of the EtcdServer data to the newest version.
// It must ensure that, after upgrading, the most recent version is present.
func UpgradeWAL(cfg *ServerConfig, ver wal.WalVersion) error {
	if ver == wal.WALv0_4 {
		log.Print("Converting v0.4 log to v0.5")
		err := migrate.Migrate4To5(cfg.DataDir, cfg.Name)
		if err != nil {
			log.Fatalf("Failed migrating data-dir: %v", err)
			return err
		}
	}
	return nil
}
Esempio n. 2
0
func main() {
	from := flag.String("data-dir", "", "etcd v0.4 data-dir")
	name := flag.String("name", "", "etcd node name")
	flag.Parse()

	if *from == "" {
		log.Fatal("Must provide -data-dir flag")
	}

	err := migrate.Migrate4To5(*from, *name)
	if err != nil {
		log.Fatalf("Failed migrating data-dir: %v", err)
	}
}