# Operator shuts down leader pod when setting standby count to 0

**URL:** <https://forums.percona.com/t/operator-shuts-down-leader-pod-when-setting-standby-count-to-0/24848>\
**Category:** Percona Operator for PostgreSQL\
**Created:** [August 31, 2023, 2:45pm UTC](https://forums.percona.com/t/operator-shuts-down-leader-pod-when-setting-standby-count-to-0/24848 "2023-08-31T14:45:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ma\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ma_g/32/12537_2.png) [@Ma\_G](https://forums.percona.com/u/Ma_G)\
**Post date:** [August 31, 2023, 2:45pm UTC](https://forums.percona.com/t/operator-shuts-down-leader-pod-when-setting-standby-count-to-0/24848/1 "2023-08-31T14:45:51Z")

</div>

## 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]

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [September 4, 2023, 7:56am UTC](https://forums.percona.com/t/operator-shuts-down-leader-pod-when-setting-standby-count-to-0/24848/2 "2023-09-04T07:56:46Z")

</div>

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](https://docs.percona.com/percona-operator-for-postgresql/2.0/helm.html) 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?

---

<div class="post-metadata">

**Author:** ![Ma\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ma_g/32/12537_2.png) [@Ma\_G](https://forums.percona.com/u/Ma_G)\
**Post date:** [September 4, 2023, 10:23am UTC](https://forums.percona.com/t/operator-shuts-down-leader-pod-when-setting-standby-count-to-0/24848/3 "2023-09-04T10:23:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Slava\_Sarzhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/slava_sarzhan/32/3196_2.png) [@Slava\_Sarzhan](https://forums.percona.com/u/Slava_Sarzhan)\
**Post date:** [September 11, 2023, 5:18pm UTC](https://forums.percona.com/t/operator-shuts-down-leader-pod-when-setting-standby-count-to-0/24848/4 "2023-09-11T17:18:52Z")

</div>

> [@Ma\_G](#):
>
> OpenShift

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