cluster: enforce min delay in seed migration
This commit is contained in:
Родитель
13c19e3efa
Коммит
0ecc724127
|
@ -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
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче