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

[fix][broker] Allow broker deployment in heterogeneous hw config cluster without restricting nic speed detection #21409

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

rdhabalia
Copy link
Contributor

@rdhabalia rdhabalia commented Oct 20, 2023

Motivation

This PR #14648 is incorrectly introduced, causing broker service unavailability while upgrading brokers in heterogeneous hardware config clusters. Sometime broker can’t find nic speed as it’s not defined into multiple types of VM which is very well know behavior and that’s why broker handles such usecase while managing load report by avoiding n/w bandwidth metrics.
This PR #14648 was introduced by completely ignoring heterogeneous hardware configuration cluster usecase because of that broker upgrade in that cluster has brought down all those VM brokers and can cause the outage. that PR also had test cases failing due to the same reason and it was addressed by another hack by configuring loadBalancerOverrideBrokerNicSpeedGbps. again loadBalancerOverrideBrokerNicSpeedGbps doesn’t work in heterogeneous h/w config cluster as we can not configure every different broker with different config file.
Right now, broker startup fails on every VM due to this error and we can't even configure loadBalancerOverrideBrokerNicSpeedGbps as there are different h/w config types of broker in a cluster and it's not easy to manage different config-base for each broker:

00:00:01.667 [main] ERROR org.apache.pulsar.broker.loadbalance.LinuxInfoUtils - [LinuxInfo] Failed to get total nic limit.
java.io.IOException: Invalid argument
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
        at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:48) ~[?:?]
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
        at sun.nio.ch.IOUtil.read(IOUtil.java:245) ~[?:?]
        at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:223) ~[?:?]
        at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) ~[?:?]
        at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:107) ~[?:?]
        at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:101) ~[?:?]
        at java.nio.file.Files.read(Files.java:3159) ~[?:?]
        at java.nio.file.Files.readAllBytes(Files.java:3213) ~[?:?]
        at org.apache.pulsar.broker.loadbalance.LinuxInfoUtils.readTrimStringFromFile(LinuxInfoUtils.java:303)

so, either broker can perform auto-detect nic speed, if not then there has to be an option to ignore n/w bandwidth calculation which was the existing behavior by considering different h/w config cluster which was completely ignored by this PR #14648 and that has to be removed. if anyone wants to add restriction then we can add a config but I don’t see any value in introducing another config just to avoid this warning message. so, this PR fixes this behavior which are causing service outage with this feature upgrade.

Modifications

Remove incorrect restriction that makes Pulsar unusable for broker service deployed on heterogeneous hw configuration with VMs.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository:

@rdhabalia rdhabalia added area/broker doc-not-needed Your PR changes do not impact docs ready-to-test labels Oct 20, 2023
@rdhabalia rdhabalia added this to the 3.2.0 milestone Oct 20, 2023
@rdhabalia rdhabalia self-assigned this Oct 20, 2023
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.

I guess that we missed the problem because many deployments of Pulsar are now on k8s and usually with homogeneous hardware

+1

@mattisonchao
Copy link
Member

Question:
We calculated facts for the load balancer by NIC limit and usage. If 0 NIC limit and >0 tx and rx will mislead the load balancer?

@rdhabalia
Copy link
Contributor Author

We calculated facts for the load balancer by NIC limit and usage. If 0 NIC limit and >0 tx and rx will mislead the load balancer?

Think this way: there is no way to get specific information then should we handle this scenario or should we just not allow that user to use that software? it's not possible to auto-detect NIC in some VMs and in heterogenous h/w config you can have VMs with different NIC values where it's not possible to provide different broker-conf file to every different broker. therefore, load balancer is already handling such scenarios where nic is one of the metrics which can be skipped if it doesn't exist with a warning message. so, we can not consider the absence of NIC value as the end of the world and make broker service unavailable.

@mattisonchao
Copy link
Member

mattisonchao commented Oct 24, 2023

@rdhabalia

Think this way: there is no way to get specific information then should we handle this scenario or should we just not allow that user to use that software? it's not possible to auto-detect NIC in some VMs and in heterogenous h/w config you can have VMs with different NIC values where it's not possible to provide different broker-conf file to every different broker. therefore, load balancer is already handling such scenarios where nic is one of the metrics which can be skipped if it doesn't exist with a warning message. so, we can not consider the absence of NIC value as the end of the world and make broker service unavailable.

Yes, I am not saying reverting is wrong. I wondered if we could improve some logic related to this area to avoid misleading load balancers. (we can do it in the next PR)

e.g. "Once NIC limit is zero, we should get rid of nic usage calculation."

@rdhabalia
Copy link
Contributor Author

"Once NIC limit is zero, we should get rid of nic usage calculation."

Load-balancer already does that.

@rdhabalia rdhabalia merged commit 789d284 into apache:master Oct 24, 2023
@rdhabalia rdhabalia deleted the nic_fix branch October 24, 2023 23:14
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 13, 2024
…ter without restricting nic speed detection (apache#21409)

(cherry picked from commit 789d284)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 18, 2024
…ter without restricting nic speed detection (apache#21409)

(cherry picked from commit 789d284)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 19, 2024
…ter without restricting nic speed detection (apache#21409)

(cherry picked from commit 789d284)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants