Commit Graph

37 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 65e60a6ed5 indexer: make faster
Remove an (apparently) unneeded lock which help back much of the multi-core
handing.
2022-06-07 23:06:25 +03:00
Dirk-Jan C. Binnema 9af9d0fa94 indexer/store: avoid completed callback
This cause havoc / race conditions.
2022-05-18 20:16:48 +03:00
Dirk-Jan C. Binnema 4edbe01aa0 indexer: add extra fsm state "finishing" to fix some races
As reported by helgrind
2022-05-13 23:00:20 +03:00
Dirk-Jan C. Binnema 2e9666af0b store/info: Gather some usage statistics
Keep track of the latest-change/latest-index.
2022-05-10 08:16:47 +03:00
Dirk-Jan C. Binnema 5da066a59e indexer: use ctime, not mtime
So we update if _anything_ changes with the file, not just the contents.
2022-05-05 01:38:25 +03:00
Dirk-Jan C. Binnema 525fef479a store: update to use Message; big cleanup
Remove much of the message processing from the store
2022-04-30 10:40:45 +03:00
Dirk-Jan C. Binnema 3086238b33 store: expose metadata()/set_metadata()
Allow for storing metadata in the database, and consider the cache.
2022-02-14 11:12:26 +02:00
Dirk-Jan C. Binnema 3820118246 store: rename "metadata" into "properties"
properties are the constant (for the duration) values for a store; metadata may
change, so reserve that name for that.
2022-02-14 11:12:26 +02:00
Dirk-Jan C. Binnema 18ddbe06e6 indexer: fix some threading issues with Progress
Make it a const object with atomic members.
2022-02-07 20:49:43 +02:00
Dirk-Jan C. Binnema a628f214a1 index: fix thread-sanitizer issue
Need a lock to access workers_;
2022-02-07 18:03:53 +02:00
Dirk-Jan C. Binnema 05393ba797 index: save/commit metadata after messages
Ensure the metadata (dirstamps) for messages are only written / committed _after_
the accompanying message have been written / committed.

This avoids missing updates when indexing gets terminated unexpectedly.
2022-02-03 23:04:18 +02:00
Dirk-Jan C. Binnema 0ade4ecfa7 indexer: fix race condition
It was possible for the worker to stop before the work was even started; and
then we might wait forever for the queue to become empty.
2021-11-22 21:52:01 +02:00
Dirk-Jan C. Binnema f71c05805c build: Add some Xapian deps
Fixes: issue #2178.
2021-11-12 23:11:45 +02:00
Dirk-Jan C. Binnema 503d7224e0 mu: update the index 'processed' -> 'checked'
The 'processed' statistic for indexing was more-or-less synonymous for
'updated'; let's change to something more useful, 'checked' which roughly means
the number of messages checked for updates (typically a cheap timestamp check).
2021-11-10 22:32:28 +02:00
Dirk-Jan C. Binnema 4c0d8572d8 store/indexer: move transaction handling to store
Move the transaction handling code inside Store, simplifying the indexer.
2021-11-09 22:43:11 +02:00
Dirk-Jan C. Binnema 6bea54805f build: fix compiler warning
guile: some clang warning

and ensure we get the right Xapian in all places, and fileno is defined.
2021-11-05 09:02:24 +02:00
Dirk-Jan C. Binnema 1c851315ca build: ensure correct xapian.h is found 2021-11-03 22:13:49 +02:00
Dirk-Jan C. Binnema e46347aa54 lib/index/scanner: tidy up a bit
Use strcmp instead of hand-optimized. Avoid tmp/ directories.
2021-10-22 08:33:51 +03:00
Dirk-Jan C. Binnema 89014ecd06 index/store: simplify transaction handling
only have transactions for indexing, and make it opportunistic. All other ops do
not use transactions.
2021-10-20 20:14:25 +03:00
Dirk-Jan C. Binnema 3dd721d5a3 clang-format: update c/cc coding style
Update all cc code using .clang-format; please do so as well for future PRs
etc.; emacs has a handy 'clang-format' mode to make this automatic.

