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 2021/06/03 23:31:24 UTC

[couchdb] branch 3.x updated: Improve smoosh defaults for slack channel (#3600)

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

wohali pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/3.x by this push:
     new a5656ba  Improve smoosh defaults for slack channel (#3600)
a5656ba is described below

commit a5656bae255141beb6e81ab4af64db5fec63b6c3
Author: Joan Touzet <wo...@users.noreply.github.com>
AuthorDate: Thu Jun 3 19:31:10 2021 -0400

    Improve smoosh defaults for slack channel (#3600)
---
 rel/overlay/etc/default.ini      |  4 ++--
 src/smoosh/src/smoosh_server.erl | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index 5f69076..5ac8da6 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -626,11 +626,11 @@ writer = stderr
 ;
 ;[smoosh.slack_dbs]
 ;priority = slack
-;min_priority = 16777216
+;min_priority = 536870912
 ;
 ;[smoosh.slack_views]
 ;priority = slack
-;min_priority = 16777216
+;min_priority = 536870912
 
 [ioq]
 ; The maximum number of concurrent in-flight IO requests that
diff --git a/src/smoosh/src/smoosh_server.erl b/src/smoosh/src/smoosh_server.erl
index 6269608..f088c54 100644
--- a/src/smoosh/src/smoosh_server.erl
+++ b/src/smoosh/src/smoosh_server.erl
@@ -364,7 +364,7 @@ get_priority(Channel, DiskSize, DataSize, NeedsUpgrade) ->
     Priority = get_priority(Channel),
     MinSize = to_number(Channel, "min_size", "1048576"),
     MaxSize = to_number(Channel, "max_size", "infinity"),
-    DefaultMinPriority = case Priority of "slack" -> "16777216"; _ -> "2.0" end,
+    DefaultMinPriority = case Priority of "slack" -> "536870912"; _ -> "2.0" end,
     MinPriority = to_number(Channel, "min_priority", DefaultMinPriority),
     MaxPriority = to_number(Channel, "max_priority", "infinity"),
     if Priority =:= "upgrade", NeedsUpgrade ->
@@ -529,10 +529,10 @@ t_ratio_view({ok, Shard, GroupId}) ->
 t_slack_view({ok, Shard, GroupId}) ->
     ?_test(begin
         meck:expect(couch_index, get_info, fun(_) ->
-            {ok, [{sizes, {[{file, 33554432}, {active, 16777215}]}}]}
+            {ok, [{sizes, {[{file, 1073741824}, {active, 536870911}]}}]}
         end),
-        ?assertEqual(2.0000001192092967, get_priority("ratio_views", {Shard, GroupId})),
-        ?assertEqual(16777217, get_priority("slack_views", {Shard, GroupId})),
+        ?assertEqual(2.0000000037252903, get_priority("ratio_views", {Shard, GroupId})),
+        ?assertEqual(536870913, get_priority("slack_views", {Shard, GroupId})),
         ?assertEqual(0, get_priority("upgrade_views", {Shard, GroupId}))
     end).
 
@@ -542,7 +542,7 @@ t_no_data_view({ok, Shard, GroupId}) ->
             {ok, [{sizes, {[{file, 5242880}, {active, 0}]}}]}
         end),
         ?assertEqual(2.0, get_priority("ratio_views", {Shard, GroupId})),
-        ?assertEqual(16777216, get_priority("slack_views", {Shard, GroupId})),
+        ?assertEqual(536870912, get_priority("slack_views", {Shard, GroupId})),
         ?assertEqual(2.0, get_priority("upgrade_views", {Shard, GroupId}))
     end).