Skip to content

Conversation

@merlimat
Copy link
Contributor

@merlimat merlimat commented Oct 3, 2019

Motivation

As part of the changes in #4963, the handling of PartitionMetadataRequest is mix of sync and async operation. This is very bad because we're calling that from IO threads which are used for critical publish tasks.

Several internal methods introduced in that commit are async on the surface, though are blocking in practice.

Additionally, the logic for checking that a topic exists is unnecessarily expensive: fetching the list of topics in a namespace and then iterating through the list to compare with the current topic.

Modifications

Refactored the handling of PartitionMetadataRequest to ensure everything is end-to-end async.

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Oct 3, 2019
@merlimat merlimat added this to the 2.4.2 milestone Oct 3, 2019
@merlimat merlimat self-assigned this Oct 3, 2019
@jiazhai
Copy link
Member

jiazhai commented Oct 3, 2019

Thanks for fix this. seems some of related UT failed:
org.apache.pulsar.broker.service.BrokerServiceAutoTopicCreationTest.testAutoTopicCreationDisableIfNonPartitionedTopicAlreadyExist

@sijie
Copy link
Member

sijie commented Oct 3, 2019

#4963 is introduced for 2.5.0. so shall this change be marked for 2.5.0?

@merlimat
Copy link
Contributor Author

merlimat commented Oct 3, 2019

Yes, I mistakenly tagged for 2.4.2

@merlimat merlimat modified the milestones: 2.4.2, 2.5.0 Oct 3, 2019
@codelipenghui
Copy link
Contributor

run integration tests
run java8 tests

@merlimat merlimat merged commit 71cfe3a into apache:master Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants