Upgrading the distro PURGED the previous postgresql-10 package deleting the database data!

Bug #1825501 reported by Vihai
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgresql-11 (Ubuntu)
New
Undecided
Unassigned

Bug Description

I did a do-release-upgrade as I usually do and I usually find the new PostgreSQL package installed alongside with the previous, still working, one.

This time the upgrader PURGED the old package removing the cluster data and configuration and everything!

Luckily I had a backup from which I am restoring the data but this is causing downtime and loss of recent data.

I hope my situation had something VERY rare that caused this but I urge you to check before data loss is caused to other people.

Let me know which log files may be helpful in debugging this event.

Revision history for this message
Vihai (daniele-orlandi) wrote :

Tested on another cosmic machine and the upgrade, again, proposed the removal of postgresql-10

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hello, thanks for filing this bug in Ubuntu.

I just tried a release upgrade from Cosmic to Disco.

Beforehand, I installed "postgresql" and its dependencies on Cosmic. I got the server postgresql-10 at version 10.7.

Cluster was online:

root@cosmic-pgsql10:~# pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
10 main 5432 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log

I then issued a do-release-upgrade.

During the upgrade, I got a warning that postgresql 10 is an "obsolete major version", and it told me postgresql 11 was going to be installed, and how I could migrate from to the other. I just acknowledged it, and the upgrade continued.

In the end, the process told me some packages were going to be removed. I opted to see a list, and there were no postgresql packages in there, so I gave it an OK to continue.

The upgrade finished, and before rebooting, I got a postgresql package list to see what was installed:
root@cosmic-pgsql10:~# dpkg -l|grep postgresql
ii postgresql 11+199 all object-relational SQL database (supported version)
ii postgresql-10 10.7-0ubuntu0.18.10.1 amd64 object-relational SQL database, version 10 server
ii postgresql-11 11.2-1 amd64 object-relational SQL database, version 11 server
ii postgresql-client-10 10.7-0ubuntu0.18.10.1 amd64 front-end programs for PostgreSQL 10
ii postgresql-client-11 11.2-1 amd64 front-end programs for PostgreSQL 11
ii postgresql-client-common 199 all manager for multiple PostgreSQL client versions
ii postgresql-common 199 all PostgreSQL database-cluster manager

As can be seen, I have both postgresql 10 and 11 co-installed, and both clusters are running:
root@cosmic-pgsql10:~# pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
10 main 5432 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
11 main 5433 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log

Could you please elaborate on how you performed your testing, which packages you had installed before and after, and also please attach the upgrade logs from /var/log/dist-upgrade?

I'll mark the bug as incomplete for now. Please feel free to switch it back to "new" after you provide the requested information.

Changed in postgresql-11 (Ubuntu):
status: New → Incomplete
Revision history for this message
Vihai (daniele-orlandi) wrote :

Hello,

I'm attaching the relevant logs from /var/log/dist-upgrade

As you see, postgresql-10 was listed as Obsoleted and then in the remove_candidates

Both boxes were updated on every release from utopic and experienced the same behaviour.

Revision history for this message
Vihai (daniele-orlandi) wrote :
Revision history for this message
Vihai (daniele-orlandi) wrote :
Revision history for this message
Vihai (daniele-orlandi) wrote :
Revision history for this message
Vihai (daniele-orlandi) wrote :
Revision history for this message
Vihai (daniele-orlandi) wrote :
Changed in postgresql-11 (Ubuntu):
status: Incomplete → New
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Looks like this was fixed a few days ago, that's why I couldn't reproduce it anymore: bug #1825563

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.