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 2022/07/07 09:50:53 UTC

[GitHub] [pulsar] gaozhangmin opened a new pull request, #16438: Metadatastore deadlock

gaozhangmin opened a new pull request, #16438:
URL: https://github.com/apache/pulsar/pull/16438

   1、This issue is triggered by namespace policies update. When namespace policies updated, `handlePoliciesUpdates` will be called next to update all the topics policies under this namespace. Too many topics would cause metadata-store waiting.
   
   https://github.com/apache/pulsar/blob/318432ed1f16e60a088f3dca1b14891d582726a9/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L2034-L2062
   ![image](https://user-images.githubusercontent.com/9278488/177733636-bfd343b1-2e89-4a02-89f2-8fa61c8f9def.png)
   
   ### Modifications
   
   Use thenAcceptAsync instead, execute `update topic policies` in a separated executor.
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [x] `doc-not-needed` 


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] Technoboy- commented on a diff in pull request #16438: [improve][metadataStore] Update namespace policies would cause metadata-store thread waiting too long

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on code in PR #16438:
URL: https://github.com/apache/pulsar/pull/16438#discussion_r916408135


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -2045,20 +2045,20 @@ private void handlePoliciesUpdates(NamespaceName namespace) {
                         if (namespace.includes(TopicName.get(name))) {
                             // If the topic is already created, immediately apply the updated policies, otherwise
                             // once the topic is created it'll apply the policies update
-                            topicFuture.thenAccept(topic -> {
+                            topicFuture.thenAcceptAsync(topic -> {
                                 if (log.isDebugEnabled()) {
                                     log.debug("Notifying topic that policies have changed: {}", name);
                                 }
 
                                 topic.ifPresent(t -> t.onPoliciesUpdate(policies));
-                            });
+                            }, pulsar.getExecutor());

Review Comment:
   Maybe we don't need to add executor here. 



-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] Technoboy- merged pull request #16438: [improve][metadataStore] Update namespace policies would cause metadata-store thread waiting too long

Posted by GitBox <gi...@apache.org>.
Technoboy- merged PR #16438:
URL: https://github.com/apache/pulsar/pull/16438


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] codelipenghui commented on a diff in pull request #16438: [improve][metadataStore] Update namespace policies would cause metadata-store thread waiting too long

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on code in PR #16438:
URL: https://github.com/apache/pulsar/pull/16438#discussion_r916408854


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -2015,7 +2015,7 @@ private void handleLocalPoliciesUpdates(NamespaceName namespace) {
                         if (namespace.includes(TopicName.get(name))) {
                             // If the topic is already created, immediately apply the updated policies, otherwise
                             // once the topic is created it'll apply the policies update
-                            topicFuture.thenAccept(topic -> {
+                            topicFuture.thenAcceptAsync(topic -> {

Review Comment:
   Why we need to switch the thread again here? In most case the topicFuture is completed, if the topicFuture is completed, we'd better make it execute in current thread.



-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] gaozhangmin commented on pull request #16438: [improve][metadataStore] Update namespace policies would cause metadata-store thread waiting too long

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on PR #16438:
URL: https://github.com/apache/pulsar/pull/16438#issuecomment-1181339326

   > @gaozhangmin Could we try to use web thread pool to instead of pulsar thread pool?
   
   Why ? i think we should use pulsar thread pool on server side.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] gaozhangmin commented on pull request #16438: [improve][metadataStore] Update namespace policies would cause metadata-store thread waiting too long

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on PR #16438:
URL: https://github.com/apache/pulsar/pull/16438#issuecomment-1181223642

   /pulsarbot run-failure-checks


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] mattisonchao commented on a diff in pull request #16438: [improve][metadataStore] Update namespace policies would cause metadata-store thread waiting too long

Posted by GitBox <gi...@apache.org>.
mattisonchao commented on code in PR #16438:
URL: https://github.com/apache/pulsar/pull/16438#discussion_r916408591


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -2045,20 +2045,20 @@ private void handlePoliciesUpdates(NamespaceName namespace) {
                         if (namespace.includes(TopicName.get(name))) {
                             // If the topic is already created, immediately apply the updated policies, otherwise
                             // once the topic is created it'll apply the policies update
-                            topicFuture.thenAccept(topic -> {
+                            topicFuture.thenAcceptAsync(topic -> {

Review Comment:
   The context thread is changed by line 2036, maybe we don't need to change it 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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] mattisonchao commented on pull request #16438: [improve][metadataStore] Update namespace policies would cause metadata-store thread waiting too long

Posted by GitBox <gi...@apache.org>.
mattisonchao commented on PR #16438:
URL: https://github.com/apache/pulsar/pull/16438#issuecomment-1179949818

   @gaozhangmin  Could we try to use web thread pool to instead of pulsar thread pool? 


-- 
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: commits-unsubscribe@pulsar.apache.org

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