module-postgresql/spec/unit
Ken Barber 5df36cf1f7 (GH-198) Fix race condition on postgresql startup
This patch is a fix for the race condition that keeps occuring during
postgresql setup. Its very rare on its own, but when you are using this
module in a CI environment it happens quite frequently.

Basically what happens is that sometimes the service will announce the
database has started, but really it is still working in the background.
Sometimes the unix socket may not be listening, and sometimes the
system is still loading and you get a weird client error.

The fix itself is a modification to postgresql::validate_db_connection
so that it is able to connect on the local unix socket, plus retry
until the database is available.

This new and improved validate_db_connection can then be put into the
build pipeline (in the service class in particular) to ensure the
database is started before continuing on with the remaining steps.

This in effect blocks the puppet module from continuing until the
postgresql database is fully started and able to receive connections
which is perfect.

Tests and documentation provided.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-10-24 00:33:45 +01:00
..
classes (GH-198) Fix race condition on postgresql startup 2013-10-24 00:33:45 +01:00
defines (GH-198) Fix race condition on postgresql startup 2013-10-24 00:33:45 +01:00
functions Alter escaping in postgresql::config::afterservice 2013-07-23 13:04:46 +01:00
provider/postgresql_conf test and fix for dots breaking config keys 2013-10-18 23:02:11 +00:00
puppet add search_path attribute to postgresql_psql resource 2013-10-14 22:00:21 +00:00
type periods are valid in configuration variables also 2013-10-18 21:33:37 +00:00