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/14 10:32:52 UTC

[GitHub] [pulsar] frank-montyne opened a new issue #10231: Exception using topic level policies

frank-montyne opened a new issue #10231:
URL: https://github.com/apache/pulsar/issues/10231


   **Describe the bug**
   I enabled topic level policies in Pulsar 27.1 by setting the following properties in broker.conf and standalone.conf as is mentioned in the documentation: 
   systemTopicEnabled=true
   topicLevelPoliciesEnabled=true
   
   When creating a topic with a retention policy I constantly get the following error:
   
   PULSAR >org.apache.pulsar.broker.service.BrokerServiceException$TopicPoliciesCacheNotInitException: Topic policies cache have not init.
   PULSAR >	at org.apache.pulsar.broker.service.SystemTopicBasedTopicPoliciesService.getTopicPolicies(SystemTopicBasedTopicPoliciesService.java:148) ~[org.apache.pulsar-pulsar-broker-2.7.1.jar:2.7.1]
   PULSAR >	at org.apache.pulsar.broker.service.BacklogQuotaManager.getBacklogQuota(BacklogQuotaManager.java:85) ~[org.apache.pulsar-pulsar-broker-2.7.1.jar:2.7.1]
   PULSAR >	at org.apache.pulsar.broker.service.persistent.PersistentTopic.getBacklogQuota(PersistentTopic.java:2112) ~[org.apache.pulsar-pulsar-broker-2.7.1.jar:2.7.1]
   PULSAR >	at org.apache.pulsar.broker.service.persistent.PersistentTopic.isBacklogQuotaExceeded(PersistentTopic.java:2121) ~[org.apache.pulsar-pulsar-broker-2.7.1.jar:2.7.1]
   PULSAR >	at org.apache.pulsar.broker.service.ServerCnx.lambda$null$20(ServerCnx.java:1099) ~[org.apache.pulsar-pulsar-broker-2.7.1.jar:2.7.1]
   PULSAR >	at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:670) ~[?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646) ~[?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488) ~[?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1975) ~[?:1.8.0_282]
   PULSAR >	at org.apache.pulsar.broker.service.BrokerService$3.lambda$openLedgerComplete$1(BrokerService.java:1113) ~[org.apache.pulsar-pulsar-broker-2.7.1.jar:2.7.1]
   PULSAR >	at java.util.concurrent.CompletableFuture.uniRun(CompletableFuture.java:719) ~[?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:731) ~[?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2023) ~[?:1.8.0_282]
   PULSAR >	at org.apache.pulsar.broker.service.BrokerService$3.openLedgerComplete(BrokerService.java:1106) ~[org.apache.pulsar-pulsar-broker-2.7.1.jar:2.7.1]
   PULSAR >	at org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl.lambda$asyncOpen$8(ManagedLedgerFactoryImpl.java:425) ~[org.apache.pulsar-managed-ledger-2.7.1.jar:2.7.1]
   PULSAR >	at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:670) ~[?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646) ~[?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488) ~[?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1975) ~[?:1.8.0_282]
   PULSAR >	at org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl$2.initializeComplete(ManagedLedgerFactoryImpl.java:397) ~[org.apache.pulsar-managed-ledger-2.7.1.jar:2.7.1]
   PULSAR >	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl$3.operationComplete(ManagedLedgerImpl.java:476) ~[org.apache.pulsar-managed-ledger-2.7.1.jar:2.7.1]
   PULSAR >	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl$3.operationComplete(ManagedLedgerImpl.java:466) ~[org.apache.pulsar-managed-ledger-2.7.1.jar:2.7.1]
   PULSAR >	at org.apache.bookkeeper.mledger.impl.MetaStoreImpl.lambda$getCursors$8(MetaStoreImpl.java:122) ~[org.apache.pulsar-managed-ledger-2.7.1.jar:2.7.1]
   PULSAR >	at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:670) [?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646) [?:1.8.0_282]
   PULSAR >	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456) [?:1.8.0_282]
   PULSAR >	at org.apache.bookkeeper.common.util.OrderedExecutor$TimedRunnable.run(OrderedExecutor.java:203) [org.apache.bookkeeper-bookkeeper-common-4.12.0.jar:4.12.0]
   PULSAR >	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_282]
   PULSAR >	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_282]
   PULSAR >	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [io.netty-netty-common-4.1.51.Final.jar:4.1.51.Final]
   PULSAR >	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
   
   **To Reproduce**
   Steps to reproduce the behavior:
   Enable topicv level policies and create a topic with a retention policy
   
   **Expected behavior**
   No exception
   


-- 
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] frank-montyne closed issue #10231: Exception using topic level policies

Posted by GitBox <gi...@apache.org>.
frank-montyne closed issue #10231:
URL: https://github.com/apache/pulsar/issues/10231


   


-- 
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] frank-montyne commented on issue #10231: Exception using topic level policies

Posted by GitBox <gi...@apache.org>.
frank-montyne commented on issue #10231:
URL: https://github.com/apache/pulsar/issues/10231#issuecomment-820516354


   Yes every time I enable these settings and create a topic with a retention policy I get this error. One question though, I assume it is ok to set the retention policy on the namespace to 0 for size and time and override these settings on the topic level with for example size 100 and time -1.


-- 
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] frank-montyne commented on issue #10231: Exception using topic level policies

Posted by GitBox <gi...@apache.org>.
frank-montyne commented on issue #10231:
URL: https://github.com/apache/pulsar/issues/10231#issuecomment-822006989


   I also tried it with a locally running copy of 2.7.1 instead of our custom docker image. I also got no errors. There must be something wrong with our docker image. Sorry for the trouble!


-- 
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] frank-montyne commented on issue #10231: Exception using topic level policies

Posted by GitBox <gi...@apache.org>.
frank-montyne commented on issue #10231:
URL: https://github.com/apache/pulsar/issues/10231#issuecomment-822326642


   I created a new issue that more specifically pinpoints the issue
   #10263 


-- 
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] MarvinCai commented on issue #10231: Exception using topic level policies

Posted by GitBox <gi...@apache.org>.
MarvinCai commented on issue #10231:
URL: https://github.com/apache/pulsar/issues/10231#issuecomment-821983864


   @frank-montyne 
   I tried following steps but not able to reproduce.
   1. Run pulsar standalone.
   2. Set retention policy on namespace "public/default" with --size 0 --time 0
   3.  Set retention policy on topic "persistent://public/default/my-topic" with --size -1 --time 3h
   4. Create a pulsarclient then create a producer on this topic.
   Can you share the step you tried so we can try to reproduce the exception?


-- 
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] frank-montyne closed issue #10231: Exception using topic level policies

Posted by GitBox <gi...@apache.org>.
frank-montyne closed issue #10231:
URL: https://github.com/apache/pulsar/issues/10231


   


-- 
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 commented on issue #10231: Exception using topic level policies

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #10231:
URL: https://github.com/apache/pulsar/issues/10231#issuecomment-820347873


   @frank-montyne Is this issue can be reproduced stable? We have fixed some related issues in the https://github.com/apache/pulsar/pull/9781 in 2.7.1. 


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