https://bugs.kde.org/show_bug.cgi?id=525652

            Bug ID: 525652
           Summary: baloo clear directory leaks files in the index even
                    after deletion
    Classification: Frameworks and Libraries
           Product: frameworks-baloo
      Version First 6.25.0
       Reported In:
          Platform: KDE Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

DESCRIPTION
`balooctl6 clear <directory>` leaves files and sub-directories in the index
with an empty path.

The files and sub-directories are still present in the index.
Their path can't be reconstructed since the parent is missing from
IdFilenameDB.
As a result, the entries will never be removed from the index, even when the
files are removed from the disk.

Realistic scenario:
1. Make baloo index a big directory, e.g. linux-git
2. balooctl6 config add excludeFilters linux-git
3. "It's still indexed, how do I remove the files from the index?"
4. balooctl6 clear linux-git
5. later, delete linux-git. Since the paths can't be reconstructed for the
watcher, the index still contains entries of the project.

STEPS TO REPRODUCE
1. baloosearch6 --id abc # nothing
2. mkdir abc-directory
3. touch abc-directory/abc.txt
4. baloosearch6 --id abc # 2 items (e.g. a9848eeb1855ec for the directory and
a9848feb1855ec for the file)
5. balooctl6 clear abc-directory
6. rm abc-directory/abc.txt -rf

OBSERVED RESULT
7. baloosearch6 --id abc # 1 item (e.g. a9848feb1855ec), the path is empty
8. balooshow6 --x a9848feb1855ec # confirm it has "File Name Terms: Fabc Ftxt"

In krunner, "abc" shows a file without name. Trying to open it shows the error
"Malformed url baloosearch".

EXPECTED RESULT
clear also removes the files and sub-directories
baloo automatically removes entries with no parent (if idFilenameDb.get at
src/engine/documenturldb.cpp:182 doesn't find a path)

SOFTWARE/OS VERSIONS
Operating System: CachyOS Linux ; KDE Linux 20260323
KDE Plasma Version: 6.7.5 ; 6.6.80
KDE Frameworks Version: 6.30.0 ; 6.25.0
Qt Version: 6.11.2 ; 6.10.2

ADDITIONAL INFORMATION
Transaction::checkFsTree correctly identifies the leaks, but it's currently
behind the commented command "balooctl6 checkDb". I tried it by commenting out
checkPostingDbinTermsDb.

balooctl disable/enable fix the issue when doing a clear only since the
directory is re-added. However, only a purge can remove the entries when the
directory is excluded.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to