You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2020/04/27 20:05:21 UTC
[couchdb] branch master updated: View is partitioned if db and view
are partitioned
This is an automated email from the ASF dual-hosted git repository.
rnewson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/master by this push:
new 63e2d08 View is partitioned if db and view are partitioned
63e2d08 is described below
commit 63e2d08e6d580f89f95778e46d8c5a3f76ffa052
Author: Robert Newson <rn...@apache.org>
AuthorDate: Mon Mar 16 22:39:16 2020 +0000
View is partitioned if db and view are partitioned
We've seen a crash if DbPartitioned is false and ViewPartitioned is
true, which is obviously nonsense. The effect of the `nocase` is the
termination of the couch_index_server gen_server, which is a serious
amplification of a small (user-initiated) oddity.
---
src/couch_mrview/src/couch_mrview_index.erl | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/src/couch_mrview/src/couch_mrview_index.erl b/src/couch_mrview/src/couch_mrview_index.erl
index cc013c5..68f1d23 100644
--- a/src/couch_mrview/src/couch_mrview_index.erl
+++ b/src/couch_mrview/src/couch_mrview_index.erl
@@ -258,16 +258,7 @@ set_partitioned(Db, State) ->
DbPartitioned = couch_db:is_partitioned(Db),
ViewPartitioned = couch_util:get_value(
<<"partitioned">>, DesignOpts, DbPartitioned),
- IsPartitioned = case {DbPartitioned, ViewPartitioned} of
- {true, true} ->
- true;
- {true, false} ->
- false;
- {false, false} ->
- false;
- _ ->
- throw({bad_request, <<"invalid partition option">>})
- end,
+ IsPartitioned = DbPartitioned andalso ViewPartitioned,
State#mrst{partitioned = IsPartitioned}.