You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/23 04:11:23 UTC

[GitHub] [pulsar] congbobo184 opened a new pull request #10334: [Transaction] Fix MLTransactionLog open manageLedger name problem.

congbobo184 opened a new pull request #10334:
URL: https://github.com/apache/pulsar/pull/10334


   ## Motivation
   now `MLTransactionLog` generate `managedLedger` name is illegal.
   ## implement
   generate correct name and can generate metrics.
   ### Verifying this change
   Add the tests for it
   
   Does this pull request potentially affect one of the following parts:
   If yes was chosen, please highlight the changes
   
   Dependencies (does it add or upgrade a dependency): (no)
   The public API: (no)
   The schema: (no)
   The default values of configurations: (no)
   The wire protocol: (no)
   The rest endpoints: (no)
   The admin cli options: (no)
   Anything that affects deployment: (no)
   
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on a change in pull request #10334: [Transaction] Fix MLTransactionLog open manageLedger name problem.

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #10334:
URL: https://github.com/apache/pulsar/pull/10334#discussion_r618941725



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -302,7 +303,8 @@ public PersistentTopic(String topic, ManagedLedger ledger, BrokerService brokerS
 
         if (brokerService.getPulsar().getConfiguration().isTransactionCoordinatorEnabled()
                 && !checkTopicIsEventsNames(topic)
-                && !topic.contains(TopicName.TRANSACTION_COORDINATOR_ASSIGN.getLocalName())) {
+                && !topic.contains(TopicName.TRANSACTION_COORDINATOR_ASSIGN.getLocalName())
+                && !topic.contains(MLTransactionLogImpl.TRANSACTION_LOG_PREFIX)) {

Review comment:
       Can we use `startsWith` ?

##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ManagedLedgerMetricsTest.java
##########
@@ -87,4 +94,19 @@ public void testManagedLedgerMetrics() throws Exception {
 
     }
 
+    @Test
+    public void testTransactionTopic() throws Exception {
+        admin.tenants().createTenant(NamespaceName.SYSTEM_NAMESPACE.getTenant(),
+                new TenantInfo(Sets.newHashSet("appid1"), Sets.newHashSet("test")));
+        admin.namespaces().createNamespace(NamespaceName.SYSTEM_NAMESPACE.toString());
+        admin.topics().createPartitionedTopic(TopicName.TRANSACTION_COORDINATOR_ASSIGN.toString(), 1);
+        ManagedLedgerConfig managedLedgerConfig = new ManagedLedgerConfig();
+        managedLedgerConfig.setMaxEntriesPerLedger(2);
+        new MLTransactionLogImpl(TransactionCoordinatorID.get(0),
+                pulsar.getManagedLedgerFactory(), managedLedgerConfig);
+        Thread.sleep(2000);

Review comment:
       Why do you need this sleep? Can we replace with Awaiatility in order to make the test more resilient?




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] congbobo184 commented on a change in pull request #10334: [Transaction] Fix MLTransactionLog open manageLedger name problem.

Posted by GitBox <gi...@apache.org>.
congbobo184 commented on a change in pull request #10334:
URL: https://github.com/apache/pulsar/pull/10334#discussion_r618956282



##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ManagedLedgerMetricsTest.java
##########
@@ -87,4 +94,19 @@ public void testManagedLedgerMetrics() throws Exception {
 
     }
 
+    @Test
+    public void testTransactionTopic() throws Exception {
+        admin.tenants().createTenant(NamespaceName.SYSTEM_NAMESPACE.getTenant(),
+                new TenantInfo(Sets.newHashSet("appid1"), Sets.newHashSet("test")));
+        admin.namespaces().createNamespace(NamespaceName.SYSTEM_NAMESPACE.toString());
+        admin.topics().createPartitionedTopic(TopicName.TRANSACTION_COORDINATOR_ASSIGN.toString(), 1);
+        ManagedLedgerConfig managedLedgerConfig = new ManagedLedgerConfig();
+        managedLedgerConfig.setMaxEntriesPerLedger(2);
+        new MLTransactionLogImpl(TransactionCoordinatorID.get(0),
+                pulsar.getManagedLedgerFactory(), managedLedgerConfig);
+        Thread.sleep(2000);

Review comment:
       don't need sleep, I did not check again.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui merged pull request #10334: [Transaction] Fix MLTransactionLog open manageLedger name problem.

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #10334:
URL: https://github.com/apache/pulsar/pull/10334


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org