Flavio Junqueira commented on ZOOKEEPER-882:

I agree with your description of the behavior of next, and sounds right to me 
that we should be setting hdr and calling "return next();" at the end of the 
catch block.

Regarding init(), we first use the value of zxid to determine which log files 
to read: all log files tagged with a value higher than zxid and the last log 
file that is less than zxid. Next we iterate over the log files until 
hdr.getZxid() is greater or equal to zxid (should be zxid really). This 
guarantees that the next call to next(), after init() returns, will return 
zxid+1. Does it sound right to you?

> Startup loads last transaction from snapshot
> --------------------------------------------
>                 Key: ZOOKEEPER-882
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-882
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: server
>            Reporter: Jared Cantwell
>            Priority: Minor
>         Attachments: 882.diff
> On startup, the server first loads the latest snapshot, and then loads from 
> the log starting at the last transaction in the snapshot.  It should begin 
> from one past that last transaction in the log.  I will attach a possible 
> patch.

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