Operator shuts down leader pod when setting standby count to 0

Description:

I am using the Percona PostgreSQL operator 1.4. I have observed that when I set the standby count from 2 to 0 the operator always stops the pods with the name <pod_name>-repl1 and <pod_name>-repl2, and leaves <pod_name> running.
This behavior seems strange, since -repl1 and -repl2 can become the leader pods at any time.

Can someone explain to me why this is the case? I am very new to this and believe I am missing something fundamental.

Steps to Reproduce:

Make -repl1 or -repl2 the leader and then set standby count from > 0 to 0.

Version:

Percona PostgreSQL operator 1.4.

Logs:

[If applicable, include any relevant log files or error messages]

Expected Result:

[What the user expected to see or happen before the issue occurred]

Actual Result:

[What actually happened when the user encountered the issue]

Additional Information:

[Include any additional information that could be helpful to diagnose the issue, such as browser or device information]

Hello @Ma_G ,

yeah, this is one of the design flaws that we have in the operator version 1.
I would suggest to try out operator v2 instead, it has much better architecture and design. Also it detects the primary and kills replicas first for your specific case.

Is it an option for you to try v2 operator?

Hi Sergey.

Thank you for your response. I would like to test out operator version 2, but it is not available for OpenShift yet. As soon as it is, I will switch to it.

Kind regards,

Manuel

Hi @Ma_G, we will try to add support for OpenShift in the next PG v2 release.