Skip to content

Commit

Permalink
keeper: add some missing waits for instance ready
Browse files Browse the repository at this point in the history
When we start an instance during the main logic we should wait that
it's ready (or the next command to update its replication slots will fail).
  • Loading branch information
sgotti committed Jan 25, 2018
1 parent 532d8c4 commit 17ab4ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,10 @@ func (p *PostgresKeeper) postgresKeeperSM(pctx context.Context) {
log.Errorw("failed to start postgres", zap.Error(err))
return
}
if err = pgm.WaitReady(cluster.DefaultDBWaitReadyTimeout); err != nil {
log.Errorw("timeout waiting for instance to be ready", zap.Error(err))
return
}
started = true
}

Expand Down

0 comments on commit 17ab4ef

Please sign in to comment.