[
https://issues.apache.org/jira/browse/BOOKKEEPER-407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457949#comment-13457949
]
Aniruddha commented on BOOKKEEPER-407:
--------------------------------------
Couple of comments about your patch.
1. We should use put() instead of replace().
2. Instead of using a ConcurrentLinkedQueue, we should use a Set. We don't want
any repeated values in host2Topics and a Set fits the use-case perfectly.
Collections.synchronizedSet() should give us the concurrency guarantees that
ConcurrentLinkedQueue does in terms of add, remove and get. We just have to
synchronize on the set while iterating over it.
> 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
>
>
> 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