On Dec 3, 2009, at 9:25 AM, Jeff Johnson wrote:
>
> On Dec 1, 2009, at 5:07 AM, Bernhard Rosenkraenzer wrote:
>
>> Hi,
>> we've been using rpm5 head on our build machines for about 2 weeks now -
>> after increasing the number of locks in DB_CONFIG, it works very reliably,
>> but now the build machines are running out of diskspace because the rpm
>> database takes up several (>20) gigabytes of space.
>>
>> The files that have always been there are about the size they used to be,
>> but every rpm invocation creates a new log.000* files, each 10 MB in size.
>>
>> I can see why the rollback features they bring along can be important to
>> some people, but for desktop users who install lots of updates on
>> relatively small disks (and for developers who build lots of stuff) this
>> can be a real problem -- is there a way to limit the number/size of log.*
>> to keep it within reasonable boundaries, short of running
>>
>> cd /var/lib/rpm
>> rm -f `ls |grep -vE (Packages|DB_CONFIG)`
>> rpm --rebuilddb
>>
>> whenever it gets too large?
>>
>
> Here's the CLI commands needed to remove log files:
>
> cd /var/lib/rpm
> /usr/lib/rpm/bin/db_checkpoint -1
> /usr/lib/rpm/bin/db_archive -d
>
I've added a "no-brainer" transaction log checkpoint policy to
keep rpmdb logs from growing forever.
WORKSFORME (tested with a single package install and running db_archive -dv).
At the end of every successful call to rpmtsRun() a
checkpoint is taken. The checkpoint flushes active
information from logs into the database backing store,
and eliminates the need for persistent logs for "normal" operation,
i.e. undoing the last uncommitted transaction when
opening with DB_RECOVER on next rpm invocation.
(aside)
There is also "catastrophic" recovery, as in recreating
as much of an rpmdb as is resident in the logs, which
needs full historical logs, not just the active logs.
For now I'll leave executing "db_archive -dv" to the user
when disk space needs to be recovered.
(aside)
There's a bit that can be set in DB_CONFIG to automate removal
of logs that are not needed for "normal" recovery using
DB_LOG_AUTO_REMOVE.
Add to /var/lib/rpm/DB_CONFIG either
set_log_config db_log_auto_remove
or
set_flags db_log_auto_remove
(untested)
73 de Jeff
Received on Fri Dec 4 15:19:33 2009