Henry Robinson commented on ZOOKEEPER-784:

I like the idea of fake sessions fine, although I think that the upgrade 
process might be complex. Another possibility is to do away with sessions in 
read-only mode (because they're mainly used to maintain state about watches, 
which don't make sense on a read-only server).

Sergey - just looked over your patch. Nice job! Couple of questions:

1. In QuorumPeer.java, I can't quite follow the logic in this part of the patch:

while (running) {
                 switch (getPeerState()) {
                 case LOOKING:
+                    LOG.info("LOOKING");
+                    ReadOnlyZooKeeperServer roZk = null;
                     try {
-                        LOG.info("LOOKING");
+                        roZk = new ReadOnlyZooKeeperServer(
+                                    logFactory, this,
+                                    new ZooKeeperServer.BasicDataTreeBuilder(),
+                                    this.zkDb);
+                        roZk.startup();

- is it sensible to start a ROZKServer every time a server enters the 'LOOKING' 
state, or should there be some kind of delay before it decides it is 
partitioned? Otherwise when a leader is lost and the quorum is doing a 
re-election, r/w clients that try and connect would get (I think) 'can't be 
read-only' messages .

2. What are you doing about watches? It seems to me that setting a watch turns 
a read operation into a read / write operation, and the client should be told 
that watch registration failed. If you can do this you don't have to worry so 
much about session migration because there's very little session state 
maintained by a ROZKServer on behalf of the client.

3. This patch has got to the point where it might be good if you started adding 
some tests to validate any further development you do. 

> server-side functionality for read-only mode
> --------------------------------------------
>                 Key: ZOOKEEPER-784
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-784
>             Project: Zookeeper
>          Issue Type: Sub-task
>            Reporter: Sergey Doroshenko
>            Assignee: Sergey Doroshenko
>         Attachments: ZOOKEEPER-784.patch, ZOOKEEPER-784.patch, 
> ZOOKEEPER-784.patch
> As per http://wiki.apache.org/hadoop/ZooKeeper/GSoCReadOnlyMode , create 
> ReadOnlyZooKeeperServer which comes into play when peer is partitioned.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to