You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2022/05/19 16:36:11 UTC

[couchdb] 01/01: Default rexi use_kill_all to true

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

vatamane pushed a commit to branch enable-use-kill-all-optimization
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 4a50fe51597f9aeadd6b858e83dfc20820b5b586
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Thu May 19 12:26:39 2022 -0400

    Default rexi use_kill_all to true
    
    It should save some dist bandwidth when workers are canceled at the end of
    fabric requests. The feature has been available since 3.0.x (3 years ago) so
    opt to enable it by default.
    
    Users who do a rolling upgrade from 2.x could still set it to `false` and then,
    after the upgrade completes, delete it to return it to default (true).
---
 rel/overlay/etc/default.ini | 10 +++++-----
 src/rexi/src/rexi.erl       |  9 ++++-----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index a9d18b50c..162ccb926 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -296,11 +296,11 @@ bind_address = 127.0.0.1
 ; server_per_node = true
 ; stream_limit = 5
 ;
-; Use a single message to kill a group of remote workers This is
-; mostly is an upgrade clause to allow operating in a mixed cluster of
-; 2.x and 3.x nodes. After upgrading switch to true to save some
-; network bandwidth
-;use_kill_all = false
+; Use a single message to kill a group of remote workers. This feature is
+; available starting with 3.0. When performing a rolling upgrade from 2.x to
+; 3.x, set this value to false, then after all nodes were upgraded delete it so
+; it can use the default true value.
+;use_kill_all = true
 
 ; [global_changes]
 ; max_event_delay = 25
diff --git a/src/rexi/src/rexi.erl b/src/rexi/src/rexi.erl
index fb1763e51..90000dda2 100644
--- a/src/rexi/src/rexi.erl
+++ b/src/rexi/src/rexi.erl
@@ -80,11 +80,10 @@ kill(Node, Ref) ->
 %% No rexi_EXIT message will be sent.
 -spec kill_all([{node(), reference()}]) -> ok.
 kill_all(NodeRefs) when is_list(NodeRefs) ->
-    %% Upgrade clause. Since kill_all is a new message, nodes in a mixed
-    %% cluster won't know how to process it. In that case, the default is to send
-    %% the individual kill messages. Once all the nodes have been upgraded, can
-    %% configure the cluster to send kill_all messages.
-    case config:get_boolean("rexi", "use_kill_all", false) of
+    %% use_kill_all is available since version 3.0. When performing a rolling
+    %% cluster upgrade from 2.x, set this value to false, then revert it back
+    %% to default (true) after all nodes have been upgraded.
+    case config:get_boolean("rexi", "use_kill_all", true) of
         true ->
             PerNodeMap = lists:foldl(
                 fun({Node, Ref}, Acc) ->