You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/02/19 21:12:58 UTC

[GitHub] [couchdb] nickva commented on a change in pull request #2583: Fix/single node status 3.0.x

nickva commented on a change in pull request #2583: Fix/single node status 3.0.x
URL: https://github.com/apache/couchdb/pull/2583#discussion_r381547417
 
 

 ##########
 File path: src/setup/src/setup_httpd.erl
 ##########
 @@ -31,24 +31,30 @@ handle_setup_req(#httpd{method='GET'}=Req) ->
     ok = chttpd:verify_is_server_admin(Req),
     Dbs = chttpd:qs_json_value(Req, "ensure_dbs_exist", setup:cluster_system_dbs()),
     couch_log:notice("Dbs: ~p~n", [Dbs]),
-    case erlang:list_to_integer(config:get("cluster", "n", undefined)) of
-        1 ->
-            case setup:is_single_node_enabled(Dbs) of
-                false ->
-                    chttpd:send_json(Req, 200, {[{state, single_node_disabled}]});
-                true ->
-                    chttpd:send_json(Req, 200, {[{state, single_node_enabled}]})
-            end;
+    SingleNodeConfig = config:get_boolean("couchdb", "single_node", false),
+    case SingleNodeConfig of
+        true ->
+            chttpd:send_json(Req, 200, {[{state, single_node_enabled}]});
         _ ->
-            case setup:is_cluster_enabled() of
-                false ->
-                    chttpd:send_json(Req, 200, {[{state, cluster_disabled}]});
-                true ->
-                    case setup:has_cluster_system_dbs(Dbs) of
+            case erlang:list_to_integer(config:get("cluster", "n", undefined)) of
+                1 ->
 
 Review comment:
   if it `undefined` it will blow up here? I think we'd want `config:get("cluster", "n", "1")` ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services