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

Kafka Health Check must be done on offset.storage.replication.factor and not transaction.state.log.replication.factor #11

Closed
2 of 4 tasks
loicmathieu opened this issue Feb 27, 2019 · 3 comments · Fixed by #13

Comments

@loicmathieu
Copy link
Contributor

Kafka Health Check must be based on offset.storage.replication.factor and not transaction.state.log.replication.factor.

This is a potential issue when using a Kafka cluster with one node as the existing Kafka documentation points out this configuration to be set to '1' and not the other.

I'm agree that both should be set to '1' in case the cluster has only one node, but only the offset setting is set in the existing script provided by Confluent and used in there Docker images.
See https://github.com/confluentinc/cp-docker-images/blob/5.1.2-post/examples/cp-all-in-one/docker-compose.yml for example.

Moreover, if no transaction is used, the transaction topic is not created so this property is useless !

As the fix is easy, I can provide a PR ;)

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

This is easily reproduced by using a simple docker-compose file as following and using it with micronaut-kafka and enabling the health check endpoint

version: '2'
services:
  zookeeper:
    image: confluentinc/cp-zookeeper:5.0.1
    environment:
      - ZOOKEEPER_CLIENT_PORT=2181
  kafka:
    image: confluentinc/cp-kafka:5.0.1
    ports:
        - 9092:9092
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092
      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1

Expected Behaviour

If we switch to offset.storage.replication.factor instead of transaction.state.log.replication.factor, the kafka health indicator will be Up with the provided docker-compose.

Actual Behaviour

The kafka health indicator is Down with the provided docker-compose.

Environment Information

  • Operating System: Windows 10
  • Micronaut Version: 1.0.4
  • JDK Version: 11

Example Application

Not Provided

@graemerocher graemerocher transferred this issue from micronaut-projects/micronaut-core Feb 27, 2019
@graemerocher
Copy link
Contributor

Seems to duplicate #7

@graemerocher
Copy link
Contributor

@loicmathieu However a PR would be great!

@loicmathieu
Copy link
Contributor Author

@graemerocher I think my proposal is better than in #7 because the default replication factor can be 3 without any issue on a one node cluster if you specify the replication factory for each topic you created (this is advised anyway).
But a one node cluster cannot works if you don't set the offset replication factor to 1.

I will create a PR for this soon.

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 a pull request may close this issue.

2 participants