How can I downgrade PXC 5.7.39 to 5.7.38

I am trying to downgrade my PXC, but I get

$ sudo apt policy percona-xtradb-cluster-server-5.7
percona-xtradb-cluster-server-5.7:
  Installed: 5.7.39-31.61-1.focal
  Candidate: 5.7.39-31.61-1.focal
  Version table:
 *** 5.7.39-31.61-1.focal 500
        500 http://repo.percona.com/percona/apt focal/main amd64 Packages
        100 /var/lib/dpkg/status

$ sudo apt install percona-xtradb-cluster-server-57=5.7.38-31.59-1.focal
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package percona-xtradb-cluster-server-57
1 Like

Hi @Aleksandar_Kostovsk1 ,

First let me ask if there is any specific reason you need to downgrade back to 5.7.38 ?

2 Likes

HI @Aleksandar_Kostovsk1
In this repo (Percona Repo) we store only latest version.
We have PXC-57 version where we store 5 latest version.
In order to enable it you should do: sudo percona-release enable pxc-57 release

1 Like

Hi @marcelo.altmann ,

In the last 3 weeks I am replacing nodes on big production PXC (due to HW issues) one-by-one and I’ve end up with 2x5.7.38 already replaces (non-masters) and the replacement for the 3rd node (master) end up with 5.7.39 (synced before I’ve noticed release difference).
So it looks easier for me to downgrade the one that is not used then upgrading those which are already used.
Less downtime to be more precise.

1 Like

Thank you @Evgeniy_Patlan for the prompt response

This enable to have the repo with older releases, but APT doesn’t want to make the downgrade

sudo percona-release enable pxc-57 release
* Enabling the Percona XtraDB Cluster 5.7 repository
<*> All done!
==> Please run "apt-get update" to apply changes

$ sudo apt-get update
...
Reading package lists... Done

sudo apt policy percona-xtradb-cluster-server-5.7
percona-xtradb-cluster-server-5.7:
  Installed: 5.7.39-31.61-1.focal
  Candidate: 5.7.39-31.61-1.focal
  Version table:
 *** 5.7.39-31.61-1.focal 500
        500 http://repo.percona.com/percona/apt focal/main amd64 Packages
        500 http://repo.percona.com/pxc-57/apt focal/main amd64 Packages
        100 /var/lib/dpkg/status
     5.7.38-31.59-1.focal 500
        500 http://repo.percona.com/pxc-57/apt focal/main amd64 Packages
...

$ sudo service mysql stop

$ sudo apt install percona-xtradb-cluster-57=5.7.38-31.59-1.focal
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  percona-xtradb-cluster-57
0 upgraded, 1 newly installed, 0 to remove and 31 not upgraded.
Need to get 0 B/5,324 B of archives.
After this operation, 10.2 kB of additional disk space will be used.
Selecting previously unselected package percona-xtradb-cluster-57.
(Reading database ... 115024 files and directories currently installed.)
Preparing to unpack .../percona-xtradb-cluster-57_5.7.38-31.59-1.focal_amd64.deb ...
Unpacking percona-xtradb-cluster-57 (5.7.38-31.59-1.focal) ...
Setting up percona-xtradb-cluster-57 (5.7.38-31.59-1.focal) ...


$ sudo service mysql start

$ sudo apt policy percona-xtradb-cluster-server-5.7
percona-xtradb-cluster-server-5.7:
  Installed: 5.7.39-31.61-1.focal
  Candidate: 5.7.39-31.61-1.focal
...

 mysql -u aleksandar -p -h `hostname` -e "select @@global.version"
+------------------+
| @@global.version |
+------------------+
| 5.7.39-42-57-log |
+------------------+

Is there any other way how to do this, maybe ?

apt-get remove percona-xtradb-cluster-57
apt-get autoremove
apt-get install percona-xtradb-cluster-57=5.7.38-31.59-1.focal
1 Like