Acceptance of https://fedoraproject.org/wiki/Changes/Sqlite_Rpmdb essentially required that the database is converted automatically in the process. We need to handle that somehow, this bug is to track that specific goal.
Database conversions are handled by the following scheme: There's a new rpmdb-rebuild systemd service, which can be flagged to run on next reboot by creating '.rebuilddb' flag file in the rpm database directory, ie 'touch /var/lib/rpm/.rebuilddb'. This is not conversion or backend specific in any way, so it can be used to flag the database for maintenance rebuild (think VACUUM, regardless of the backend) at a time where there are no external users. During updates of rpm package, if BDB rpm database is detected (/var/lib/rpm/Packages), it's flagged for rebuild on the next reboot regardless of configured backend. This serves two purposes: convert away from BDB to the configured database, or if configured to stay on BDB for now, give it a much needed maintenance rebuild (ensure index sanity, restore performance etc) from time to time. Established in rawhide as of rpm >= 4.15.90-0.git14971.11