You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2020/04/27 20:14:08 UTC
[couchdb] branch 3.0.x-viewfix created (now 1736874)
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a change to branch 3.0.x-viewfix
in repository https://gitbox.apache.org/repos/asf/couchdb.git.
at 1736874 View is partitioned if db and view are partitioned
This branch includes the following new commits:
new 1736874 View is partitioned if db and view are partitioned
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[couchdb] 01/01: View is partitioned if db and view are partitioned
Posted by wo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch 3.0.x-viewfix
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 1736874efecf18937714d59d810b938ae67ef5fc
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 c96d871..018060f 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}.