Skip to content

in pod postgres doesn't restart after node switchover during Kubernetes upgrade #4796

@raschidb

Description

@raschidb

Description

Hello,

We noticed multiple time that during a kuberntes upgrade the statefullset pod executing postgres doesn't restart after switching to another node because the pid file /srv/postgres14/postmaster.pid is still present.
Is there a way to fix that ? (will a preStop command be executed ... ?)

log :
2025-11-29 13:51:41.095 UTC [942] FATAL: lock file "postmaster.pid" already exists
2025-11-29 13:51:41.095 UTC [942] HINT: Is another postmaster (PID 17) running in data directory "/srv/postgres14"?

Thank you
Rachid

Expected Results

Statefulset pod can switch to a node without manual action to delete pid file

Actual Results

perconna pmm crash due to a kubernetes upgrade

Version

PMM server 3.3.1

Steps to reproduce

upgrade kubernetes version (rancher rke2)

Relevant logs

2025-11-29 13:51:41.095 UTC [942] FATAL:  lock file "postmaster.pid" already exists
2025-11-29 13:51:41.095 UTC [942] HINT:  Is another postmaster (PID 17) running in data directory "/srv/postgres14"?

Code of Conduct

  • I agree to follow Percona Community Code of Conduct

Metadata

Metadata

Assignees

Labels

bugBug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions