Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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:
http://review.couchbase.org/24830
http://review.couchbase.org/24831

Change-Id: Ibcf423073b0e01055f5d8952f4d3656ab8959464
Reviewed-on: http://review.couchbase.org/24831
Tested-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
  • Loading branch information...
commit ed9ad43aa361df0829262fef811b5236331b44c8 1 parent 202ce15
@vmx vmx authored fdmanana committed
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/geocouch/couch_spatial_updater.erl
View
2  src/geocouch/couch_spatial_updater.erl
@@ -41,6 +41,7 @@ update(Owner, Group, DbName) when is_binary(DbName) ->
end;
update(Owner, Group, #db{name=DbName} = Db) ->
+ ok = couch_index_barrier:enter(couch_spatial_index_barrier),
#spatial_group{
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,
NewSeq),
+ ok = couch_index_barrier:leave(couch_spatial_index_barrier),
exit({new_group, Group4}).
Please sign in to comment.
Something went wrong with that request. Please try again.