icingaweb2-module-director/library/Director/Core
Eric Lippmann d9b75c4a86 pgsql: Fix unexpected removal of current deployment
The director automatically removes uncollected deployments if they're
older than the running one. Deployments are uncollected if Icinga 2 did
not write a status file or startup log (yet). This happens when you
manage to ship a deployment while Icinga 2 is already preparing to
restart with a deployed configuration. It also removes deployments
which were forgotten by Icinga 2 because of bugs in previous versions.

If there are uncollected deployments, the check whether they are older
than the running one is based on string comparison of the deployments'
start time. While this works for MySQL and MariaDB where the output of
timestamps is always ISO, it may fail for PostgreSQL because there the
output format is configurable. If the output format is set to report
the day first, the string comparison "fails" and removes every first
deployment of a month:

Deployment timestamp: 01-JUN-19 00:03:37 -07:00
Running timestamp: 31-MAY-19 23:54:53 -07:00

The string comparison now reports the deployment as older than the
running one and removes it.

The fix is as easy as to use timestamps for the comparison.
2019-07-01 15:04:19 +02:00
..
CoreApi.php pgsql: Fix unexpected removal of current deployment 2019-07-01 15:04:19 +02:00
DeploymentApiInterface.php Settings, CoreApi: allow to configure package name 2018-06-01 16:27:00 +02:00
Json.php ImportsourceHookTable: show malformed data... 2019-04-04 13:22:39 +02:00
LegacyDeploymentApi.php legacy: Allow configuration for file modes 2018-09-18 16:31:21 +02:00
RestApiClient.php RestApiClient: do not send Connection: close... 2018-11-27 19:02:39 +01:00
RestApiResponse.php RestApi: remove outdated code, clean up, allow... 2018-11-14 08:19:25 +01:00