[Rpm-maint] RFC: Relocate RPM and DNF databases to /usr

Chris Murphy lists at colorremedies.com
Wed Dec 15 21:08:59 UTC 2021


On Wed, Dec 15, 2021 at 4:09 AM Panu Matilainen <pmatilai at redhat.com> wrote:
>
> On 12/14/21 22:59, Colin Walters wrote:
> >
> >
> > On Thu, Dec 9, 2021, at 10:11 AM, Chris Murphy wrote:
> >
> >>> The change is not so simple. It is not only the movement of files from one location to another one. We store more types of data in that location - history database (sqlite), module failsafe data (yamls). In future we will store system state data (toml). Data is not only modified after RPM transactions but also by module and mark commands. What I want to say is that the change will be painful but in the proposal there are limited benefits.
> >
> > When the rpmdb was bdb and not extensible, I understand the idea of dnf having its own separate database.  But I don't understand why there are two separate sqlite databases now.
>
> The rpmdb is not hard-wired to sqlite. Also, whatever the format used
> it's strictly private to rpm except what's exposed through librpm APIs.
> So it's certainly NOT extensible in the sense that anybody wanting to
> put something package related there is free to do so.
>
> >
> > Anyways, a lot going on here and rather than point by point I'll say basically:
> >
> > It'd be great from the rpm-ostree PoV to have a shared consistent place for the rpmdb.  Last time this came up I think Panu really wanted to get the sqlite change out first, which - fair.  But now that's done, so are there any other blockers?
>
> Just the pain and misery of dealing with a fundamental change that has
> zero benefit to rpm itself. It'll be a long, long, long time before
> /var/lib/rpm is phased out of existence for good, and in the meanwhile
> us rpm f get to answer all the questions and complaints about it. I'm
> not looking forward to that.

The alternative to the proposal to switch rpmdb from /var to /usr, is
keeping it where it is. And provide matching between /usr and
/var/lib/rpm generations (or versions) by separate subvolume on Btrfs,
e.g. "varlibrpm" mounted at /var/lib/rpm. The separation is very cheap
on Btrfs, perhaps 200 KiB, because it's just a file btree. The cost is
a little more than a directory. And the snapshots only consume space
representing the difference between the snapshots.

However, for other implementations, such as  and separate file system
volumes for LVM+ext4 LVM+XFS or Stratis, it's not as cheap. Each
snapshot includes the file system journal, which varies in size.
Storage cost could be anywhere from 8 - 800 MiB per snapshot.

I'm not sure if the alternative is that great either, considering
movement is in progress to put rpmdb in /usr already.


--
Chris Murphy


More information about the Rpm-maint mailing list