0

Recently I found that suddenly all data directories were deleted both primary and standby. I am assuming that it happens due to failover.

Example: Suppose there are 4 nodes where 1 is primary and another 3 is standby. For example, suppose 1 and 2 at a time are Primary due to failover. Both primaries are somehow in active mode with the other two on standby.

Is it possible by pgpool to delete all(4 nodes) data directories of PostgreSQL primary and standby?

Need expert opinion.

1 Answer 1

0

After Investigation, I found pgpool changed its scripts and arguments that we pass on scripts on each version. So be careful when you configure PostgreSQL with pgpool.

Without the right version, it is very dangerous.

In my case, I found it deleted all data directories due to pgpool wrong version choice.

If you using PostgreSQL13 and configured pgpool which is for PostgreSQL11 then this could happen in case of failover.

Must choose the right version. And recheck again and again before implementing. Better to use Ansible instead of manual changes again and again.

At PostgreSQL11

failover_command = '/etc/pgpool-II/failover.sh %d %h %p %D %m %H %M %P %r %R'
follow_master_command = '/etc/pgpool-II/follow_master.sh %d %h %p %D %m %M %H %P %r %R'

At PostgreSQL13

failover_command = '/etc/pgpool-II/failover.sh %d %h %p %D %m %H %M %P %r %R %N %S'
follow_primary_command = '/etc/pgpool-II/follow_primary.sh %d %h %p %D %m %H %M %P %r %R'

PgPool Test at 2023-Sep-20: Till my last test 2023-Sep-20 this is not possible to delete primary directory because of that above wrong configuration. There should be one primary data directory. Please ignore above explanation. Above explanation partial true. It does not delete all the data directory, must have a one primary. I will update next till I am satisfied.

enter image description here

Now I am thinking it is because of split brain at pgpool due to some reason such as shared memory corruption, storage issue or something else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.