On Sat, Jan 01, 2022 at 12:52:57PM -0500, Matthew Miller wrote:
> Given that the "shared-memory file contains no persistent
content",
> it seems like "rpmdb.sqlite-shm" could be a symlink to
> /dev/shm/rpmdb.sqlite-shm", or to some other tmpfs location.
It does seem like maybe it could. I'd definitely like someone who is an
expert in area this to figure out if that's right before we try any such
thing.
That said, from
https://sqlite.org/walformat.html#the_wal_index_or_shm_file:
Since the content of the shm file does not need to be preserved across a
crash, the shm file is never fsync()-ed to disk. In fact, if there were a
mechanism by which SQLite could tell the operating system to never
persist the shm file to disk but always hold it in cache memory, SQLite
would use that mechanism to avoid any unnecessary disk I/O associated
with the shm file. However, no such mechanism exists in standard posix.
... sounds promising.
_However_, I'm not sure if this is something best done at the filesystem
level (what recreates it at as a symlink if the file is removed?) or in rpm
or DNF — or in SQLite itself, if they'd accept something that isn't
"standard posix".
--
Matthew Miller
<mattdm(a)fedoraproject.org>
Fedora Project Leader