kafka-ui icon indicating copy to clipboard operation
kafka-ui copied to clipboard

Green tick sign with an active controller is placed next to the wrong controller

Open KrzysztofDzioba opened this issue 1 year ago • 5 comments

Issue submitter TODO list

  • [X] I've looked up my issue in FAQ
  • [X] I've searched for an already existing issues here
  • [X] I've tried running master-labeled docker image and the issue still persists there
  • [X] I'm running a supported version of the application which is listed here

Describe the bug (actual behavior)

Hi. I created 3 kafka brokers. In "Brokers" section, I can see "Active Controller" with a value 2. However, in the list of brokers below, I can see a green 'tick' mark next to broker ID 3. When I move a curson on this tick, I can read "Active Controller".

I checked the logs on each broker. I can read there following: broker1: DEBUG [Controller id=1] Broker 2 has been elected as the controller, so stopping the election process. broker2: INFO [Controller id=2] 2 successfully elected as the controller. broker3: DEBUG [Controller id=3] Broker 2 has been elected as the controller, so stopping the election process.

So the active one is 2. That means that tick mark next to broker id 3 is wrong. (Or it's me that I can't get something here)

All best, Chris

Expected behavior

Green tick mark should be next to broker id 2

Your installation details

tested on: 56fa824 v0.7.1

Steps to reproduce

Use following docker file:

---
version: '2'
services:
  zookeeper-1:
    image: confluentinc/cp-zookeeper:latest
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000
    ports:
      - 22181:2181

  zookeeper-2:
    image: confluentinc/cp-zookeeper:latest
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000
    ports:
      - 32181:2181
  
  kafka-1:
    image: confluentinc/cp-kafka:latest
    depends_on:
      - zookeeper-1
      - zookeeper-2

    ports:
      - 29092:29092
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:2181,zookeeper-2:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-1:9092,PLAINTEXT_HOST://localhost:29092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
  kafka-2:
    image: confluentinc/cp-kafka:latest
    depends_on:
      - zookeeper-1
      - zookeeper-2
    ports:
      - 39092:39092
    environment:
      KAFKA_BROKER_ID: 2
      KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:2181,zookeeper-2:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-2:9092,PLAINTEXT_HOST://localhost:39092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
  kafka-3:
    image: confluentinc/cp-kafka:latest
    depends_on:
      - zookeeper-1
      - zookeeper-2
    ports:
      - 49092:49092
    environment:
      KAFKA_BROKER_ID: 3
      KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:2181,zookeeper-2:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-3:9092,PLAINTEXT_HOST://localhost:49092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1  
  kafka-ui:
    image: provectuslabs/kafka-ui
    container_name: kafka-ui
    ports:
      - 8090:8080
    depends_on:
     - zookeeper-1
     - zookeeper-2
     - kafka-1
     - kafka-2
    environment:
      KAFKA_CLUSTERS_0_NAME: local
      KAFKA_CLUSTERS_0_BOOTSTRAP_SERVERS: kafka-2:9092
      KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper-1:2181

Screenshots

image

Logs

image

image

image

Additional context

No response

KrzysztofDzioba avatar Jan 18 '24 16:01 KrzysztofDzioba

Hello there KrzysztofDzioba! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀

github-actions[bot] avatar Jan 18 '24 16:01 github-actions[bot]

Hi, please take a look on this

KrzysztofDzioba avatar Jan 18 '24 16:01 KrzysztofDzioba

It`s surely a bug in 0.7.1. And has been fixed in master branch. But also exist another bug as the activeController node is not the correct one when the cluster is running on kraft. I have commited a pr on this problem.

liudaac avatar Feb 04 '24 09:02 liudaac

It`s surely a bug in 0.7.1. And has been fixed in master branch. But also exist another bug as the activeController node is not the correct one when the cluster is running on kraft. I have commited a pr on this problem.

I have reviewed the PR code you submitted and noticed that you obtained the correct active controller id for the KRaft mode deployment via JMX. In the master branch implementation, it seemed to be obtained directly through Java's kafka-clients, but it would get active controlelr id from the broker nodes, similar to the way the active controller is obtained in a Zookeeper-deployed mode.

lxb6476 avatar Jul 22 '24 06:07 lxb6476

this repo is not maintained (#4255), please refer to https://github.com/kafbat/kafka-ui where we've fixed all the related issues (IIRC)

Haarolean avatar Jul 22 '24 08:07 Haarolean