diff options
author | Robert Newson <rnewson@apache.org> | 2020-03-16 22:39:16 +0000 |
---|---|---|
committer | Joan Touzet <wohali@users.noreply.github.com> | 2020-04-27 17:05:58 -0400 |
commit | d4686252f58c61c6d576a3ae9d509849e3912d56 (patch) | |
tree | c1d9403c9ca7352dbc44752af3deb4113daeef56 | |
parent | 67cbd4e012d90431118aefdd2d53d08872293e15 (diff) | |
download | couchdb-d4686252f58c61c6d576a3ae9d509849e3912d56.tar.gz |
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.
-rw-r--r-- | src/couch_mrview/src/couch_mrview_index.erl | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/couch_mrview/src/couch_mrview_index.erl b/src/couch_mrview/src/couch_mrview_index.erl index c96d87173..018060f83 100644 --- a/src/couch_mrview/src/couch_mrview_index.erl +++ b/src/couch_mrview/src/couch_mrview_index.erl @@ -252,16 +252,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}. |