Skip to content

Conversation

@tuteng
Copy link
Member

@tuteng tuteng commented Nov 5, 2019

Fixes #4790

Master Issue: #4790

Motivation

Currently, when the brokerDeleteInactiveTopicsEnabled policy is enabled, the topic pulsar/standalone/127.0.0.1:8080/healthcheck will be deleted periodically, when creating producer and consumer for the second time https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java#L272, because both producer and consumer call putSchema in a short period of time, resulting in race conditions, Throwing exceptions of schema badVersion, only one of them could succeed. therefore, when badVersion exception occurs, call putSchema should be performed again.

Modifications

  • Add operation to handle exception KeeperException.BadVersionException

Verifying this change

./bin/pulsar standalone -nss -a 127.0.0.1
curl -v http://127.0.0.1:8080/admin/v2/brokers/health

# Waiting for more than 60 seconds, waiting for the topic pulsar/standalone/127.0.0.1:8080/healthcheck to be deleted

curl -v http://127.0.0.1:8080/admin/v2/brokers/health

@tuteng tuteng added this to the 2.5.0 milestone Nov 5, 2019
@tuteng tuteng self-assigned this Nov 5, 2019
Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

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

Ideally I would like to see a unit test or an integration test. but I am okay if it is tricky to add one since the race condition requires concurrent schema updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

healthcheck report error: Trying to subscribe with incompatible schema

3 participants