pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix] [broker] [Namespace-level Geo-Replication] Reject a topic creation if there is a confilct topic on the remote side

Open poorbarcode opened this issue 1 year ago • 3 comments

Motivation

The steps to describe the issue

  • There is a partitioned topic on the remote cluster, with partitions 1. And the source cluster does not have this topic.
  • Enable namespace-level Geo-Replication.
  • Create the topic with 3 partitions on the source cluster.
  • The broker just printed an error log "[Error] This topic already exists", and users get a successful response.

Modifications

Reject a topic creation if there is a conflict topic on the remote side

Documentation

  • [ ] doc
  • [ ] doc-required
  • [x] doc-not-needed
  • [ ] doc-complete

Matching PR in forked repository

PR in forked repository: x

poorbarcode avatar Apr 24 '24 15:04 poorbarcode

I think we intentionally overlooked the result of creating a topic for the remote cluster.

This PR may break the user's behavior of creating topic.

According to your description, when using the default broker configuration, and the geo-replication is enabled on the namespace level, the remote cluster will create two non-partitioned topics, tenant/namespace/topic-partition-1 and tenant/namespace/topic-partition-2 by the geo producer. Is it right?

If right, I would suggest adding a topic check before starting the replicator to make sure that the topic is the same between local and remote clusters, if they are the same, start the replicator, otherwise throw a log. You can also add this check in the replicator task.

nodece avatar Apr 25 '24 04:04 nodece

Rebase master

poorbarcode avatar Apr 25 '24 06:04 poorbarcode

Rebase master

poorbarcode avatar Apr 29 '24 06:04 poorbarcode