Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add min available bytes storage policy #33

Merged
merged 50 commits into from
Feb 15, 2023

Conversation

SamBarker
Copy link

First step in implementing proposal #47.

This PR adds the first of the new limit types "min available bytes" and adds the requirement to specify the bootstrap URL for communicating with the Kafka cluster. It also removes the old storage checker, but preserves the old total consumed space soft and hard limits (as an incremental step we plan to remove them eventually) as well as their metrics.

We propose to add additional metrics and other limit types in separate pull requests.

SamBarker and others added 16 commits January 31, 2023 21:00
…age.

Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Sam Barker <sbarker@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Wire up quota reset listener.
Co-authored-by: Robert Young <robeyoun@redhat.com>

Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
@scholzj
Copy link
Member

scholzj commented Jan 31, 2023

Looks like some spotbugs issues failed the build.

Signed-off-by: Sam Barker <sbarker@redhat.com>
… throttled state.

This stops spotbugs complaining about floating point equality.

Signed-off-by: Sam Barker <sbarker@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
SamBarker and others added 3 commits February 13, 2023 12:17
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
We can re-introduce filterable log dirs later.

Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
@SamBarker
Copy link
Author

@tombentley: @robobario and I think we have addressed all your feedback hopefully the changes work for you.

(cc: @scholzj if you are still planning to look at the java code)

Copy link
Member

@tombentley tombentley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more nits, but assuming you're happy to fix those this LGTM. Thanks!

SamBarker and others added 5 commits February 14, 2023 09:47
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Co-authored-by: Robert Young <robeyoun@redhat.com>
Signed-off-by: Sam Barker <sbarker@redhat.com>
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM I guess ... assuming it works :-D

@scholzj
Copy link
Member

scholzj commented Feb 14, 2023

@ppatierno @strimzi/maintainers Anyone has anything else to this?

Why:
We will want visibility when the throttle factor changes as it could
effectively stop messages being produced (and make recovery visible too)

Co-authored-by: Sam Barker <sbarker@redhat.com>
Signed-off-by: Robert Young <robeyoun@redhat.com>
@scholzj scholzj merged commit ea44ab3 into strimzi:main Feb 15, 2023
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Why:
Acting on the total usage of the cluster makes no sense now that we are
using KIP-827 to determine the usage of all volumes in the active broker
set. Nodes will enter/exit the active set as a matter of course. So the
aggregate usage will fluctuate. Instead we will limit based on the usage
of each volume going forward. IE throttle if any of the volumes is getting
too full.

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Why:
Acting on the total usage of the cluster makes no sense now that we are
using KIP-827 to determine the usage of all volumes in the active broker
set. Nodes will enter/exit the active set as a matter of course. So the
aggregate usage will fluctuate. Instead we will limit based on the usage
of each volume going forward. IE throttle if any of the volumes is getting
too full.

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Why:
Acting on the total usage of the cluster makes no sense now that we are
using KIP-827 to determine the usage of all volumes in the active broker
set. Nodes will enter/exit the active set as a matter of course. So the
aggregate usage will fluctuate. Instead we will limit based on the usage
of each volume going forward. IE throttle if any of the volumes is getting
too full.

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Why:
It may be convenient to be able to throttle message production when any volume's
usage ratio drops below a threshold. This means you could have a single configuration
for heterogeneous disks saying cease all message production if any volume's available
ratio is below 0.01

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Why:
It may be convenient to be able to throttle message production when any volume's
usage ratio drops below a threshold. This means you could have a single configuration
for heterogeneous disks saying cease all message production if any volume's available
ratio is below 0.01

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Why:
Acting on the total usage of the cluster makes no sense now that we are
using KIP-827 to determine the usage of all volumes in the active broker
set. Nodes will enter/exit the active set as a matter of course. So the
aggregate usage will fluctuate. Instead we will limit based on the usage
of each volume going forward. IE throttle if any of the volumes is getting
too full.

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Why:
It may be convenient to be able to throttle message production when any volume's
usage ratio drops below a threshold. This means you could have a single configuration
for heterogeneous disks saying cease all message production if any volume's available
ratio is below 0.01

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Why:
It may be convenient to be able to throttle message production when any volume's
usage ratio drops below a threshold. This means you could have a single configuration
for heterogeneous disks saying cease all message production if any volume's available
ratio is below 0.01

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 15, 2023
Enables users to throttle the produce quota when the availableRatio (availableBytes/totalBytes) is
less than or equal to a threshold.

