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

[pulsar-zookeeper-utils] Fix Updating Rack Info Dynamically #8844

Merged
merged 1 commit into from
Dec 8, 2020
Merged

[pulsar-zookeeper-utils] Fix Updating Rack Info Dynamically #8844

merged 1 commit into from
Dec 8, 2020

Conversation

k2la
Copy link
Contributor

@k2la k2la commented Dec 7, 2020

Motivation

When the value of "/bookies" in ZooKeeper is changed, Brokers are notified of the change.
After the notification to Brokers, only one of the two BookKeeper clients that Brokers have seems to reflect the change.

Two BookKeeper clients that Brokers have

The client of BookkeeperSchemaStorage don't seems to reflect the change.
The cause is that ZkBookieRackAffinityMapping#onUpdate don't run.

I confirmed that I change ZkBookieRackAffinityMapping instances to use same ZooKeeperDataCache and ZkBookieRackAffinityMapping#onUpdate works.

Modification

  • Set the argument of ZkBookieRackAffinityMapping#setConf to bookieMappingCache
  • Move updateRacksWithHost()

@sijie sijie added this to the 2.8.0 milestone Dec 7, 2020
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

@jiazhai
Copy link
Member

jiazhai commented Dec 7, 2020

/pulsarbot run-failure-checks

1 similar comment
@k2la
Copy link
Contributor Author

k2la commented Dec 7, 2020

/pulsarbot run-failure-checks

@sijie sijie merged commit ceeabfc into apache:master Dec 8, 2020
@k2la k2la deleted the update_rack_dynamically branch December 8, 2020 05:32
RobertIndie pushed a commit to RobertIndie/pulsar that referenced this pull request Dec 8, 2020
### Motivation
When the value of "/bookies" in ZooKeeper is changed, Brokers are notified of the change.
After the notification to Brokers, only one of the two BookKeeper clients that Brokers have seems to reflect the change.

**Two BookKeeper clients that Brokers have**
- https://github.com/apache/pulsar/blob/ac0c6e41f0ebe3c900bb31e41c8d40b3f60b19df/pulsar-broker/src/main/java/org/apache/pulsar/broker/ManagedLedgerClientFactory.java#L81
- https://github.com/apache/pulsar/blob/102fa9de03509b86e47f58ab8e1c0dde2095da3b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java#L105

The client of `BookkeeperSchemaStorage` don't seems to reflect the change.
The cause is that `ZkBookieRackAffinityMapping#onUpdate` don't run.

I confirmed that I change ZkBookieRackAffinityMapping instances to use same `ZooKeeperDataCache` and `ZkBookieRackAffinityMapping#onUpdate` works.

### Modification
- Set the argument of `ZkBookieRackAffinityMapping#setConf` to `bookieMappingCache`
- Move `updateRacksWithHost()`
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