Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Conversation

@Demogorgon314
Copy link
Member

Motivation

Currently, KoP use MetadataStoreCache to get active broker data, but since Pulsar 2.9.0, some old APIs has no long accessible.

Pulsar 2.8.0 provided another api to get active broker data by use MetadataStoreCacheLoader.

Modifications

  • Use MetadataStoreCacheLoader replace MetadataStoreCache in KopBrokerLookupManager

@Demogorgon314 Demogorgon314 added the type/feature Indicates new functionality label Oct 20, 2021
@Demogorgon314 Demogorgon314 self-assigned this Oct 20, 2021
@Demogorgon314 Demogorgon314 marked this pull request as ready for review October 21, 2021 05:37
@BewareMyPower
Copy link
Collaborator

Overall LGTM, please check the comments.

@BewareMyPower BewareMyPower merged commit 088eac2 into streamnative:master Oct 21, 2021
@Demogorgon314 Demogorgon314 deleted the impl/use-MetadataStoreCacheLoader-replace-MetadataCache branch October 22, 2021 01:11
BewareMyPower pushed a commit that referenced this pull request Oct 25, 2021
…ookupManager (#820)

## Motivation
Currently, KoP use `MetadataStoreCache` to get active broker data, but since Pulsar 2.9.0, some old APIs has no long accessible. 

Pulsar 2.8.0 provided another api to get active broker data by use `MetadataStoreCacheLoader`.

## Modifications
* Use `MetadataStoreCacheLoader` replace `MetadataStoreCache` in `KopBrokerLookupManager`
BewareMyPower added a commit that referenced this pull request Oct 29, 2021
…teners (#864)

Fixes #818

### Motivation

#742 adds the multiple listeners support for KoP 2.8.x. However, there're some flaws. 

First, the KoP advertised listeners must be added to `advertisedListeners` config. This config should be treated as the advertised listeners for broker, not protocol handlers. What `KafkaProtocolHandler#getProtocolDataToAdvertise` returns is not used though it has been written to ZK. It also makes `kafkaAdvertisedListeners` meaningless and it was marked as deprecated.

### Modification

Benefit by [PIP 95](apache/pulsar#12040), Pulsar client doesn't need to configure listener name for topic lookup. So this PR simplifies the implementation of `LookupClient` by using a shared `PulsarClient` without configuring listener name.

Then this PR uses the `MetadataStoreCacheLoader` introduced from #820 to get the `kafkaAdvertisedListeners` from ZK. Since it has already been cached, this PR removes the `KOP_ADDRESS_CACHE`.

To verify the feature, this PR adds a test `testMetadataRequestForMultiListeners`. The KoP config is like

```properties
kafkaListeners=PLAINTEXT://0.0.0.0:<port1>,GW://0.0.0.0:<port2>
kafkaProtocolMap=PLAINTEXT:PLAINTEXT,GW:PLAINTEXT
kafkaAdvertisedListeners=PLAINTEXT://192.168.0.1:<port3>,GW://192.168.0.1:<port4>
```

And verify that each `KafkaRequestHandler` can handle the METADATA requests well.
BewareMyPower added a commit that referenced this pull request Oct 29, 2021
…teners (#864)

Fixes #818

### Motivation

#742 adds the multiple listeners support for KoP 2.8.x. However, there're some flaws. 

First, the KoP advertised listeners must be added to `advertisedListeners` config. This config should be treated as the advertised listeners for broker, not protocol handlers. What `KafkaProtocolHandler#getProtocolDataToAdvertise` returns is not used though it has been written to ZK. It also makes `kafkaAdvertisedListeners` meaningless and it was marked as deprecated.

### Modification

Benefit by [PIP 95](apache/pulsar#12040), Pulsar client doesn't need to configure listener name for topic lookup. So this PR simplifies the implementation of `LookupClient` by using a shared `PulsarClient` without configuring listener name.

Then this PR uses the `MetadataStoreCacheLoader` introduced from #820 to get the `kafkaAdvertisedListeners` from ZK. Since it has already been cached, this PR removes the `KOP_ADDRESS_CACHE`.

To verify the feature, this PR adds a test `testMetadataRequestForMultiListeners`. The KoP config is like

```properties
kafkaListeners=PLAINTEXT://0.0.0.0:<port1>,GW://0.0.0.0:<port2>
kafkaProtocolMap=PLAINTEXT:PLAINTEXT,GW:PLAINTEXT
kafkaAdvertisedListeners=PLAINTEXT://192.168.0.1:<port3>,GW://192.168.0.1:<port4>
```

And verify that each `KafkaRequestHandler` can handle the METADATA requests well.
gaozhangmin pushed a commit to gaozhangmin/kop that referenced this pull request Nov 29, 2021
…teners (streamnative#864)

Fixes streamnative#818

### Motivation

streamnative#742 adds the multiple listeners support for KoP 2.8.x. However, there're some flaws.

First, the KoP advertised listeners must be added to `advertisedListeners` config. This config should be treated as the advertised listeners for broker, not protocol handlers. What `KafkaProtocolHandler#getProtocolDataToAdvertise` returns is not used though it has been written to ZK. It also makes `kafkaAdvertisedListeners` meaningless and it was marked as deprecated.

### Modification

Benefit by [PIP 95](apache/pulsar#12040), Pulsar client doesn't need to configure listener name for topic lookup. So this PR simplifies the implementation of `LookupClient` by using a shared `PulsarClient` without configuring listener name.

Then this PR uses the `MetadataStoreCacheLoader` introduced from streamnative#820 to get the `kafkaAdvertisedListeners` from ZK. Since it has already been cached, this PR removes the `KOP_ADDRESS_CACHE`.

To verify the feature, this PR adds a test `testMetadataRequestForMultiListeners`. The KoP config is like

```properties
kafkaListeners=PLAINTEXT://0.0.0.0:<port1>,GW://0.0.0.0:<port2>
kafkaProtocolMap=PLAINTEXT:PLAINTEXT,GW:PLAINTEXT
kafkaAdvertisedListeners=PLAINTEXT://192.168.0.1:<port3>,GW://192.168.0.1:<port4>
```

And verify that each `KafkaRequestHandler` can handle the METADATA requests well.

(cherry picked from commit 50699b3)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

type/feature Indicates new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants