Package: patroni
Version: 4.1.5-3

Hello,

the unit template [email protected] of the Debian packaging has

    # Do not restart the service if it crashes, we want to manually inspect 
database on failure
    Restart=no

(https://salsa.debian.org/postgresql/patroni/-/raw/master/debian/[email protected],
 line 36)

Upstream had the same two lines in extras/startup-scripts/patroni.service. They 
were changed to "Restart=on-failure" in 
https://github.com/patroni/patroni/pull/2372, merged on 2022-08-01 and released 
with 2.1.5. The line in debian/[email protected] was last touched in 2018 
(commit 66706ec), so it looks like the change was never carried over.

What happened to us with patroni 4.1.5-3.pgdg22.04+1 on Ubuntu 22.04:

- The kernel OOM killer killed one postgres backend on the leader.
- systemd stopped the whole unit 6 seconds later ("Failed with result 
'oom-kill'"). The unit sets no OOMPolicy, so the systemd default "stop" applies.
- The unit stayed down for 3 hours and 36 minutes, until we started it by hand. 
The node then rejoined as a replica without problems.

We now run a drop-in with Restart=on-failure. I tested on the same host that a 
unit with OOMPolicy=stop, KillMode=process and Restart=on-failure is started 
again after an OOM kill.

Is Restart=no still intended in the Debian unit? If not, could it follow 
upstream? The change would be, with upstream's wording:

-# Do not restart the service if it crashes, we want to manually inspect 
database on failure
-Restart=no
+# Restart the service if it crashed
+Restart=on-failure

Thanks for the packages.

--
Marc Pfaendler
Sourcepole AG, Zürich, Switzerland
www.sourcepole.ch
Phone: +41 44 440 77 11

Reply via email to