Hi,

the problem with bareos-dbcheck is that it executes lots of DELETE
statements of which each deletes only a single row. So each time
it outputs "Deleting 300000 orphaned Filename records", it executes
300000 DELETE statements. We are planning to optimize this in
the future, it should be much faster using DELETE statments that
delete lots of records in one statement instead.

Contributions and proposals for optimiziation are for sure welcome,
the source code of bareos-dbcheck is at
https://github.com/bareos/bareos/blob/master/src/dird/dbcheck.c

Regards,

Stephan

On 05/31/2017 04:43 PM, Jacob Keyes wrote:
> Hey guys,
> 
> I recently removed a few (<10) old clients (deleted job and client config 
> files) and then started bareos-dbcheck (with director shut down) to get rid 
> of the orphaned database records. My problem is: it takes forever. Yesterday 
> dbcheck ran the whole day until i aborted to allow the nightly backups to 
> run, and today it also didn't manage to pull through. 
> 
> The output is as follows:
> /usr/sbin/bareos-dbcheck -c /etc/bareos/bareos-dir.conf -b -f -D mysql
> Checking for Paths without a trailing slash
> Found 0 bad Path records.
> Checking for Filenames with a trailing slash
> Found 0 bad Filename 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!
> Pruning orphaned Path entries isn't possible when using BVFS.
> Checking for orphaned Filename entries. This may take some time!
> Found 300000 orphaned Filename records.
> Deleting 300000 orphaned Filename records.
> Found 300000 orphaned Filename records.
> Deleting 300000 orphaned Filename records.
> and so on...
> 
> We use mysql, the 12gb big database is on an SSD storage and I created 
> indexes as stated in the bareos documentation: 
> http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-45000032.5.2
> 
> So does anyone have a clue why bareos-dbcheck takes this long? Any help would 
> be greatly appreciated!
> 

-- 
  Stephan Dühr                              [email protected]
  Bareos GmbH & Co. KG                      Phone: +49 221-630693-90
  http://www.bareos.com

  Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
  Komplementär: Bareos Verwaltungs-GmbH
  Geschäftsführer: S. Dühr, M. Außendorf, J. Steffens, Philipp Storz

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to