GNOME Bugzilla – Bug 750394
libtracker-miner: Keep a monitor on root index tree files on deletion
Last modified: 2015-07-06 08:43:23 UTC
See the attached patch. This can be reproduced with something like: $ gsettings set org.freedesktop.Tracker.Miner.Files index-recursive-directories ['&MUSIC'] $ tracker-search 'some album name from your music' # expect results $ mv ~/Music ~/Music-moved $ tracker-search 'some album name from your music' # expect nothing $ mv ~/Music-moved ~/Music $ tracker-search 'some album name from your music' # expect results, actually get nothing (bug)
Created attachment 304579 [details] [review] libtracker-miner: Keep a monitor on root index tree files on deletion If Tracker is running with some index-recursive-directories set (for example, ~/Music), and one of those directories is moved, then the file monitor watching for its existence is deleted. This means that if it is then moved back to the location listed in index-recursive-directories, its renewed existence is not detected, and its contents are not re-indexed. Fix this by keeping a monitor around on a directory if that directory is listed as an index tree root, even if the directory is deleted.
Review of attachment 304579 [details] [review]: Nice catch Philip :). Just a minor comment, feel free to push after that. ::: src/libtracker-miner/tracker-monitor.c @@ +1606,3 @@ while (g_hash_table_iter_next (&iter, &iter_file, &iter_file_monitor)) { if (!g_file_has_prefix (iter_file, file) && + !(remove_top_level && g_file_equal (iter_file, file))) { The amount of double negatives makes my head explode a bit here :). Would be really nice if you could split this into a separate inline is_file_contained(file,child,include_parent) or somesuch. Note to self, we should get rid of the giant hashtable and store info as TrackerFileSystem data at some point, it will surely help on performance here.
Created attachment 306898 [details] [review] libtracker-miner: Keep a monitor on root index tree files on deletion If Tracker is running with some index-recursive-directories set (for example, ~/Music), and one of those directories is moved, then the file monitor watching for its existence is deleted. This means that if it is then moved back to the location listed in index-recursive-directories, its renewed existence is not detected, and its contents are not re-indexed. Fix this by keeping a monitor around on a directory if that directory is listed as an index tree root, even if the directory is deleted.
t push pwith :wip # Bug 750394 - libtracker-miner: Keep a monitor on root index tree files on deletion - NEW Thanks for the review. Pushed the updated patch with that prefix logic split out and commented. Attachment 306898 [details] pushed as 0ca8361 - libtracker-miner: Keep a monitor on root index tree files on deletion