apache / apache/gravitino

[Bug report] Gravitino Kafka implementation doesn't support '.' symbol in topic name.

Open
#9,926 4 comments 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 15h
Merged PRs (30d)
315

Description

### Version

main branch

### Describe what's wrong

Why Gravitino disallows '.' in Kafka topic name?
This not restricted in Kafka.
While it still can "see" the topics with dot, but doesn't allow to change them or create new topics with '.' symbol.
I couldn't find any RFC for that, but still, [here](https://www.confluent.io/learn/kafka-topic-naming-convention/#use-cases-for-kafka-topic-naming-conventions) are Confluence recomendations.
Let's not break standarts, guys. If it's allowed in Kafka, then it should be supported, isn't it?

### Error message and/or stacktrace

kbalitskii@ma2-dev-gravitino02 ~ $ curl -L 'http://localhost:8090/api/metalakes/ma2_dev/catalogs/ma2-dev-kafka-plaintext/schemas/default/topics' \
> -H 'Content-Type: application/json' \
> -H 'Accept: application/vnd.gravitino.v1+json' \
> -d '{
> "name": "ma2.KirillBalitskiiTest",
> "comment": "This is a topic",
> "properties": {
> "partition-count": "1",
> "replication-factor": "3"
> }
> }'
{"code":1001,"type":"IllegalArgumentException","message":"Failed to operate topic(s) [ma2.KirillBalitskiiTest] operation [CREATE] under schema [default], reason [The TOPIC name 'ma2.KirillBalitskiiTest' is illegal. Illegal name: ma2.KirillBalitskiiTest]","stack":["java.lang.IllegalArgumentException: The TOPIC name 'ma2.KirillBalitskiiTest' is illegal. Illegal name: ma2.KirillBalitskiiTest","\tat com.google.common.base.Preconditions.checkArgument(Preconditions.java:143)","\tat org.apache.gravitino.catalog.CapabilityHelpers.applyNameSpecification(CapabilityHelpers.java:507)","\tat

### How to reproduce

Just try to create a Kafka topic with dot in it's name.

### Additional context

Image

Contributor guide

Open the contributing guide

Research direction

Start with the stack-trace entry point CapabilityHelpers.applyNameSpecification and trace how the Gravitino Kafka implementation validates topic names. Reproduce the failure using the curl request for ma2.KirillBalitskiiTest, then verify that creating and changing Kafka topics containing '.' succeeds without removing other name validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kafka
Domain
stream-processing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.