You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2020/02/19 21:02:35 UTC

[couchdb] branch fix/single-node-status-3.0.x updated (ac64d2e -> 990dc00)

This is an automated email from the ASF dual-hosted git repository.

jan pushed a change to branch fix/single-node-status-3.0.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


    omit ac64d2e  fix: show single node  on setup status with single_node=true
     new 990dc00  fix: show single node  on setup status with single_node=true

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (ac64d2e)
            \
             N -- N -- N   refs/heads/fix/single-node-status-3.0.x (990dc00)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:


[couchdb] 01/01: fix: show single node on setup status with single_node=true

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch fix/single-node-status-3.0.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 990dc006f1ca249d721ad1fe5de592be61a1a58c
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Wed Feb 19 21:55:15 2020 +0100

    fix: show single node  on setup status with single_node=true
---
 src/setup/src/setup_httpd.erl | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/src/setup/src/setup_httpd.erl b/src/setup/src/setup_httpd.erl
index f4e05ce..1d31a6c 100644
--- a/src/setup/src/setup_httpd.erl
+++ b/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 ->
+                    case setup:is_single_node_enabled(Dbs) of
                         false ->
-                            chttpd:send_json(Req, 200, {[{state, cluster_enabled}]});
+                            chttpd:send_json(Req, 200, {[{state, single_node_disabled}]});
                         true ->
-                            chttpd:send_json(Req, 200, {[{state, cluster_finished}]})
+                            chttpd:send_json(Req, 200, {[{state, single_node_enabled}]})
+                    end;
+                _ ->
+                    case setup:is_cluster_enabled() of
+                        false ->
+                            chttpd:send_json(Req, 200, {[{state, cluster_disabled}]});
+                        true ->
+                            case setup:has_cluster_system_dbs(Dbs) of
+                                false ->
+                                    chttpd:send_json(Req, 200, {[{state, cluster_enabled}]});
+                                true ->
+                                    chttpd:send_json(Req, 200, {[{state, cluster_finished}]})
+                            end
                     end
             end
     end;