aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Mark Walters <markwalters1009@gmail.com>2014-06-23 21:12:29 +0100
committerGravatar David Bremner <david@tethera.net>2014-07-16 19:33:10 -0300
commitbbbdf0478ea6109afc1ca5a26a8d1cd86b600e2a (patch)
tree4b1aef8c3f60dc6f7bb755002303b650677dad72 /test
parent567aab405b05d9ef79ddf1b62302806b9ddbeaad (diff)
dump: make dump take Xapian write lock
Dump currently only takes the read lock. Xapian can cope with some changes while maintaining a read snapshot but with more changes it fails. Currently notmuch just gives a xapian error. To avoid this we take the write lock when dumping. This prevents other notmuch processes from modifying the xapian database preventing this error. Discussion with Olly on irc indicates that this is currently the best solution: in xapian trunk there may be better possibilities using snapshots but they need to make it to a release and propogate out to users before we can switch approach. Finally, this breaks one use case: pipelines of the form notmuch dump | ... | notmuch restore According to Olly this is already very fragile: it will only work on small databases. One of the tests relies on this behaviour so fix that to store the dump rather than use a pipe.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T150-tagging.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh
index dc118f33..45471ac8 100755
--- a/test/T150-tagging.sh
+++ b/test/T150-tagging.sh
@@ -247,8 +247,8 @@ ${TEST_DIRECTORY}/random-corpus --config-path=${NOTMUCH_CONFIG} \
notmuch dump --format=batch-tag | sed 's/^.* -- /+common_tag -- /' | \
sort > EXPECTED
-notmuch dump --format=batch-tag | sed 's/^.* -- / -- /' | \
- notmuch restore --format=batch-tag
+notmuch dump --format=batch-tag | sed 's/^.* -- / -- /' > INTERMEDIATE_STEP
+notmuch restore --format=batch-tag < INTERMEDIATE_STEP
notmuch tag --batch < EXPECTED