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 408F7431FD0 for ; Sun, 18 Dec 2011 10:34:15 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.29 X-Spam-Level: X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] autolearn=disabled 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 tXInEw0d6fjY for ; Sun, 18 Dec 2011 10:34:14 -0800 (PST) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 99129431FB6 for ; Sun, 18 Dec 2011 10:34:14 -0800 (PST) Received: from zancas.localnet (fctnnbsc36w-156034079193.pppoe-dynamic.High-Speed.nb.bellaliant.net [156.34.79.193]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pBIIYALd013972 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Sun, 18 Dec 2011 14:34:10 -0400 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1RcLYn-00080s-Jj; Sun, 18 Dec 2011 14:34:09 -0400 From: David Bremner To: Austin Clements Subject: Re: More ideas about logging. In-Reply-To: <20111216040722.GC12245@mit.edu> References: <87obv9i7y3.fsf@zancas.localnet> <20111216040722.GC12245@mit.edu> User-Agent: Notmuch/0.10.2+103~gd823dc2 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sun, 18 Dec 2011 14:34:00 -0400 Message-ID: <87hb0xbug7.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: Notmuch Mail X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Sun, 18 Dec 2011 18:34:15 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Thu, 15 Dec 2011 23:07:22 -0500, Austin Clements wrot= e: > Quoth David Bremner on Dec 15 at 10:09 pm: >=20 > The trouble with this approach is that the OS doesn't have to flush > logfile to the disk platters in any particular order relative to the > updates to Xapian. So, after someone trips over your plug, you could > come back with Xapian saying you have 500 log entries when your > logfile comes back with only 20. The only way I know of to fix this > is to fsync after the logfile write, which would obviously have > performance issues. But maybe there are cleverer ways? What about just declaring the log invalid in this case and forcing a "slow-sync"? It seems it should be no harder to detect the log being behind xapian than it would be to detect it being ahead. Another idea would be to replace logging with mkdir(2) and creat(2); I made some experiments in branch 'tree-dump' in repo =20=20=20=20=20 git://pivot.cs.unb.ca/notmuch This generates a tree of empty files in the style of nmbug (which an extra layer of directories at the to help prevent file system explosion). It isn't super fast as a way to dump (probably at least 10x slower than the file based methods). On the other hand, on this machine (an i7 950 with a spinning disk) it takes about 1 ms per tag to write (i.e. 175k tags take about 160s). It is completely IO bound, so I would expect it be faster on SSD. I am running lvm on top of dm-crypt. The more worrying part is disk usage; the tag tree for 200k messages uses 400k inodes, and 836M of apparent disk usage (according to du) the same tags in "sup" format take 11M. Maybe this could be usefull if combined with some scheme to only dump tags not covered by maildir (for those using maildir flag synching already) d --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iJwEAQECAAYFAk7uMhgACgkQTiiN/0Um85kVPwP/XSPeyr5gTeNrKlSiFyTyxPAm tfYmEwNjsp7U+LhGiM/fjZZsM0QVoUOG1Z+M2Pxk0XKThsfSt6yckWevgil7nUoD ZVOQ0Uea47+28Y4biBWSxAhcqQRa6ZsEDDDbfdhrh+xeOT2OHl6GVC1glQTzkOzP 5Xk44VpXlGsxRnMYW9E= =7SuZ -----END PGP SIGNATURE----- --=-=-=--