The new configuration property is:
`client.quota.callback.static.storage.per.volume.limit.min.available.ratio`

Which accepts a double between 0 and 1 inclusive

Why:
It may be convenient to be able to throttle message production when any volume's
usage ratio drops below a threshold. This means you could have a single configuration
for heterogeneous disks saying cease all message production if any volume's available
ratio is below 0.01

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>

refactor: extract a base class for policies applied to any volume

Signed-off-by: Robert Young <robeyoun@redhat.com>
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Feb 28, 2023
Enables users to throttle the produce quota when the availableRatio (availableBytes/totalBytes) is
less than or equal to a threshold.

The new configuration property is:
`client.quota.callback.static.storage.per.volume.limit.min.available.ratio`

Which accepts a double between 0 and 1 inclusive

Why:
It may be convenient to be able to throttle message production when any volume's
usage ratio drops below a threshold. This means you could have a single configuration
for heterogeneous disks saying cease all message production if any volume's available
ratio is below 0.01

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>

refactor: extract a base class for policies applied to any volume

Signed-off-by: Robert Young <robeyoun@redhat.com>
scholzj pushed a commit that referenced this pull request Mar 1, 2023
* Remove deprecated total disk usage soft/hard limit types

Why:
Acting on the total usage of the cluster makes no sense now that we are
using KIP-827 to determine the usage of all volumes in the active broker
set. Nodes will enter/exit the active set as a matter of course. So the
aggregate usage will fluctuate. Instead we will limit based on the usage
of each volume going forward. IE throttle if any of the volumes is getting
too full.

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>

* Remove Strimzi Usage documentation

Why:
It's unknown precisely how Strimzi will integrate with the new version, and
the docs could be confusing as they contradict the warning about it not being
included in Strimzi yet

Signed-off-by: Robert Young <robeyoun@redhat.com>

---------

Signed-off-by: Robert Young <robeyoun@redhat.com>
robobario added a commit to robobario/kafka-quotas-plugin that referenced this pull request Mar 1, 2023
Enables users to throttle the produce quota when the availableRatio (availableBytes/totalBytes) is
less than or equal to a threshold.

The new configuration property is:
`client.quota.callback.static.storage.per.volume.limit.min.available.ratio`

Which accepts a double between 0 and 1 inclusive

Why:
It may be convenient to be able to throttle message production when any volume's
usage ratio drops below a threshold. This means you could have a single configuration
for heterogeneous disks saying cease all message production if any volume's available
ratio is below 0.01

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](strimzi#33)

Signed-off-by: Robert Young <robeyoun@redhat.com>

refactor: extract a base class for policies applied to any volume

Signed-off-by: Robert Young <robeyoun@redhat.com>
scholzj pushed a commit that referenced this pull request Mar 2, 2023
Enables users to throttle the produce quota when the availableRatio (availableBytes/totalBytes) is
less than or equal to a threshold.

The new configuration property is:
`client.quota.callback.static.storage.per.volume.limit.min.available.ratio`

Which accepts a double between 0 and 1 inclusive

Why:
It may be convenient to be able to throttle message production when any volume's
usage ratio drops below a threshold. This means you could have a single configuration
for heterogeneous disks saying cease all message production if any volume's available
ratio is below 0.01

See Also:
* https://github.com/strimzi/proposals/blob/main/047-cluster-wide-volume-usage-quota-management.md
* [Add min available bytes storage policy](#33)



refactor: extract a base class for policies applied to any volume

Signed-off-by: Robert Young <robeyoun@redhat.com>
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.

None yet

4 participants