315157973 commented on a change in pull request #12517:
URL: https://github.com/apache/pulsar/pull/12517#discussion_r738053698



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/SystemTopic.java
##########
@@ -59,9 +60,13 @@ public void checkGC() {
 
     @Override
     public CompletableFuture<Void> checkReplication() {
+        if (EventsTopicNames.isTopicPoliciesSystemTopic(topic)) {
+            return super.checkReplication();
+        }
         return CompletableFuture.completedFuture(null);

Review comment:
       SystemTopic was previously used for Topic Policies and transaction. Only 
Topic Policies need to be replicate remotely, so I created a new class 
TopicPoliciesSystemTopic.

##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java
##########
@@ -81,24 +83,37 @@ private TopicPolicyWriter(Producer<PulsarEvent> producer, 
SystemTopicClient<Puls
 
         @Override
         public MessageId write(PulsarEvent event) throws PulsarClientException 
{
-            return 
producer.newMessage().key(getEventKey(event)).value(event).send();
+            return producer.newMessage()
+                    .key(getEventKey(event))
+                    .properties(event.getProperties() == null ? 
Collections.emptyMap() : event.getProperties())

Review comment:
       isGlobal is field of the TopicPolicies object. In order to avoid 
deserializing the entire message, I put the isGlobal logo in Properties so that 
only the header of the Entry need to be deserialized




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to