Re: notmuch dump: taking write-lock to protect from concurrent (cronned) notmuch new?

Subject: Re: notmuch dump: taking write-lock to protect from concurrent (cronned) notmuch new?

Date: Thu, 12 Jun 2014 19:56:34 -0300

To: Mark Walters, Maarten Aertsen, notmuch@notmuchmail.org

Cc:

From: David Bremner


Mark Walters <markwalters1009@gmail.com> writes:


>> mjw1009 suggested to change NOTMUCH_DATABASE_MODE_READ_ONLY on line
>> 215 of notmuch-dump.c to NOTMUCH_DATABASE_MODE_READ_WRITE
>>
>> I'm wondering if this hits enough people to motivate the addition of a
>> command line switch (or perhaps even a change in default behaviour?)
>
> I think this is a clear bug but the fix is a little unclear. The above
> fix works but it breaks one of the tests: "unicode message-ids" in
> T150-tagging.sh.
>
> I think the problem is that it does 
> notmuch dump | sed... | notmuch restore
>

My first reaction was "argh, we should be locking things less, not
more".  But then I read 

        http://getting-started-with-xapian.readthedocs.org/en/latest/xapian-core-rst/admin_notes.html?highlight=backup#id10

and now I'm not so sure, maybe write lock for dump is the right answer.

It seems hard to do anything sensible with "Database.reopen" in the
context of a backup.



Thread: