redpanda-data / redpanda

Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM!
https://redpanda.com
9.61k stars 585 forks source link

KsqlDB 0.27.2 cannot create stream in Redpanda 22.1.6 #5786

Closed VisionaryAries closed 2 years ago

VisionaryAries commented 2 years ago

Version & Environment

Redpanda version: v22.1.6 (rev ea9c411)

KsqlDB version: 0.27.2

What went wrong?

KsqlDB 0.27.2 cannot create stream in Redpanda 22.1.6

How to reproduce the issue?

  1. install rpk cluster
    
    [root@t-edi-data-001 ~]# rpk cluster health --api-urls t-edi-data-001:9644,t-edi-data-002:9644,t-edi-data-003:9644
    CLUSTER HEALTH OVERVIEW
    =======================
    Healthy:               true
    Controller ID:         0
    Nodes down:            []
    Leaderless partitions: []
    [root@t-edi-data-001 ~]# rpk cluster info |head
    CLUSTER
    =======
    redpanda.redpandatest

BROKERS

ID HOST PORT 0* 10.10.15.127 9092 1 10.10.15.136 9092 2 10.10.15.12 9092

2. install ksqldb cluster
configuration

kafka-cluster=redpanda.redpandatest ksql.service.id=ksqldb-rp-cluster- listeners=http://0.0.0.0:8088/ ksql.advertised.listener=http://t-edi-data-001:8088/ compression.type=snappy ksql.logging.processing.topic.auto.create=true ksql.logging.processing.stream.auto.create=true bootstrap.servers=t-edi-data-001:9092,t-edi-data-002:9092,t-edi-data-003:9092 ksql.schema.registry.url=http://t-edi-data-001:18084/,http://t-edi-data-002:18084/,http://t-edi-data-003:18084/ ksql.connect.url=http://t-edi-data-001:8083/ ksql.streams.producer.delivery.timeout.ms=2147483647 ksql.streams.producer.max.block.ms=9223372036854775807 ksql.internal.topic.replicas=3 ksql.internal.topic.min.insync.replicas=2 ksql.streams.replication.factor=3 ksql.streams.producer.acks=all ksql.streams.topic.min.insync.replicas=2


3. create stream in ksqldb

ksql> CREATE STREAM STREAM_ORIGIN_OBJ_ATTRIBUTE WITH (KAFKA_TOPIC='SIT.CPLM.OBJ_ATTRIBUTE',VALUE_FORMAT='AVRO'); Could not write the statement 'CREATE STREAM STREAM_ORIGIN_OBJ_ATTRIBUTE WITH (KAFKA_TOPIC='SIT.CPLM.OBJ_ATTRIBUTE',VALUE_FORMAT='AVRO');' into the command topic: Could not find a coordinator with type TRANSACTION with key ksqldb-rp-cluster- due to unexpected error: null Caused by: Could not find a coordinator with type TRANSACTION with key ksqldb-rp-cluster- due to unexpected error: null


### Additional information
ksql.log

Caused by: org.apache.kafka.common.KafkaException: Could not find a coordinator with type TRANSACTION with key ksqldb-rp-cluster- due to unexpected error: null at org.apache.kafka.clients.producer.internals.TransactionManager$FindCoordinatorHandler.handleResponse(TransactionManager.java:1477) at org.apache.kafka.clients.producer.internals.TransactionManager$TxnRequestHandler.onComplete(TransactionManager.java:1207) at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:109) at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:583) at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:575) at org.apache.kafka.clients.producer.internals.Sender.maybeSendAndPollTransactionalRequest(Sender.java:426) at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:316) at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:243) ... 1 more

emaxerrno commented 2 years ago

@VisionaryAries can you upload here a docker-compose so we can reproduce it quickly.

emaxerrno commented 2 years ago

also @VisionaryAries i think you need to turn transactions on based on this Caused by: Could not find a coordinator with type TRANSACTION with key

check out our docs.redpanda.com to enable that (rpk config set redpanda.enable_transactions true - i think is the command)

VisionaryAries commented 2 years ago

@emaxerrno Thanks, after enable redpanda.enable_transactions , I can create stream in ksql.