Skip to content

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

Open
poorbarcode wants to merge 1 commit into
apache:masterfrom
poorbarcode:fix/ns_geo_create_topics
Open

[fix] [broker] [Namespace-level Geo-Replication] Reject a topic creation if there is a confilct topic on the remote side#22577
poorbarcode wants to merge 1 commit into
apache:masterfrom
poorbarcode:fix/ns_geo_create_topics

Conversation

@poorbarcode

Copy link
Copy Markdown
Contributor

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
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode added this to the 3.3.0 milestone Apr 24, 2024
@poorbarcode poorbarcode self-assigned this Apr 24, 2024
@poorbarcode poorbarcode changed the title [fix] [broker] [namespace Geo-Replication] Reject a topic creation if there is a confilct topic on the remote side [fix] [broker] [Namespace-level Geo-Replication] Reject a topic creation if there is a confilct topic on the remote side Apr 24, 2024
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Apr 24, 2024
@poorbarcode poorbarcode reopened this Apr 24, 2024
@nodece

nodece commented Apr 25, 2024

Copy link
Copy Markdown
Member

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.

@poorbarcode
poorbarcode force-pushed the fix/ns_geo_create_topics branch from a60407e to 0e13f60 Compare April 25, 2024 06:57
@poorbarcode

Copy link
Copy Markdown
Contributor Author

Rebase master

@poorbarcode
poorbarcode requested a review from nodece April 25, 2024 08:08
…there is a confilct topic on the remote side
@poorbarcode
poorbarcode force-pushed the fix/ns_geo_create_topics branch from 0e13f60 to d0963b6 Compare April 29, 2024 06:09
@poorbarcode

Copy link
Copy Markdown
Contributor Author

Rebase master

@coderzc coderzc modified the milestones: 3.3.0, 3.4.0 May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants