cluster: enforce min delay in seed migration

This commit is contained in:
Xiang Li 2016-10-04 13:32:20 -07:00
Родитель 13c19e3efa
Коммит 0ecc724127
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -222,6 +222,13 @@ func (c *Cluster) migrateSeedMember() error {
log.Infof("added the new member")
// wait for the delay
if c.spec.Seed.RemoveDelay == 0 {
c.spec.Seed.RemoveDelay = 30
}
if c.spec.Seed.RemoveDelay < 10 {
c.spec.Seed.RemoveDelay = 10
}
delay := time.Duration(c.spec.Seed.RemoveDelay) * time.Second
log.Infof("wait %v before remove the seed member", delay)
time.Sleep(delay)

Просмотреть файл

@ -42,6 +42,6 @@ type SeedPolicy struct {
MemberClientEndpoints []string
// RemoveDelay specifies the delay to remove the original seed member from the
// cluster in seconds.
// The seed member will be removed in 30s by default.
// The seed member will be removed in 30 second by default. Minimum delay is 10 seconds.
RemoveDelay int
}