Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topic partition not found #1361

Open
zty-f opened this issue Dec 26, 2024 · 0 comments
Open

topic partition not found #1361

zty-f opened this issue Dec 26, 2024 · 0 comments
Labels

Comments

@zty-f
Copy link

zty-f commented Dec 26, 2024

The kafka configuration has only 60 shards, but the partition that is pushed is not within this access。

Kafka Version
v0.4.47

My kafka cluster creation code

func (c cluster) NewSyncWriterWithAckNoBatch(ctx context.Context, topic string, ackConfig int) queue.Writer {
	ack := kafka.RequireNone
	if ackConfig == int(kafka.RequireNone) || ackConfig == int(kafka.RequireOne) || ackConfig == int(kafka.RequireAll) {
		ack = kafka.RequiredAcks(ackConfig)
	}

	client := &kafka.Writer{
		Addr:                   kafka.TCP(c.Brokers...),
		Balancer:               &kafka.LeastBytes{},
		BatchSize:              1,
		AllowAutoTopicCreation: false, // 不允许自动创建topic, 应该从后台创建,方便统一管理
		Topic:                  topic, // 如果创建生产者的时候,topic为空,那么每个消息体里就必须指定topic
		Async:                  false,
		RequiredAcks:           ack,
	}

	if c.Sasl.Username != "" {
		client.Transport = &kafka.Transport{
			TLS:  c.tls,
			SASL: c.Sasl,
		}
	}
	if ctx == nil {
		ctx = context.Background()
	}
	return writer{ctx, client}
}

topic info
image

write message error
Kafka write errors (1/1), errors: [kafka.(*Client).Produce: fetch request error: topic partition not found (topic="mall_growth_center_7001000" partition=3191777)]

@zty-f zty-f added the bug label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant