database error
[notmuch-archives.git] / be / 4ccf4cd7e02a36372cbbb94eaa6b95f0399795
1 Return-Path: <too@guru-group.fi>\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 6A6DD431E64\r
6         for <notmuch@notmuchmail.org>; Thu, 14 Nov 2013 14:03:43 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\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 v9l1cqdpuLe7 for <notmuch@notmuchmail.org>;\r
16         Thu, 14 Nov 2013 14:03:35 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id F3E55431FBD\r
19         for <notmuch@notmuchmail.org>; Thu, 14 Nov 2013 14:03:34 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 5DDEC1000E5; Fri, 15 Nov 2013 00:03:30 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH v3 4/5] compact: unconditionally remove old wip database\r
25         compact directory\r
26 Date: Fri, 15 Nov 2013 00:03:26 +0200\r
27 Message-Id: <1384466607-28298-2-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.8.0\r
29 In-Reply-To: <1384466607-28298-1-git-send-email-tomi.ollila@iki.fi>\r
30 References: <id:1384362167-12740-1-git-send-email-tomi.ollila@iki.fi>\r
31         <1384466607-28298-1-git-send-email-tomi.ollila@iki.fi>\r
32 Cc: tomi.ollila@iki.fi\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Thu, 14 Nov 2013 22:03:43 -0000\r
46 \r
47 In case previous notmuch compact has been interrupted there is old\r
48 work-in-progress database compact directory partially filled. Remove\r
49 it just before starting to fill the directory with new files.\r
50 ---\r
51  lib/database.cc | 6 ++++++\r
52  1 file changed, 6 insertions(+)\r
53 \r
54 diff --git a/lib/database.cc b/lib/database.cc\r
55 index d79cc30..d09ad99 100644\r
56 --- a/lib/database.cc\r
57 +++ b/lib/database.cc\r
58 @@ -922,6 +922,12 @@ notmuch_database_compact (const char *path,\r
59         goto DONE;\r
60      }\r
61  \r
62 +    /* Unconditionally attempt to remove old work-in-progress database (if\r
63 +     * any). This is "protected" by database lock. If this fails due to write\r
64 +     * errors (etc), the following code will fail and provide error message.\r
65 +     */\r
66 +    (void) rmtree (compact_xapian_path);\r
67 +\r
68      try {\r
69         NotmuchCompactor compactor (status_cb, closure);\r
70  \r
71 -- \r
72 1.8.0\r
73 \r