Skip to content

CLI: handle {:relative, val} cases when formatting effective memory watermark value#2965

Merged
michaelklishin merged 4 commits intomasterfrom
rabbitmq-server-2964
Apr 10, 2021
Merged

CLI: handle {:relative, val} cases when formatting effective memory watermark value#2965
michaelklishin merged 4 commits intomasterfrom
rabbitmq-server-2964

Conversation

@michaelklishin
Copy link
Copy Markdown
Collaborator

Proposed Changes

CLI: handle {:relative, val} cases when formatting effective memory watermark value.

It can be exposed to CLI tools when relative watermark value is
configured via advanced.config.

I fixed a couple of tiny related things discovered along the way.

Types of Changes

Checklist

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

Closes #2964.

It can be exposed to CLI tools when relative watermark value is
configured via advanced.config.

Closes #2964.
High VM memory watermark cannot actually be set to 'infinity' (and beyond :P)
but it can be returned as a fallback value. See #2733 for some additional
context.

We format 'infinity' as "100% of available memory". This seems to be
a reasonable way to do it because the status command will try to
present a final interpreted limit value.
Generally a limit of infinity won't be returned except very early in node
boot when the monitor(s) haven't yet started.

Per discussion with @evaskova.
to be extra defensive.

We never supported it [1] but some try to use
it by analogy to the high VM watermark value
[in advanced.config]

References #2964.

1. https://github.com/rabbitmq/rabbitmq-server/blob/v3.6.x/docs/rabbitmq.config.example#L306-L320
@michaelklishin michaelklishin merged commit 0a48a2a into master Apr 10, 2021
@michaelklishin michaelklishin deleted the rabbitmq-server-2964 branch April 10, 2021 15:41
michaelklishin added a commit that referenced this pull request Apr 10, 2021
CLI: handle {:relative, val} cases when formatting effective memory watermark value
(cherry picked from commit 0a48a2a)
@michaelklishin
Copy link
Copy Markdown
Collaborator Author

Backported to v3.8.x.

michaelklishin added a commit that referenced this pull request Apr 11, 2021
for usability. It is not any different from when a float value
is used and only exists as a counterpart to '{absolute, N}'.

Also nothing changes for rabbitmq.conf users as that format performs
validation and correct value translation.

See #2694, #2965 for background.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(FunctionClauseError) no function clause matching in RabbitMQ.CLI.Core.Memory.formatted_watermark/1

1 participant