Bug 333807 - baloo_file_cleaner commits too often
Summary: baloo_file_cleaner commits too often
Status: RESOLVED FIXED
Alias: None
Product: Baloo
Classification: Unmaintained
Component: Baloo File Daemon (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Vishesh Handa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-24 06:44 UTC by 191c4ec3
Modified: 2014-04-25 15:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.13.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 191c4ec3 2014-04-24 06:44:08 UTC
Right now the baloo_file_cleaner utility commits its changes to the database after every file beyond 1000 files removed.  Instead, it should commit each time another set of 1000 files is removed.



Reproducible: Always

Steps to Reproduce:
1. Have >1000 extraneous files in a Baloo database that need to be removed from the index
2. Run baloo_file_cleaner and watch the output stream
3. Observe processing speed decrease
Actual Results:  
After the 1001st file, each time a file is removed a new database transaction is committed.  This leads to extra disk activity, and the speed decrease sometimes causes Baloo to continue indexing files in blocked folders.

Expected Results:  
The changes should only be committed after every batch of 1000 files removed.

Fix:
In baloo/src/file/cleaner/cleaner.cpp:85
+        if (numDocuments > 0 && numDocuments % 1000 == 0) {
-        if (numDocuments >= 1000) {
Comment 1 Vishesh Handa 2014-04-25 15:06:27 UTC
Git commit 8b7b9cf036e9155a3eb3a15bbf70a5d7a78ea2f6 by Vishesh Handa.
Committed on 24/04/2014 at 17:29.
Pushed by vhanda into branch 'KDE/4.13'.

Cleaner: Do not commit each time after 1000 documents

Patch submitted by 191c4ec3@opayq.com
FIXED-IN: 4.13.1

M  +1    -1    src/file/cleaner/cleaner.cpp

http://commits.kde.org/baloo/8b7b9cf036e9155a3eb3a15bbf70a5d7a78ea2f6