From 75e24cb09c6222713224540a1d82b6539c71ac9a Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Mon, 5 Jan 2009 17:03:02 +0000 Subject: Fixed views to not commit index headers if they are ahead of what has been fully committed to the database. Also, the index headers are now committed async, improving response times updating views. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@731618 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_view_updater.erl | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/couchdb/couch_view_updater.erl') diff --git a/src/couchdb/couch_view_updater.erl b/src/couchdb/couch_view_updater.erl index 0532258c..940602dd 100644 --- a/src/couchdb/couch_view_updater.erl +++ b/src/couchdb/couch_view_updater.erl @@ -16,8 +16,7 @@ -include("couch_db.hrl"). -update(#group{db=Db,current_seq=Seq,purge_seq=PurgeSeq, - commit_fun=CommitFun}=Group) -> +update(#group{db=Db,current_seq=Seq,purge_seq=PurgeSeq}=Group) -> ?LOG_DEBUG("Starting index update.",[]), DbPurgeSeq = couch_db:get_purge_seq(Db), Group2 = @@ -45,14 +44,9 @@ update(#group{db=Db,current_seq=Seq,purge_seq=PurgeSeq, UncomputedDocs, Results, ViewKVsToAdd, DocIdViewIdKeys), couch_query_servers:stop_doc_map(Group4#group.query_server), NewSeq = couch_db:get_update_seq(Db), - if Seq /= NewSeq -> - {ok, Group5} = write_changes(Group4, ViewKVsToAdd2, DocIdViewIdKeys2, + {ok, Group5} = write_changes(Group4, ViewKVsToAdd2, DocIdViewIdKeys2, NewSeq), - ok = CommitFun(Group5), - exit({new_group, Group5#group{query_server=nil}}); - true -> - exit({new_group, Group4#group{query_server=nil}}) - end. + exit({new_group, Group5#group{query_server=nil}}). purge_index(#group{db=Db, views=Views, id_btree=IdBtree}=Group) -> -- cgit v1.2.3