* [email protected] <[email protected]> [160506 22:00]:
> for Tails we have a system that uses reprepro snapshots intensively
> (basically, a large subset of the Debian archive is snapshot'ed four
> times a day). And then, we use _removereferences (+ manually removing
> the corresponding directory in dists/) to free the snapshots we don't
> need anymore.
>
> But despite the cleanup operation (_removereferences), it seems that
> references.db keeps growing. As a result, some operations become very
> slow unless there's enough memory available to keep that file in the
> disk cache.
>
> FYI, we're talking of a (currently) 5.4 GiB references.db here.
>
> I'm sure that there must be a good reason (such as optimizing I/O) for
> the current behavior, and that's fine with me. But would it be
> possible to have one extra operation, that one could run from time to
> time, and that compacts references.db so that it uses only the disk
> space (and thus, the in-memory disk cache) that it needs?

You might want to start with checking the stats of that file to see
if there is some libdb corruption in there or only no space freed.

db*_verify db/references.db
db*_stats -d db/references.db -s references

(With the tools from the db*-util package matching the libdb version
your reprepro binary is linked against).

> And, just in case I find someone ready to implement it: any pointer to
> where and how it could be done?

It's a pity that libdb does not come with some dbX.Y_compact utility.

For a short hot-fix you might try to use db*_dump and db*_load to create
a copy of the database.

If you are willing to lose all the snapshot-information, just deleting
the references.db file and running "reprepro rereference" will also create
a file with all but the snapshot references in them.

        Bernhard R. Link
-- 
F8AC 04D5 0B9B 064B 3383  C3DA AFFC 96D1 151D FFDC

Reply via email to