apache / apache/pulsar

Topic auto creation won't create partitioned topics if client connects to discovery node.

Open
#10,449 1 comment 0 reactions 0 assignees View on GitHub
lifecycle/stale type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 22h
Merged PRs (30d)
142

Description

**Describe the bug**

Configured the namespace to enable topic auto-creation, with partitioned topic type by default.
If your consumer/producer are directly connected to broker, your topic will be created corrected with default number of partitions.
If your consumer/producer are connected through the pulsar discovery node, then the topic is created as non-partitioned one.

**To Reproduce**
Steps to reproduce the behavior:
1. Setup your pulsar cluster with proxy in front of your brokers.
2. Create a new namespace with the below configuration:

```
autoTopicCreationOverride:
allowAutoTopicCreation: true
topicType: partitioned
defaultNumPartitions: 16
autoSubscriptionCreationOverride:
allowAutoSubscriptionCreation: true
```

3. Use either java/go client to connect to pulsar discovery node. Produce a message to a non-exist topic of that namespace.

**Expected behavior**
A new topic created with 16 partitions

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using a Pulsar proxy or discovery node, the shown autoTopicCreationOverride settings, and either the Java or Go client. Trace the discovery-node request path into topic auto-creation and compare it with direct broker access; done means a new topic receives the configured 16 partitions in both paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.