[PATCH v3 4/7] Add internal functions to search for alternate doc types
[notmuch-archives.git] / aa / 15c2db0223cb9639e73cc41aa3ac0316889b58
1 Return-Path: <rlb@defaultvalue.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 4DC0840D146\r
6         for <notmuch@notmuchmail.org>; Tue, 12 Oct 2010 07:33:02 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id fS9bnswz-7rI for <notmuch@notmuchmail.org>;\r
16         Tue, 12 Oct 2010 07:32:51 -0700 (PDT)\r
17 Received: from defaultvalue.org (defaultvalue.org [70.85.129.156])\r
18         by olra.theworths.org (Postfix) with ESMTP id 4E36A40D143\r
19         for <notmuch@notmuchmail.org>; Tue, 12 Oct 2010 07:32:51 -0700 (PDT)\r
20 Received: from omen.defaultvalue.org (localhost [127.0.0.1])\r
21         by defaultvalue.org (Postfix) with ESMTP id 5916190D34;\r
22         Tue, 12 Oct 2010 09:32:49 -0500 (CDT)\r
23 Received: from raven.defaultvalue.org (raven.defaultvalue.org [192.168.1.7])\r
24         by omen.defaultvalue.org (Postfix) with ESMTP id 07D8B501E2;\r
25         Tue, 12 Oct 2010 09:32:49 -0500 (CDT)\r
26 Received: by raven.defaultvalue.org (Postfix, from userid 1000)\r
27         id 0A5E87C400D; Tue, 12 Oct 2010 09:32:49 -0500 (CDT)\r
28 From: Rob Browning <rlb@defaultvalue.org>\r
29 To: david@tethera.net\r
30 Subject: Re: First draft of logging functionality.\r
31 References: <1286803617-17328-1-git-send-email-david@tethera.net>\r
32 Date: Tue, 12 Oct 2010 09:32:48 -0500\r
33 In-Reply-To: <1286803617-17328-1-git-send-email-david@tethera.net>\r
34         (david@tethera.net's message of "Mon, 11 Oct 2010 10:26:54 -0300")\r
35 Message-ID: <87sk0bxyzz.fsf@raven.defaultvalue.org>\r
36 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain; charset=us-ascii\r
39 Cc: notmuch@notmuchmail.org\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Tue, 12 Oct 2010 14:33:02 -0000\r
53 \r
54 david@tethera.net writes:\r
55 \r
56 > The patches following this message are my first attempt at\r
57 > implementing atomic logging for notmuch.  The idea is that such logs\r
58 > could be useful in synchronizing notmuch instances.\r
59 \r
60 For this to be completely safe, I suspect it may need to be adjusted to\r
61 do write ahead logging or something similar.  Otherwise operations could\r
62 be lost.\r
63 \r
64 i.e. notmuch would atomically and safely write the intended (tag)\r
65 operation to the log, then perform the tag.  On startup, notmuch would\r
66 need to scan the log to detect and apply operations that hadn't been\r
67 fully completed (presumably due to a crash).\r
68 \r
69 More generally, while thinking about sync/logging a few days ago, I\r
70 wondered about using sqlite.  That would help with atomicity, rollback,\r
71 synchronizing multiple readers/writers, etc.  It might also make\r
72 operations more efficient once we implement all the features we want.\r
73 \r
74 For example, with the log information in sqlite, a separate notmuch sync\r
75 to another machine could be reading from the log (and with limitations,\r
76 writing) in parallel with normal notmuch operations.  Depending on how\r
77 we decide to handle sync with multiple peers, the log may also need to\r
78 track which peers have seen what, prune appropriately, etc.\r
79 \r
80 Of course sqlite may not be appropriate, and would require performance\r
81 testing, etc., but we should probably think about the features we'll\r
82 eventually want, and consider how much work they're likely to require\r
83 with any given approach, regardless.\r
84 \r
85 Hope this helps\r
86 -- \r
87 Rob Browning\r
88 rlb @defaultvalue.org and @debian.org\r
89 GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4\r