davisp commented on a change in pull request #1789: New Feature: Database
Partitions
URL: https://github.com/apache/couchdb/pull/1789#discussion_r242677502
##########
File path: src/fabric/src/fabric_view.erl
##########
@@ -309,10 +317,23 @@ index_of(X, [X|_Rest], I) ->
index_of(X, [_|Rest], I) ->
index_of(X, Rest, I+1).
-get_shards(DbName, #mrargs{stable=true}) ->
- mem3:ushards(DbName);
-get_shards(DbName, #mrargs{stable=false}) ->
- mem3:shards(DbName).
+get_shards(Db, #mrargs{} = Args) ->
+ DbPartitioned = fabric_util:is_partitioned(Db),
+ Partition = couch_mrview_util:get_extra(Args, partition),
+ if DbPartitioned orelse Partition == undefined -> ok; true ->
+ throw({bad_request, <<"partition specified on non-partitioned db">>})
+ end,
+ DbName = fabric:dbname(Db),
+ case {Args#mrargs.stable, Partition} of
Review comment:
I think you missed the subtle `mem3:shards` vs `mem3:ushards` there. I'll
add a comment to make that clearer.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services