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

[improve][broker][branch-2.10] Backport Linux metrics changes from master branch #20659

Merged

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Jun 27, 2023

Motivation

branch-2.10 doesn't support cgroup v2 currently. AKS Kubernetes 1.25+ switches to use cgroup v2:
https://github.com/Azure/AKS/releases/tag/2023-03-05
GKE contains to have a way to select between cgroup v1 & cgroup v2:
https://cloud.google.com/kubernetes-engine/docs/how-to/node-system-config#cgroup-mode-options
GKE will default to cgroup v2 in new Kubernetes 1.26 clusters or node pools.
AWS EKS v1.26 nodes will default to cgroup v2.

Modifications

Backport #16832 which fixes #16601 .
This includes multiple other changes which are required dependencies for backporting the pull request.
This was achieved by cherry-picking #14648, #15365, copying over these specific files from master branch, cherry-picking #16832 and resolving merge conflicts on the way.

These are the files that were copied over from master branch (license header was modified to match JAVADOC_STYLE:

pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LinuxInfoUtils.java
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LinuxBrokerHostUsageImpl.java
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/LinuxBrokerHostUsageImplTest.java
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/BitRateUnit.java
pulsar-broker-common/src/test/java/org/apache/pulsar/broker/BitRateUnitTest.java
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadReportNetworkLimitTest.java
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleBrokerStartTest.java
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadReportNetworkLimitTest.java

Java 11 has cgroup v2 support since 11.0.16 with https://bugs.openjdk.org/browse/JDK-8230305 changes.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

+1

With the advent of k8s 1.25+ this change must be committed to 2.10 branch
thanks for porting it.

@lhotari lhotari requested review from coderzc and nodece June 27, 2023 17:05
&& config.isLoadBalancerEnabled()
&& LinuxInfoUtils.isLinux()
&& !LinuxInfoUtils.checkHasNicSpeeds()) {
throw new IllegalStateException("Unable to read VM NIC speed. You must set "
Copy link
Member

Choose a reason for hiding this comment

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

Notice: If we cannot read the NIC speed, the broker cannot be starting.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this code is just copied over from master branch

@lhotari lhotari merged commit b355d31 into apache:branch-2.10 Jun 28, 2023
26 of 30 checks passed
poorbarcode added a commit that referenced this pull request Nov 29, 2023
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Dec 2, 2023
mattisonchao added a commit to streamnative/pulsar-archived that referenced this pull request Dec 28, 2023
mattisonchao added a commit to streamnative/pulsar-archived that referenced this pull request Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants