Incident-Report: Patroni Failure Due to Time Travel
Summary: Machine restarted due to failure, NTP service corrected PG time after PG startup, causing Patroni to fail to start.
The failure information in Patroni is shown as follows:
When patroni process start time and pid time are inconsistent, it assumes: postgres is not running.
If the two times differ by more than 30 seconds, patroni fails and cannot start.
The code that prints the error message is:
Also discovered a BUG in Patroni: https://github.com/zalando/patroni/issues/811 The two timestamps in the error message are reversed.
Lessons learned: NTP time synchronization is very important
