Re: [PATCH v2 00/11] compactor changes v2

Subject: Re: [PATCH v2 00/11] compactor changes v2

Date: Tue, 05 Nov 2013 14:26:29 -0500

To: Tomi Ollila, David Bremner, Jani Nikula, notmuch@notmuchmail.org

Cc:

From: Ben Gamari


Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Tue, Nov 05 2013, David Bremner <david@tethera.net> wrote:
>
>> Jani Nikula <jani@nikula.org> writes:
>>
>>> Hi all, this is v2 of [1], incorporating compact related patches from
>>> David, some changes from David's review, some new patches, man page
>>> update, test update.
>>>
>>> Cheers,
>>> Jani.
>>
>> Aside from the one quibble that I already sent seperately, the first 8
>> patches look OK to me. I have no technical objections to the last 3, but
>> since the change the UI, I'd like to wait a bit for more input from
>> other people.
>
>
> The whole series looks OK to me. The only thing I'm, a bit worried about
> what happens is I Ctrl-C compaction at any state. Is it possible that I
> end up with corrupted database ? Someone may accidentally execute
> notmuch compact -- for example by picking the command from history.
>
You should in principle never end up in a situation where the original
database is corrupted. Xapian's Compactor interface reads from the
existing database and writes out the compacted database to a new
directory. The notmuch compact command keeps the original database in
place until the last possible moment.

When the compacted database is completely constructed it, deletes or
moves the old database out of the way and then moves the new database
into place. The worst thing that could happen is that you manage to
interrupt the process between deleting the old database and moving the
new one into place (a very small window). In this case you'd simply need
to move the new database into place manually (although you'd need to
figure out where the compacted database is located).
  
Cheers,

- Ben

part-000.sig (application/pgp-signature)

Thread: