From 17ab4ef1728647faeec47323f11d17665feaf36b Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Wed, 24 Jan 2018 11:03:43 +0100 Subject: [PATCH] keeper: add some missing waits for instance ready 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). --- cmd/keeper/keeper.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/keeper/keeper.go b/cmd/keeper/keeper.go index 2266f5674..3631d91ed 100644 --- a/cmd/keeper/keeper.go +++ b/cmd/keeper/keeper.go @@ -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 }