Browse files

MB-7406: Add updater barrier for spatial indexer

Currently there's one spatial indexer for every vBucket,
hence a lot of updaters are running at the same time.
This commit adds a barrier, so that you can set the
maximum number of updaters that should run at the same
time. The default value is 4. The MapReduce indexer
already uses such a barrier.

Those two commits should me merged at the same time:

Change-Id: Ibcf423073b0e01055f5d8952f4d3656ab8959464
Tested-by: Volker Mische <>
Reviewed-by: Filipe David Borba Manana <>
Tested-by: Filipe David Borba Manana <>
  • Loading branch information...
1 parent 202ce15 commit ed9ad43aa361df0829262fef811b5236331b44c8 @vmx vmx committed with fdmanana Dec 17, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/geocouch/couch_spatial_updater.erl
@@ -41,6 +41,7 @@ update(Owner, Group, DbName) when is_binary(DbName) ->
update(Owner, Group, #db{name=DbName} = Db) ->
+ ok = couch_index_barrier:enter(couch_spatial_index_barrier),
name = GroupName,
current_seq = Seq,
@@ -101,6 +102,7 @@ update(Owner, Group, #db{name=DbName} = Db) ->
?LOG_DEBUG("new seq num: ~p", [NewSeq]),
{ok, Group4} = write_changes(Group3, ViewKVsToAdd2, DocIdViewIdKeys2,
+ ok = couch_index_barrier:leave(couch_spatial_index_barrier),
exit({new_group, Group4}).

0 comments on commit ed9ad43

Please sign in to comment.