[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456931#comment-13456931
 ] 

Sijie Guo commented on BOOKKEEPER-407:
--------------------------------------

in most of case, putIfAbsent works OK, since the topic ownership will be 
cleared when a channel disconnected. only a corner case it would made bad, when 
a hub server failed to acquire ownership due to ZooKeeper failure and respond 
SERVICE_DOWN exception. since client could not tell whether it acquire the 
topic succeed or not and it might set a wrong owner. but it is trivial, since 
redirect could help find the right owner.

as my comment in 
https://issues.apache.org/jira/browse/BOOKKEEPER-392?focusedCommentId=13448270&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13448270,
 I used replace instead of putIfAbsent for BOOKKEEPER-364.

besides that, I think it would be better to add specific exception for failure 
of getting ownership, so client could know whether it could set topic ownership 
or not.
                
> Hedwig client doesn't remove old topic2Host mapping in case of redirect
> -----------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-407
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-407
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Aniruddha
>
> In the storeTopic2HostMapping function, there is a topic2Host.putIfAbsent(). 
> This doesn't seem correct as we should always update the mapping in case of a 
> redirect. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to