Skip to content

Conversation

@merlimat
Copy link
Contributor

Motivation

The BookieRackAffinityMapping is based on reading the (bookie->rack) mapping from a z-node. Therefore we're injecting the ZK client in the RackAffinity plugin.
Instead, we are going to inject the instance of MetadataStore in the properties, so that we're not depending on the ZK implementation.

@merlimat merlimat added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages doc-not-needed Your PR changes do not impact docs labels Nov 17, 2021
@merlimat merlimat added this to the 2.10.0 milestone Nov 17, 2021
@merlimat merlimat self-assigned this Nov 17, 2021
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.

LGTM

I hope we have good coverage about this feature.
It is very important for users and a bug in this will lead to serious problems

/**
* It provides the mapping of bookies to its rack from zookeeper.
*/
public class ZkBookieRackAffinityMapping extends AbstractDNSToSwitchMapping
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep the old class, otherwise, we will break the user's cluster after upgrading to the new Pulsar version.

This one is used in bookkeeper.conf, reppDnsResolverClass=org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't find it in the config files, but yes, it's a good idea to retain the name. I'll add it back as an empty class extending the new one.

@merlimat merlimat merged commit d7158dd into apache:master Dec 1, 2021
@merlimat merlimat deleted the pip-45-bk-rackaware branch December 1, 2021 21:17
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
…che#12841)

* PIP-45: Converted BookieRackAffinityMapping to use MetadataStore

* WIP

* Only initialize bookieMappingCache if we have an isolation group

* Added back compatibility class wrappers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants