Skip to content

Commit 9dd6df6

Browse files
hdurand0710oktalz
authored andcommitted
BUG/MEDIUM: reload the configuration after a failed synced configuration if servers are created
Fix the scenario where we have a failure when we sync the configuration and we scale a deployment before fixing the issue. In this scenario we were writing the configuration correctly with the new servers but not reloading. The runtime still had missing servers, it was capped to the server slots number of servers.
1 parent 5603609 commit 9dd6df6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/haproxy/api/api.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ func (c *clientNative) processServers(backendName string, configuration configur
279279
errCreateServer := configuration.CreateServer("backend", backendName, server, c.activeTransaction, 0)
280280
if errCreateServer != nil {
281281
errs.Add(configuration.EditServer(server.Name, "backend", backendName, server, c.activeTransaction, 0))
282+
} else {
283+
// Server has been created, a reload is required
284+
// It covers the case where there was a failure, scaleHAProxySrvs has already been called in a previous loop
285+
// but the sync failed (wrong config)
286+
// When the config is fixed, servers will be created
287+
instance.Reload("server '%s' created in backend '%s'", server.Name, backendName)
282288
}
283289
}
284290
return errs

0 commit comments

Comments
 (0)