Page MenuHomePhabricator

Purge orphaned resources on bacula db
Open, MediumPublic

Description

I used dbcheck on bacula db to check the db integrity. While nothing weird or corruped happened, there are a lot of orphaned resources (I am sure I know when those were created, when we upgraded the db inplace instead of starting from 0). Those are not an issue for backups itself, but add noise and clutter to the db, so it would be nice to get rid of those garbage records and optimize the trables for faster operation:

Select function number: 17
Checking for Filenames with a trailing slash
Found 0 bad Filename records.
Checking for Paths without a trailing slash
Found 0 bad Path records.
Checking for duplicate Filename entries.
Found 0 duplicate Filename records.
Checking for duplicate Path entries.
Found 0 duplicate Path records.
Checking for orphaned JobMedia entries.
Checking for orphaned File entries. This may take some time!
Note. Index over the PathId column not found, that can greatly slow down dbcheck.
Create temporary index? (yes/no): yes
Create temporary index... This may take some time!
Checking for orphaned Path entries. This may take some time!
Found 300000 orphaned Path records.
Drop temporary index.
Note. Index over the FilenameId column not found, that can greatly slow down dbcheck.
Create temporary index? (yes/no): yes
Create temporary index... This may take some time!
Checking for orphaned Filename entries. This may take some time!
Found 300000 orphaned Filename records.
Drop temporary index.   
Checking for orphaned FileSet entries. This takes some time!
Found 13 orphaned FileSet records.
Checking for orphaned Client entries.
Found 14 orphaned Client records.
Checking for orphaned Job entries.
Found 0 orphaned Job records.
Checking for Admin Job entries.
Found 0 Admin Job records.
Checking for Restore Job entries.
Found 274 Restore Job records.
Checking for Verify Job entries.
Found 0 Verify Job records.

Event Timeline

jcrespo triaged this task as Medium priority.Fri, Apr 17, 9:36 PM
jcrespo added a subscriber: Marostegui.

CC @Marostegui just FYI this is what created some lag on m1 (it may happen in the future again), but will allow to remove some garbage from the db instead. You can unsub from the ticket after you read this or disable notifications.