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

[fix][broker] Replication stuck when partitions count between two clusters is not the same #22983

Merged
merged 16 commits into from
Jul 15, 2024
Prev Previous commit
Next Next commit
fix log's bug
  • Loading branch information
poorbarcode committed Jul 15, 2024
commit 879c1b4192b62a5d6400fc1e5233eea75f0a06ca
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,8 @@ public void testDifferentTopicCreationRule(ReplicationMode replicationMode) thro
admin2.namespaces().setAutoTopicCreation(ns, autoTopicCreation);
Awaitility.await().untilAsserted(() -> {
assertEquals(admin2.namespaces().getAutoTopicCreationAsync(ns).join().getDefaultNumPartitions(), 2);
// Trigger system topic __change_event's initialize.
pulsar2.getTopicPoliciesService().getTopicPoliciesAsync(TopicName.get("persistent://" + ns + "/1"));
});

// Create non-partitioned topic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ private CompletableFuture<Integer> checkPartitions(String topic, boolean forceNo
CompletableFuture<Integer> checkPartitions = new CompletableFuture<>();
getPartitionedTopicMetadata(topic, !forceNoPartitioned).thenAccept(metadata -> {
if (forceNoPartitioned && metadata.partitions > 0) {
String errorMsg = String.format("Can not create the producer[{}] for the topic[{}] that contains {}"
String errorMsg = String.format("Can not create the producer[%s] for the topic[%s] that contains %s"
+ " partitions, but the producer does not support for a partitioned topic.",
producerNameForLog, topic, metadata.partitions);
log.error(errorMsg);
Expand Down
Loading