vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on "Patroni" and DCS "etcd" or "consul"). Automating with Ansible.
MIT License
1.29k stars 352 forks source link

Disable 'pgdg' repo during system packages installation (RHEL) #561

Closed vitabaks closed 3 months ago

vitabaks commented 3 months ago

We encountered an issue where the python3-psycopg2 package, installed from the pgdg-common repository (published on 23-Jan-2024), caused compatibility problems with Patroni on RHEL 8 distributions due to version 2.9.9 of the package.

Patroni log:

Jan 24 09:23:33 pgnode01 systemd[1]: Started Runners to orchestrate a high-availability PostgreSQL - Patroni.
Jan 24 09:23:33 pgnode01 patroni[10661]: FATAL: Patroni requires psycopg2>=2.5.4, psycopg2-binary, or psycopg>=3.0.0

To solve this problem, we now exclude pgdg repositories during the installation of system packages in order to install system packages (including python3-psycopg2) from system repositories, and not from pgdg.

Before:

[root@pgnode01 /]# yum list installed | grep psycopg
python3-psycopg2.x86_64                   2.9.9-2PGDG.rhel8                                @pgdg-common     

After:

[root@pgnode01 /]# yum list installed | grep psycopg
python3-psycopg2.x86_64            2.7.5-7.el8                                      @appstream   

Additionally: