[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / f5 / a8a494c5b10206c5f1f940fd7c9a96e2b1bf55
1 Return-Path: <m.walters@qmul.ac.uk>\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 17198431FBC\r
6         for <notmuch@notmuchmail.org>; Sun, 27 Jul 2014 02:36:09 -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: 0.502\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.502 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id lWWKcPL7ktD6 for <notmuch@notmuchmail.org>;\r
17         Sun, 27 Jul 2014 02:36:01 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 740E7431FB6\r
22         for <notmuch@notmuchmail.org>; Sun, 27 Jul 2014 02:36:01 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1XBKs2-0006Xu-HR; Sun, 27 Jul 2014 10:35:58 +0100\r
27 Received: from 94.196.249.126.threembb.co.uk ([94.196.249.126] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1XBKs1-0003Km-Gn; Sun, 27 Jul 2014 10:35:58 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH 08/14] lib: Simplify upgrade code using a transaction\r
34 In-Reply-To: <1406433173-19169-9-git-send-email-amdragon@mit.edu>\r
35 References: <1406433173-19169-1-git-send-email-amdragon@mit.edu>\r
36         <1406433173-19169-9-git-send-email-amdragon@mit.edu>\r
37 User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Sun, 27 Jul 2014 10:35:53 +0100\r
40 Message-ID: <87vbqjywhy.fsf@qmul.ac.uk>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-Sender-Host-Address: 94.196.249.126\r
44 X-QM-Geographic: According to ripencc,\r
45         this message was delivered by a machine in Britain (UK) (GB).\r
46 X-QM-SPAM-Info: Sender has good ham record.  :)\r
47 X-QM-Body-MD5: 429daf3b5226ec8484a887b40bb937aa (of first 20000 bytes)\r
48 X-SpamAssassin-Score: -0.1\r
49 X-SpamAssassin-SpamBar: /\r
50 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
51         determine if it is\r
52         spam. We require at least 5.0 points to mark a message as spam.\r
53         This message scored -0.1 points.\r
54         Summary of the scoring: \r
55         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
56         provider *      (markwalters1009[at]gmail.com)\r
57         * -0.1 AWL AWL: From: address is in the auto white-list\r
58 X-QM-Scan-Virus: ClamAV says the message is clean\r
59 X-BeenThere: notmuch@notmuchmail.org\r
60 X-Mailman-Version: 2.1.13\r
61 Precedence: list\r
62 List-Id: "Use and development of the notmuch mail system."\r
63         <notmuch.notmuchmail.org>\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
67 List-Post: <mailto:notmuch@notmuchmail.org>\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
71 X-List-Received-Date: Sun, 27 Jul 2014 09:36:09 -0000\r
72 \r
73 \r
74 Hi\r
75 \r
76 On Sun, 27 Jul 2014, Austin Clements <amdragon@MIT.EDU> wrote:\r
77 > Previously, the upgrade was organized as two passes -- an upgrade\r
78 > pass, and a separate cleanup pass -- so the database was always in a\r
79 > valid state.  This change substantially simplifies this code by\r
80 > performing the upgrade in a transaction and combining both passes in\r
81 > to one.  This 1) eliminates a lot of duplicate code between the\r
82 > passes, 2) speeds up the upgrade process, 3) makes progress reporting\r
83 > more accurate, 4) eliminates the potential for stale data if the\r
84 > upgrade is interrupted during the cleanup pass, and 5) makes it easier\r
85 > to reason about the safety of the upgrade code.\r
86 \r
87 I like this but I wonder if it has a side effect: I think with the\r
88 current code the user can interrupt the upgrade (ctrl-c) and continue\r
89 roughly where it left off. This looks like it means the whole upgrade\r
90 needs to be done in one go. Will this be a problem on large mail stores\r
91 (eg rlb with over 1M messages)?\r
92 \r
93 I am not sure what could be done during the interrupted upgrade before\r
94 so maybe this is not a problem.\r
95 \r
96 Best wishes\r
97 \r
98 Mark\r
99 \r
100 \r
101 > ---\r
102 >  lib/database.cc | 67 ++++++---------------------------------------------------\r
103 >  1 file changed, 7 insertions(+), 60 deletions(-)\r
104 >\r
105 > diff --git a/lib/database.cc b/lib/database.cc\r
106 > index 03eef3e..0be7180 100644\r
107 > --- a/lib/database.cc\r
108 > +++ b/lib/database.cc\r
109 > @@ -1238,6 +1238,9 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,\r
110 >       timer_is_active = TRUE;\r
111 >      }\r
112 >  \r
113 > +    /* Perform the upgrade in a transaction. */\r
114 > +    db->begin_transaction (true);\r
115 > +\r
116 >      /* Before version 1, each message document had its filename in the\r
117 >       * data field. Copy that into the new format by calling\r
118 >       * notmuch_message_add_filename.\r
119 > @@ -1265,6 +1268,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,\r
120 >           filename = _notmuch_message_talloc_copy_data (message);\r
121 >           if (filename && *filename != '\0') {\r
122 >               _notmuch_message_add_filename (message, filename);\r
123 > +             _notmuch_message_clear_data (message);\r
124 >               _notmuch_message_sync (message);\r
125 >           }\r
126 >           talloc_free (filename);\r
127 > @@ -1312,6 +1316,8 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,\r
128 >                                                      NOTMUCH_FIND_CREATE, &status);\r
129 >               notmuch_directory_set_mtime (directory, mtime);\r
130 >               notmuch_directory_destroy (directory);\r
131 > +\r
132 > +             db->delete_document (*p);\r
133 >           }\r
134 >       }\r
135 >      }\r
136 > @@ -1353,67 +1359,8 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,\r
137 >      notmuch->features |= NOTMUCH_FEATURES_CURRENT;\r
138 >      db->set_metadata ("features", _print_features (local, notmuch->features));\r
139 >      db->set_metadata ("version", STRINGIFY (NOTMUCH_DATABASE_VERSION));\r
140 > -    db->flush ();\r
141 > -\r
142 > -    /* Now that the upgrade is complete we can remove the old data\r
143 > -     * and documents that are no longer needed. */\r
144 > -    if (version < 1) {\r
145 > -     notmuch_query_t *query = notmuch_query_create (notmuch, "");\r
146 > -     notmuch_messages_t *messages;\r
147 > -     notmuch_message_t *message;\r
148 > -     char *filename;\r
149 > -\r
150 > -     for (messages = notmuch_query_search_messages (query);\r
151 > -          notmuch_messages_valid (messages);\r
152 > -          notmuch_messages_move_to_next (messages))\r
153 > -     {\r
154 > -         if (do_progress_notify) {\r
155 > -             progress_notify (closure, (double) count / total);\r
156 > -             do_progress_notify = 0;\r
157 > -         }\r
158 > -\r
159 > -         message = notmuch_messages_get (messages);\r
160 > -\r
161 > -         filename = _notmuch_message_talloc_copy_data (message);\r
162 > -         if (filename && *filename != '\0') {\r
163 > -             _notmuch_message_clear_data (message);\r
164 > -             _notmuch_message_sync (message);\r
165 > -         }\r
166 > -         talloc_free (filename);\r
167 > -\r
168 > -         notmuch_message_destroy (message);\r
169 > -     }\r
170 >  \r
171 > -     notmuch_query_destroy (query);\r
172 > -    }\r
173 > -\r
174 > -    if (version < 1) {\r
175 > -     Xapian::TermIterator t, t_end;\r
176 > -\r
177 > -     t_end = notmuch->xapian_db->allterms_end ("XTIMESTAMP");\r
178 > -\r
179 > -     for (t = notmuch->xapian_db->allterms_begin ("XTIMESTAMP");\r
180 > -          t != t_end;\r
181 > -          t++)\r
182 > -     {\r
183 > -         Xapian::PostingIterator p, p_end;\r
184 > -         std::string term = *t;\r
185 > -\r
186 > -         p_end = notmuch->xapian_db->postlist_end (term);\r
187 > -\r
188 > -         for (p = notmuch->xapian_db->postlist_begin (term);\r
189 > -              p != p_end;\r
190 > -              p++)\r
191 > -         {\r
192 > -             if (do_progress_notify) {\r
193 > -                 progress_notify (closure, (double) count / total);\r
194 > -                 do_progress_notify = 0;\r
195 > -             }\r
196 > -\r
197 > -             db->delete_document (*p);\r
198 > -         }\r
199 > -     }\r
200 > -    }\r
201 > +    db->commit_transaction ();\r
202 >  \r
203 >      if (timer_is_active) {\r
204 >       /* Now stop the timer. */\r
205 > -- \r
206 > 2.0.0\r
207 >\r
208 > _______________________________________________\r
209 > notmuch mailing list\r
210 > notmuch@notmuchmail.org\r
211 > http://notmuchmail.org/mailman/listinfo/notmuch\r