Skip to content

Commit

Permalink
Merge pull request #6537 from rabbitmq/mergify/bp/v3.10.x/pr-6536
Browse files Browse the repository at this point in the history
See #4980. Give *.absolute precedence over *.relative configuration (backport #6535) (backport #6536)
  • Loading branch information
michaelklishin authored Nov 30, 2022
2 parents 537b38c + b95128e commit 41b7aa8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
14 changes: 12 additions & 2 deletions deps/rabbit/priv/schema/rabbit.schema
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,12 @@ fun(Conf) ->
case {Absolute, Relative} of
{undefined, undefined} -> cuttlefish:invalid("No vm watermark defined");
{_, undefined} -> {absolute, Absolute};
_ -> Relative
{undefined, _} -> Relative;
_ ->
cuttlefish:warn("Both vm_memory_high_watermark.absolute and "
"vm_memory_high_watermark.relative are configured. "
"vm_memory_high_watermark.absolute has precedence"),
{absolute, Absolute}
end
end}.

Expand Down Expand Up @@ -958,7 +963,12 @@ fun(Conf) ->
case {Absolute, Relative} of
{undefined, undefined} -> cuttlefish:invalid("No disk limit defined");
{_, undefined} -> Absolute;
_ -> {mem_relative, Relative}
{undefined, _} -> {mem_relative, Relative};
_ ->
cuttlefish:warn("Both disk_free_limit.absolute and "
"disk_free_limit.relative are configured. "
"disk_free_limit.absolute has precedence"),
Absolute
end
end}.

Expand Down
23 changes: 23 additions & 0 deletions deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,24 @@ ssl_options.fail_if_no_peer_cert = true",
{socket_writer_gc_threshold_off,
"socket_writer.gc_threshold = off", [{rabbit, [{writer_gc_threshold, undefined}]}],[]},

{disk_free_limit_absolute_priority,
"disk_free_limit.relative = 1.0
disk_free_limit.absolute = 50000",
[{rabbit, [{disk_free_limit, 50000}]}],[]},

{disk_free_limit_absolute_priority_regardless_of_order,
"disk_free_limit.absolute = 50000
disk_free_limit.relative = 1.0",
[{rabbit, [{disk_free_limit, 50000}]}],[]},

{disk_free_limit_only_relative,
"disk_free_limit.relative = 1.0",
[{rabbit, [{disk_free_limit, {mem_relative, 1.0}}]}],[]},

{disk_free_limit_only_absolute,
"disk_free_limit.absolute = 50000",
[{rabbit, [{disk_free_limit, 50000}]}],[]},

{default_user_settings,
"default_user = guest
default_pass = guest
Expand Down Expand Up @@ -186,6 +204,11 @@ tcp_listen_options.exit_on_close = false",
"vm_memory_high_watermark.absolute = 1024MB",
[{rabbit,[{vm_memory_high_watermark,{absolute,"1024MB"}}]}],
[]},
{vm_memory_watermark_absolute_priority,
"vm_memory_high_watermark.absolute = 1073741824
vm_memory_high_watermark.relative = 0.4",
[{rabbit,[{vm_memory_high_watermark,{absolute,1073741824}}]}],
[]},
{vm_memory_watermark_paging_ratio,
"vm_memory_high_watermark_paging_ratio = 0.75
vm_memory_high_watermark.relative = 0.4",
Expand Down

0 comments on commit 41b7aa8

Please sign in to comment.