Bug 29364 - rpmdb not converted on update to sqlite
Summary: rpmdb not converted on update to sqlite
Status: REOPENED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker normal
Target Milestone: ---
Assignee: RPM stack maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-12 12:31 CEST by Marc Krämer
Modified: 2023-01-19 02:00 CET (History)
5 users (show)

See Also:
Source RPM: rpm.rpm
CVE:
Status comment:


Attachments

Description Marc Krämer 2021-08-12 12:31:21 CEST
On updating older cauldron to latest state shows the following error:

Found bdb_ro Packages database while attempting sqlite backend: using bdb_ro backend.

After this, install fails until rpmdb --rebuilddb is called.

I assume this has to be triggered in post install section...
Comment 1 Jani Välimaa 2021-08-12 16:35:32 CEST
Converting should be triggered automatic on next reboot.

I don't know if converting can be done during the pkg installation and between transactions.
Comment 2 Marja Van Waes 2021-08-12 17:06:37 CEST
(In reply to Jani Välimaa from comment #1)
> Converting should be triggered automatic on next reboot.
> 
> I don't know if converting can be done during the pkg installation and
> between transactions.

Maybe someone of the rpm stack maintainers can tell, assigning to them.

Assignee: bugsquad => rpmstack
CC: (none) => marja11

Comment 3 Neal Gompa 2021-08-12 17:58:07 CEST
It's not safe to do it in between transactions either. If doing online upgrade, please reboot immediately after or run "rpm --rebuilddb".

CC: (none) => ngompa13

Comment 4 Dave Hodgins 2021-08-12 20:49:11 CEST
How will upgrades from Mageia 8 to 9 be handled?

CC: (none) => davidwhodgins

Comment 5 Pascal Terjan 2021-08-12 22:33:15 CEST
My understanding is that recent urpmi do it on startup (http://gitweb.mageia.org/software/rpm/urpmi/commit/?id=c338043e44c14fc023e6386cf62c0acf97da51be) so after rpm + urpmi etc are updated in the priority upgrade, on restarting the new urpmi would do it

CC: (none) => pterjan

Comment 6 Pascal Terjan 2021-08-12 22:35:27 CEST
Ah sorry, that code is only when using a chroot.
Comment 7 Marc Krämer 2021-08-13 13:36:20 CEST
what about using the same mechanism, that restarts urpmi after initial change of basic packages.
The current situation for an update is, that after installing basic updates (rpm, perl, ...) urpmi restarts and afterwards urpmi fails to install anything due to readonly rpmdb. So, if rpmdb --rebuilddb is triggered afterwards, everything should be fine.
Comment 8 Neal Gompa 2021-08-13 20:08:53 CEST
(In reply to Dave Hodgins from comment #4)
> How will upgrades from Mageia 8 to 9 be handled?

We should adjust our documentation so that people know to do system upgrades in a single transaction for URPMI and to reboot *immediately* afterward. That's the safest way to handle an online system upgrade.

For DNF users, we already recommend the "system-upgrade" method, which transparently handles this correctly.

The issue here is Cauldron-to-Cauldron. People don't generally reboot immediately with stuff that feels like small updates, even if they're fairly major.
Comment 9 Dave Hodgins 2021-08-13 22:50:58 CEST
The "least experienced" users will upgrade using mgaapplet when it prompts them
that a new release is available. It does not use a single transaction.
Comment 10 Manuel Hiebel 2021-08-14 09:40:34 CEST
could mageia-prepare-upgrade (used in mga3 for the usr move) help ?
Comment 11 Neal Gompa 2021-08-14 16:40:02 CEST
(In reply to Dave Hodgins from comment #9)
> The "least experienced" users will upgrade using mgaapplet when it prompts
> them
> that a new release is available. It does not use a single transaction.

That sounds like something we should fix, then.
Comment 12 Dave Hodgins 2021-08-14 22:31:31 CEST
Using a single transaction requires a lot more free space. There has to be
a better way.
Comment 13 Neal Gompa 2021-08-15 15:52:30 CEST
(In reply to Dave Hodgins from comment #12)
> Using a single transaction requires a lot more free space. There has to be
> a better way.

No. A single transaction ensures everything is properly replaced in one go, which eliminates large classes of issues when doing upgrades. For system upgrades, there's a lot less value in the split transactions because the dependency web forces a lot of it to be upgraded together anyway. But because inter-application dependencies are rarely specified at the RPM level, split upgrades tend to subtlety break things.

We already tell people to download everything in advance, which forces the free space to be allocated anyway. Going to a single transaction is not worse.
Comment 14 Thierry Vignaud 2021-10-31 04:49:25 CET
(In reply to Pascal Terjan from comment #6)
> Ah sorry, that code is only when using a chroot.

That's now fixed in git, it works in all case, even when not using --(urpmi-)-root.

Status: NEW => RESOLVED
CC: (none) => thierry.vignaud
Resolution: (none) => FIXED

Comment 15 Dave Hodgins 2022-10-25 16:29:38 CEST
Reopening due to bug 31024

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Dave Hodgins 2022-10-25 16:30:47 CEST

Priority: Normal => release_blocker

Comment 16 Dave Hodgins 2022-10-25 20:13:52 CEST
Currently rpmdb --rebuilddb --define "_db_backend sqlite" has to be run
manually during upgrades from m8 to m9.
Comment 17 Dave Hodgins 2023-01-19 02:00:24 CET
Still an issue in today's test of an upgrade using my aarch64 rpi 4b.

Note You need to log in before you can comment on or make changes to this bug.