コード例 #1
0
ファイル: storage.go プロジェクト: CedarLogic/arangodb
// 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("etcdserver: converting v0.4 log to v2.0")
		err := migrate.Migrate4To2(cfg.DataDir, cfg.Name)
		if err != nil {
			log.Fatalf("etcdserver: failed migrating data-dir: %v", err)
			return err
		}
	}
	return nil
}
コード例 #2
0
ファイル: main.go プロジェクト: CedarLogic/arangodb
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.Migrate4To2(*from, *name)
	if err != nil {
		log.Fatalf("Failed migrating data-dir: %v", err)
	}
}
コード例 #3
0
ファイル: storage.go プロジェクト: johnmccawley/origin
// 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 upgradeDataDir(baseDataDir string, name string, ver version.DataDirVersion) error {
	switch ver {
	case version.DataDir0_4:
		plog.Infof("converting v0.4 log to v2.0")
		err := migrate.Migrate4To2(baseDataDir, name)
		if err != nil {
			plog.Fatalf("failed to migrate data-dir (%v)", err)
			return err
		}
		fallthrough
	case version.DataDir2_0:
		err := makeMemberDir(baseDataDir)
		if err != nil {
			return err
		}
		fallthrough
	case version.DataDir2_0_1:
		fallthrough
	default:
	}
	return nil
}
コード例 #4
0
ファイル: storage.go プロジェクト: jhadvig/origin
// 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 upgradeDataDir(baseDataDir string, name string, ver version.DataDirVersion) error {
	switch ver {
	case version.DataDir0_4:
		log.Print("etcdserver: converting v0.4 log to v2.0")
		err := migrate.Migrate4To2(baseDataDir, name)
		if err != nil {
			log.Fatalf("etcdserver: failed migrating data-dir: %v", err)
			return err
		}
		fallthrough
	case version.DataDir2_0:
		err := makeMemberDir(baseDataDir)
		if err != nil {
			return err
		}
		fallthrough
	case version.DataDir2_0_1:
		fallthrough
	default:
		log.Printf("etcdserver: datadir is valid for the 2.0.1 format")
	}
	return nil
}