Open mskarbek opened 1 year ago
@mheon PTAL
That's intentional as the sqlite DB may be used to store images/containers in a very distant future. @mskarbek can you elaborate why you think it's a bug?
Bug in a sense: "it doesn't behave as configured and expected". On some installations, I have to deal with partitions size and layout enforced by policies, so I keep state, containers and volumes in separate locations to deal with occasional containers' storage lack of space, which almost always meant state corruption until I moved it to /var/lib/libpod
on root partition. With separation, lack of space is recoverable without full state restart. I'm afraid that the SQLite backend won't be immune to corruption either in this case.
@mheon WDYT?
I think we can alter the DB loading logic to check for both the current directory and the more-standard Libpod static directory where we put BoltDB, and change DB create logic to create in the static dir by default. This should ensure no breakage, put the DB in a more predictable location, and if we do eventually have a c/storage DB we should still use it because the DB is initialized after c/storage, which presumably will have already made its own sqlite DB for us to use.
A friendly reminder that this issue had no activity for 30 days.
@mheon is this something we need before we switch to sqlite?
Not essential, I think - the change is different from expectations but unlikely to cause serious issue.
Issue Description
When you specify separate
static_dir
(/var/lib/libpod
in my case) boltdb backed uses it to store podman data. After upgrading to 4.5.1-4.el9 from CeontOS Stream and changing the db backend to SQLite, new db file is placed in/var/lib/containers/storage
ignoringstatic_dir
configuration.Steps to reproduce the issue
Steps to reproduce the issue
podman run -it --rm ubi9/ubi:9.2
dnf install https://kojihub.stream.centos.org/kojifiles/packages/podman/4.5.1/4.el9/x86_64/podman-4.5.1-4.el9.x86_64.rpm
cp /usr/share/containers/containers.conf /etc/containers/
sed -i 's/#static_dir.*/static_dir = "\/var\/lib\/libpod"/' /etc/containers/containers.conf
podman info|grep databaseBackend
->databaseBackend: boltdb
ls /var/lib/libpod/
->bolt_state.db
rm -rf /var/lib/libpod/*
sed -i 's/\[engine\]/\[engine\]\ndatabase_backend = "sqlite"/' /etc/containers/containers.conf
podman info|grep databaseBackend
->databaseBackend: sqlite
ls /var/lib/libpod/
-> emptyls /var/lib/containers/storage/
->db.sql
, WAL and other SQLite related filesDescribe the results you received
SQLite backed places db file in a wrong directory ignoring
static_dir
configuration.Describe the results you expected
SQLite backend correctly places Podman state in configured directory.
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting