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

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

{quote}
Right after the host.equals(topic2Host.get..) statement, someone might call 
replace() and we would still be in an inconsistent state.
{quote}

first of all, I agreed that it is OK to have inverse mapping inconsistency as 
your comment.

I would explain the code added above how to handle the case described:

1) req1: topic1 replace owner0 -> owner1
2) req1: adding topic1 to owner1's topic set
3) req2: topic1 replace owner1 -> owner2
4) req2: clear topic1 from owner1's topic set

if 4) executed before 2) then, topic1 would be owner1's topic set. adding the 
above code, when we want to  adding a topic to the topic set, we check the 
topic owner again. if the topic owner changed (means 3 has been executed), so 
we don't put the topic to the host's topic set.

adding the above code could improve some kind of consistency with little cost. 
so I think it worths doing that. how is your opinion?

                
> 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
>             Fix For: 4.2.0
>
>         Attachments: BK-407.patch, BOOKKEEPER-407.diff
>
>
> 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. 
> Reviewboard : https://reviews.apache.org/r/7139/

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