Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2C8F4431FC2; Sat, 21 Nov 2009 12:01:33 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q23isl6Uuqdi; Sat, 21 Nov 2009 12:01:32 -0800 (PST) Received: from cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E1BAF431FBF; Sat, 21 Nov 2009 12:01:31 -0800 (PST) From: Carl Worth To: Jed Brown , notmuch@notmuchmail.org In-Reply-To: <87fx87u3no.fsf@59A2.org> References: <87fx87u3no.fsf@59A2.org> Date: Sat, 21 Nov 2009 21:01:20 +0100 Message-ID: <874oon4pgv.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] Asynchronous tagging X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2009 20:01:33 -0000 On Sat, 21 Nov 2009 19:35:39 +0100, Jed Brown wrote: > I'm really enjoying notmuch, thanks! I have a minor issue and a couple > observations worth noting. Thanks, Jed! And welcome to notmuch. > 1. Changing tags (like removing inbox/unread) has really high latency. Yes, this is a known bug in Xapian (it rewrites all of the indexed terms for the email message even though you're just trying to add/remove one term). The Xapian ticket for this is here: replace_document should make minimal changes to database file http://trac.xapian.org/ticket/250 I've looked at the code, and it looks like it's going to be easy to fix. If anyone wants to try, here's the file to change: xapian-core/backends/flint/flint_database.cc And look for: // FIXME - in the case where there is overlap between the new // termlist and the old termlist, it would be better to compare the // two lists, and make the minimum set of modifications required. // This would lead to smaller changesets for replication, and // probably be faster overall So I think this might be as easy as just walking over two sorted lists looking for differences. Note that this is in the currently default "flint" backend, but the Xapian folks are probably more interested in fixing the in-development "chert" backend. So the patch to get upstreamed there will probably also fix: xapian-core/backends/chert/chert_database.cc (I'm hoping the fix will be the same---an identical comment exists there.) Also, if you want to experiment with the chert backend, compile current Xapian source and run notmuch with XAPIAN_PREFER_CHERT=1. I haven't tried that yet, but there are claims that a chert database can be 40% smaller than an equivalent flint database. > 2. I have 'notmuch new' in an offlineimap postsync hook, but > notmuch-search-refresh-view occasionally complains that another process > has the lock (since I might press '=' when 'notmuch new' is running). > Waiting a moment and trying again works fine, but it would be nice to > clean this up eventually. Chris Wilson just contributed a patch to enable read-only usage of notmuch while another notmuch process holds the write lock. This should be very nice, (and means that new users will be able to start playing with notmuch even while the initial index creation is happening). > 3. I had initially put 'notmuch new' in a cron job (instead of > offlineimap postsync hook) and new/search would sometimes complain about > missing files in the maildir. The first time this happened, it did not > correct itself and I ended up reimporting the database (I had moved some > things around so I could have been at fault). Since then I have seen > these errors on a couple occasions, but they always go away upon > rerunning 'notmuch new'. My guess is that it has to do with offlineimap > changing flags so I moved 'notmuch new' to the postsync hook and have > not seen the errors since. If it is important that notmuch never runs > concurrently with an offlineimap sync, it should eventually go in the > docs. Thanks for the pointer. Does offlineimap use tmp while it's delivering message and then move things to new? If so, then maybe all we need to do to fix notmuch to not look into tmp directories? -Carl