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

Vinay commented on BOOKKEEPER-347:
----------------------------------

Hi Ivan,

{quote}The problem is that, in BookieWatcher, you remove the READONLY znode, 
which only removes "readonly" from the list, not the znodes under 
"readonly"{quote}
Here, everytime getChildren() is called, new list of children itself will be 
used as knownbookies. This list contains only one level of znodes. i.e. It 
doesn't contains the znodes under 'readonly', but it contains 'readonly'.

Since, during transition to readOnly, we will unregister from 'available' and 
register under 'readonly' znode, getChildren(..) call will not have this 
transitioned bookie address. So this bookie will be removed automatically from 
available bookies on watcher event.

Only thing we need to do is, to avoid closing of the readonly bookie clients, 
we can add watcher on 'readonly' znode and keep track of readonly bookies, and 
avoid closing of clients for readonly bookies.

In the above Test, 
I was trying to simulate the transitionToReadOnly. Anyway I corrected the test 
by directly using the {{Bookie.transitionToReadOnly()}}.

One small change required in {{Bookie.transitionToReadOnly()}} is the order of 
creating the readonly ephemeral node and deleting the available ephemeral node 
should be changed to get the updated list of readonly bookies first.

I will post a patch soon regarding these..

                
>  Provide mechanism to detect r-o bookie by the bookie clients
> -------------------------------------------------------------
>
>                 Key: BOOKKEEPER-347
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-347
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Rakesh R
>            Assignee: Vinay
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-347.patch, BOOKKEEPER-347.patch
>
>
> This jira to discuss, how the bookie client knows about the bookie running in 
> r-o. This would be required by the client to choose writable bookies during 
> add entries. 

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