You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Jeffrey Tolar (Jira)" <ji...@apache.org> on 2022/09/30 17:46:00 UTC
[jira] [Comment Edited] (KAFKA-14271) Topic recreation fails in KRaft mode when topic contains collidable characters
[ https://issues.apache.org/jira/browse/KAFKA-14271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17611698#comment-17611698 ]
Jeffrey Tolar edited comment on KAFKA-14271 at 9/30/22 5:45 PM:
----------------------------------------------------------------
It's possible this isn't specific to KRaft-mode; I haven't tried reproducing it with a Zookeeper-based cluster.
edit: after a quick script update, it looks like Zookeeper-mode is unaffected
{noformat}
#!/bin/bash
VERSION=3.3.0
TOPIC=$1
#CONFIG=./config/kraft/server.properties
CONFIG=./config/server.properties
set -x
rm -rf -- kafka_2.13-${VERSION} kafka_2.13-${VERSION}.tgz /tmp/kraft-combined-logs /tmp/kafka-logs /tmp/zookeeper
trap 'kill -- "-$$" && wait' EXIT
curl -O https://dlcdn.apache.org/kafka/$VERSION/kafka_2.13-${VERSION}.tgz
tar -xzf kafka_2.13-${VERSION}.tgz
cd kafka_2.13-${VERSION}
if [[ "$CONFIG" == *kraft* ]]; then
id=$(./bin/kafka-storage.sh random-uuid)
./bin/kafka-storage.sh format -t $id -c "$CONFIG"
else
./bin/zookeeper-server-start.sh config/zookeeper.properties > zookeeper.log 2>&1 &
fi
./bin/kafka-server-start.sh "$CONFIG" > broker.log 2>&1 &
sleep 1
./bin/kafka-topics.sh --create --topic "$TOPIC" --bootstrap-server localhost:9092
./bin/kafka-topics.sh --delete --topic "$TOPIC" --bootstrap-server localhost:9092
./bin/kafka-topics.sh --create --topic "$TOPIC" --bootstrap-server localhost:9092
sleep 1
{noformat}
was (Author: jeffreytolar):
It's possible this isn't specific to KRaft-mode; I haven't tried reproducing it with a Zookeeper-based cluster.
> Topic recreation fails in KRaft mode when topic contains collidable characters
> ------------------------------------------------------------------------------
>
> Key: KAFKA-14271
> URL: https://issues.apache.org/jira/browse/KAFKA-14271
> Project: Kafka
> Issue Type: Bug
> Components: kraft
> Affects Versions: 3.3.0
> Reporter: Jeffrey Tolar
> Priority: Major
> Attachments: topic.with.dots.log, topicwithoutdots.log
>
>
> We recently updated one of our clusters from 3.2.0 to 3.3.0 (primarily to get the fix forĀ KAFKA-13909). This cluster is running KRaft mode.
> This is a cluster used for some integration tests - each test deletes the topics it uses before the test to ensure a clean slate for the test; the brokers get restarted in-between tests, but the broker data isn't deleted.
> With 3.3.0, this semi-crashes Kafka. The brokers stay running, but the topic creation fails:
> {noformat}
> [2022-09-30 17:17:59,216] WARN [Controller 1] createTopics: failed with unknown server exception NoSuchElementException at epoch 1 in 601 us. Renouncing leadership and reverting to the last committed offset 18. (org.apache.kafka.controller.QuorumController)
> java.util.NoSuchElementException
> at org.apache.kafka.timeline.SnapshottableHashTable$CurrentIterator.next(SnapshottableHashTable.java:167)
> at org.apache.kafka.timeline.SnapshottableHashTable$CurrentIterator.next(SnapshottableHashTable.java:139)
> at org.apache.kafka.timeline.TimelineHashSet$ValueIterator.next(TimelineHashSet.java:120)
> at org.apache.kafka.controller.ReplicationControlManager.validateNewTopicNames(ReplicationControlManager.java:799)
> at org.apache.kafka.controller.ReplicationControlManager.createTopics(ReplicationControlManager.java:567)
> at org.apache.kafka.controller.QuorumController.lambda$createTopics$7(QuorumController.java:1832)
> at org.apache.kafka.controller.QuorumController$ControllerWriteEvent.run(QuorumController.java:767)
> at org.apache.kafka.queue.KafkaEventQueue$EventContext.run(KafkaEventQueue.java:121)
> at org.apache.kafka.queue.KafkaEventQueue$EventHandler.handleEvents(KafkaEventQueue.java:200)
> at org.apache.kafka.queue.KafkaEventQueue$EventHandler.run(KafkaEventQueue.java:173)
> at java.base/java.lang.Thread.run(Thread.java:829)
> {noformat}
> This appears to be because our topic names contain {{.}}'s. Here's a quick reproducer script:
> {noformat}
> #!/bin/bash
> VERSION=3.3.0
> TOPIC=$1
> set -x
> rm -rf -- kafka_2.13-${VERSION} kafka_2.13-${VERSION}.tgz /tmp/kraft-combined-logs
> trap 'kill -- "-$$" && wait' EXIT
> curl -O https://dlcdn.apache.org/kafka/$VERSION/kafka_2.13-${VERSION}.tgz
> tar -xzf kafka_2.13-${VERSION}.tgz
> cd kafka_2.13-${VERSION}
> id=$(./bin/kafka-storage.sh random-uuid)
> ./bin/kafka-storage.sh format -t $id -c ./config/kraft/server.properties
> ./bin/kafka-server-start.sh config/kraft/server.properties > broker.log 2>&1 &
> sleep 1
> ./bin/kafka-topics.sh --create --topic "$TOPIC" --bootstrap-server localhost:9092
> ./bin/kafka-topics.sh --delete --topic "$TOPIC" --bootstrap-server localhost:9092
> ./bin/kafka-topics.sh --create --topic "$TOPIC" --bootstrap-server localhost:9092
> sleep 1
> {noformat}
> Running {{./test-kafka.sh topic.with.dots}} exhibits the failure; using {{topicwithoutdots}} works as expected.
> I'll attach the broker logs from each run.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)