For comparing old changes with git blame, we can disregard this one using
--ignore-rev

(see https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame )
2021-10-20 12:26:16 +03:00
Dirk-Jan C. Binnema 87ac89b082 index: rely less on dir tstamp when indexing
Let's use the _current time_ (time(NULL)) instead of the dir-tstamp for a maildir;
this avoids re-indexing mail where the mails have a newer time, but their
directory hasn't (e.g. 'touch')

Experimental, let see how this works.
2021-09-02 23:16:24 +03:00
Dirk-Jan C. Binnema b465c1f779 index: make lazy check less lazy
We got many reports where the 'lazy check' didn't work too well for
people... so make it a bit less lazy, so it'll just work for more
people.

In practice, never skip _directories_ unless they're leaf directories;
this avoids the mtime-does-not-bubble-up problem.
2021-08-12 17:56:00 +03:00
Dirk-Jan C. Binnema 1998505679 index: update removed value in progress report
Fixes: #2016
2021-07-29 23:26:40 +03:00
Dirk-Jan C. Binnema c8a2151cb9 mu: use g_strerror instead of strerror
Some #includes were missing for the latter (but only noticeable on some
systems - e.g., build breaks on Cygwin).

So let's replace with something that works equally everywhere.

Fixes: #2060
2021-07-29 00:02:30 +03:00
Dirk-Jan C. Binnema 7fa80f77e9 index: don't assume very fast machine cfg drive
The scanner had a timeout for scanning, which doesn't work too well with
machine with rel. fast disks / rel. slow machines. Which I don't happen
to have!

Let's remove the timeout, should help with getting unwanted timeouts
which would cut short the indexing.
2021-07-28 17:04:39 +03:00
Dirk-Jan C. Binnema 7a70942e67 build: experimental support for the meson build system 2021-02-12 00:49:35 +02:00
Dirk-Jan C. Binnema a3865d6ba9 index: wait with cleanup until work-queue is empty 2021-01-15 21:07:38 +02:00
Dirk-Jan C. Binnema 3f4e0cff62 mu-indexer: clean up state management 2020-11-15 17:20:52 +02:00
Dirk-Jan C. Binnema f7452761cb index: improve error handling 2020-11-07 11:43:11 +02:00
Dirk-Jan C. Binnema ed4a640c39 lib/query: refactor & rework
- Move the lib/query/ stuff up a level into lib/
- Associate directly with the Query object
- Rework the Query object to be C++ rather than mixed with C
- Update all dependencies, tests
2020-11-04 23:35:30 +02:00
Dirk-Jan C. Binnema 2135844e1b fix some compiler warnings 2020-11-01 14:25:25 +02:00
Dirk-Jan C. Binnema 9995d28927 mu: indexer: update dirstamp with statbuf st_mtime 2020-10-14 00:09:32 +03:00
Jonas Bernoulli b711ad9151 Fix typos 2020-07-25 16:46:47 +02:00
Dirk-Jan C. Binnema 148c906d8a fix compilation error / clang warnings 2020-07-25 11:26:08 +03:00
damon-kwok 689fd60181 Added missing include files 2020-07-13 15:02:18 +08:00
Alex Bennée f40178fe8a lib/index: fix deadlock when mu4e-index-cleanup is nil (#1749)
If the user has wants to postpone clean-up we shouldn't lock the
indexer waiting for something that will never happen. Clear the flag
event though we are actually skipping cleanup.
2020-07-06 20:49:04 +01:00
Dirk-Jan C. Binnema 4e6bd7dfdf lib/index: Implement new indexer
Implement a new message indexer consisting of a single-threaded scanner
and a multi-threaded indexer.

This allows for a number of optimizations as well as background
indexing, though this initial version should be behave similar to the
old indexer.
2020-06-27 17:07:00 +03:00