You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Camille Fournier (Assigned) (JIRA)" <ji...@apache.org> on 2011/11/05 20:26:51 UTC

[jira] [Assigned] (ZOOKEEPER-1282) Learner.java not following Zab 1.0 protocol - setCurrentEpoch should be done upon receipt of NEWLEADER (before acking it) and not upon receipt of UPTODATE

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Camille Fournier reassigned ZOOKEEPER-1282:
-------------------------------------------

    Assignee: Benjamin Reed
    
> Learner.java not following Zab 1.0 protocol - setCurrentEpoch should be done upon receipt of NEWLEADER (before acking it) and not upon receipt of UPTODATE
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1282
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1282
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.4.0
>            Reporter: Alexander Shraer
>            Assignee: Benjamin Reed
>
> according to https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab1.0
> phase 2 part 2, "Once it receives NEWLEADER(e) it atomically applies
> the new state and sets f.currentEpoch =e. "
> In Learner.java self.setCurrentEpoch(newEpoch) is done after receiving
> UPTODATE and not before acking the NEWLEADER message as should be.
>                 case Leader.UPTODATE:
>                     if (!snapshotTaken) {
>                         zk.takeSnapshot();
>                     }
>                     self.cnxnFactory.setZooKeeperServer(zk);
>                     break outerLoop;
>                 case Leader.NEWLEADER: // it will be NEWLEADER in v1.0
>                     zk.takeSnapshot();
>                     snapshotTaken = true;
>                     writePacket(new QuorumPacket(Leader.ACK,
> newLeaderZxid, null, null), true);
>                     break;
>                 }
>             }
>         }
>         long newEpoch = ZxidUtils.getEpochFromZxid(newLeaderZxid);
>         self.setCurrentEpoch(newEpoch);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira