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 2020/06/08 05:29:28 UTC

[GitHub] [pulsar] massakam opened a new pull request #7200: [broker] Prevent redirection of lookup requests from looping

massakam opened a new pull request #7200:
URL: https://github.com/apache/pulsar/pull/7200


   Master Issue: #7041
   
   ### Motivation
   
   Usually, the leader broker determines which broker owns which namespace bundle. The leader picks a broker to assign the bundle to based on each broker's load and redirects the lookup request with the "authoritative" flag set to true. The follower broker that receives the lookup request with the "authoritative" flag set to true will attempt to take ownership of the bundle.
   
   However, if the leader is not active, other brokers will also redirect lookup requests to the broker they consider to be the least loaded. In this case, the "authoritative" flag is false, so the broker being redirected may not try to take ownership of the bundle. The broker takes ownership of the bundle only if it considers itself the least loaded.
   
   This can cause a redirection loop if each broker considers a different broker is the least loaded. This redirection loop ends when a new leader is elected, but a large number of loops will cause `StackOverflowError` on the client side (see #7096).
   
   https://github.com/apache/pulsar/blob/6826040d32961e3e44f70622bcb89a116935ab68/pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java#L441-L461
   
   ### Modifications
   
   If the leader is not active, follower brokers that receive a lookup request will redirect it with the "authoritative" flag set to true. A broker that receives a request with the "authoritative" flag set to true will always try to take ownership of that bundle. This avoids the redirection loop.


----------------------------------------------------------------
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] massakam commented on pull request #7200: [broker] Prevent redirection of lookup requests from looping

Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #7200:
URL: https://github.com/apache/pulsar/pull/7200#issuecomment-640378706


   Please let me know if there is anything wrong with a non-leader broker redirecting lookup requests with the "authoritative" flag set to true.


----------------------------------------------------------------
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] merlimat merged pull request #7200: [broker] Prevent redirection of lookup requests from looping

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


   


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