summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_view_updater.erl
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-07-22 17:34:14 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-07-22 17:34:14 +0000
commit26555564ad89db5407f278dc7e3943c0b0ba9bbc (patch)
tree224df278379c58f17e15c9627bce6f1f24fda022 /src/couchdb/couch_view_updater.erl
parent1ce371e890dcbb2ff5ee2465c51f66a2009246e7 (diff)
various bugfixes and improvements for view compaction
View compaction was broken after the switch to signature-based index files, but we don't have tests for it yet so we didn't notice. I also committed a few changes that should make compaction faster and more robust: * commit the header immediately after compaction finishes. We used to wait 1 seconds, but if the server restarted in that second the index would be reset. * unlink from old index file at the end. Prevents process crashes that could couch_view (and with the delayed commit would sometimes cause index resets). * don't wait for running view updates to finish before replacing old view index file. If an update is running, restart it and point it to the new view group. This alleviates the situation where the view compaction goes into a busy wait, printing "still behind main file" 1000s of times to the log, and generally makes compaction finish more quickly. * better logging git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@796805 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_view_updater.erl')
-rw-r--r--src/couchdb/couch_view_updater.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/couchdb/couch_view_updater.erl b/src/couchdb/couch_view_updater.erl
index 64c86185..1a928cb4 100644
--- a/src/couchdb/couch_view_updater.erl
+++ b/src/couchdb/couch_view_updater.erl
@@ -132,7 +132,7 @@ process_doc(Db, Owner, DocInfo, {Docs, Group, ViewKVs, DocIdViewIdKeys}) ->
{ok, Group2} = write_changes(Group1, ViewKVs3, DocIdViewIdKeys3,
DocInfo#doc_info.high_seq),
if is_pid(Owner) ->
- ok = gen_server:cast(Owner, {partial_update, Group2});
+ ok = gen_server:cast(Owner, {partial_update, self(), Group2});
true -> ok end,
garbage_collect(),
ViewEmptyKeyValues = [{View, []} || View <- Group2#group.views],