You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Bill Bridge (JIRA)" <ji...@apache.org> on 2012/07/25 20:42:34 UTC

[jira] [Created] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Bill Bridge created ZOOKEEPER-1520:
--------------------------------------

             Summary: A txn log record with a corrupt sentinel byte looks like EOF
                 Key: ZOOKEEPER-1520
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
             Project: ZooKeeper
          Issue Type: Bug
          Components: server
    Affects Versions: 3.3.5
         Environment: all
            Reporter: Bill Bridge
            Priority: Minor


In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Updated] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Bill Bridge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Bridge updated ZOOKEEPER-1520:
-----------------------------------

    Attachment: init.out
    
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>         Attachments: init.out
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Updated] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Bill Bridge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Bridge updated ZOOKEEPER-1520:
-----------------------------------

    Attachment: ZOOKEEPER-1520.patch

I have attached a patch to throw an error if the sentinel byte is corrupt.Please review.
                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>         Attachments: ant.out, checkout.out, init.out, init.out, ZOOKEEPER-1520.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Commented] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422590#comment-13422590 ] 

Flavio Junqueira commented on ZOOKEEPER-1520:
---------------------------------------------

Did you mean to upload a patch, Bill? Your proposal sounds reasonable to me.
                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Commented] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13438843#comment-13438843 ] 

Hadoop QA commented on ZOOKEEPER-1520:
--------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12541774/ZOOKEEPER-1520.patch
  against trunk revision 1373156.

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1165//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1165//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1165//console

This message is automatically generated.
                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie, patch
>             Fix For: 3.3.6
>
>         Attachments: ant.out, checkout.out, init.out, init.out, ZOOKEEPER-1520.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Updated] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Bill Bridge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Bridge updated ZOOKEEPER-1520:
-----------------------------------

    Attachment: ant.out
                checkout.out
    
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>         Attachments: ant.out, checkout.out, init.out, init.out
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Updated] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Bill Bridge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Bridge updated ZOOKEEPER-1520:
-----------------------------------

    Attachment: init.out
    
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>         Attachments: ant.out, checkout.out, init.out, init.out
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Commented] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Bill Bridge (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422497#comment-13422497 ] 

Bill Bridge commented on ZOOKEEPER-1520:
----------------------------------------

This is a simple localized fix with a low probability of causing any problems. I want to do this to learn the process for making ZooKeeper contributions.
                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Commented] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Bill Bridge (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430693#comment-13430693 ] 

Bill Bridge commented on ZOOKEEPER-1520:
----------------------------------------

I have been unable to checkout the trunk and successfully run the tests. I am using a Solaris 10 SPARC machine, and I expect that is part of my problem.

I eventually get the following error after "ant test" runs for 35 minutes:
{quote}
/zookeeper/zookeeper-trunk/build.xml:1240: Execute failed: java.io.IOException: Cannot run program "autoreconf" (in directory "/zookeeper/zookeeper-trunk/src/c"): error=2, No such file or directory
{quote}
Here are the commands I enter:
{quote}
bash-3.00$ rm -rf zookeeper-trunk/bash-3.00$  svn checkout http://svn.apache.org/repos/asf/zookeeper/trunk/ zookeeper-trunk &>checkout.out
bash-3.00$ cd zookeeper-trunk/
bash-3.00$ ant init &>../init.out
bash-3.00$ ant test &>../ant.out
{quote}
I will attach the output files.

The autoreconf file is really missing. It seems to be related to compiling C code to run natively, which is why I expect it is a SPARC problem.

Am I doing something wrong or is development on SPARC Solaris really broken?

I am very much a newbie to large scale Java development such as ZooKeeper. The instructions on the how to contribute page were not sufficient for me. I had previously  downloaded zookeeper-3.3.5 and got it running under eclipse on windows. I found out the hard way that the procedure for a checked out version is quite different.

It would be nice to list the tools that should be installed such as ivy, eclipse, ant, ... and where they can be found for download. It is particularly important to specify which version of the JDK should be used since using a 1.7 feature in ZooKeeper would be bad if users are running a 1.6 JRE. I still do not know which JDK is appropriate.

A bit more explaination about how the build file works, and what it is capable of would be helpful. I have never used ant before so it took awhile to understand build.xml. A list of the high level targets, their intended use, and what they do would have told me that I did not need to find libraries like log4j online. I had never heard of ivy. Understanding why I should do something is better than just being told what to type.

                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>         Attachments: init.out
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Commented] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476020#comment-13476020 ] 

Flavio Junqueira commented on ZOOKEEPER-1520:
---------------------------------------------

Also, the sentinel being zero does not necessarily mean that there has been no corruption. I understand that it is a pretty good guess, though, because of the zeroing during preallocation. If it happens that there has been a corruption and we simply considered it as a partial record. Is it acceptable to have such a low probability corner case? I'm just pointing this out because the behavior wouldn't be consistent if we hit this case.  
                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Assignee: Bill Bridge
>            Priority: Minor
>              Labels: newbie, patch
>             Fix For: 3.3.6
>
>         Attachments: ant.out, checkout.out, init.out, init.out, ZOOKEEPER-1520.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

[jira] [Updated] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Flavio Junqueira updated ZOOKEEPER-1520:
----------------------------------------

    Assignee: Bill Bridge
    
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Assignee: Bill Bridge
>            Priority: Minor
>              Labels: newbie, patch
>             Fix For: 3.3.6
>
>         Attachments: ant.out, checkout.out, init.out, init.out, ZOOKEEPER-1520.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

[jira] [Commented] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Bill Bridge (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423382#comment-13423382 ] 

Bill Bridge commented on ZOOKEEPER-1520:
----------------------------------------

I intend to upload a patch as soon as I can build from an svn checkout, edit in eclipse, run the tests, and create a patch. This is an extremely complex process, and is not documented anywhere that I can find. Fortunately I have a friend that is an old hand at Java development. He is helping me find all the parts that are not in the trunk (e.g. eclipse, svn, ant, ivy, slf4j, log4j, ???), configuring eclipse to successfully compile, and getting the tests to run. At last report the tests were all failing due to some missing or misplaced component or parameter. I suspect our wandering in the dark is going to produce a different development environment than anyone else has. This will likely lead to future problems. 

Did I just not find the detailed description of how to take an empty machine that boots some freshly installed OS and turn it into a ZooKeeper development environment? It should start with which JDK to use (I chose jdk1.6.0), and where to download it. 
                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

        

[jira] [Commented] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475902#comment-13475902 ] 

Flavio Junqueira commented on ZOOKEEPER-1520:
---------------------------------------------

The patch looks good to me, thanks, Bill. I have a question about how to recover from such errors. With this patch, if there is a corrupt record, then we throw an exception, which I believe would prevent a server from starting. Does it mean that if we get a corrupt record on a given node, we won't be able to recover the data on the disk of that node?


                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Assignee: Bill Bridge
>            Priority: Minor
>              Labels: newbie, patch
>             Fix For: 3.3.6
>
>         Attachments: ant.out, checkout.out, init.out, init.out, ZOOKEEPER-1520.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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

[jira] [Commented] (ZOOKEEPER-1520) A txn log record with a corrupt sentinel byte looks like EOF

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13426199#comment-13426199 ] 

Patrick Hunt commented on ZOOKEEPER-1520:
-----------------------------------------

"ant test" is usually how we do it.

Also "ant eclipse" and then open the project in eclipse itself.

No need to download jars and such (slf/log/etc..) those will be d/l automatically by ant.


If the "how to contribute" page is not sufficient please let us know: https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute
                
> A txn log record with a corrupt sentinel byte looks like EOF
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1520
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1520
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.5
>         Environment: all
>            Reporter: Bill Bridge
>            Priority: Minor
>              Labels: newbie
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In Util.readTxnBytes() the sentinel is compared with 0x42 and if it does not match then the record is considered partially written and thus the EOF. However if it is a partial record the sentinel should be 0x00 since that is what the log is initialized with. Any other value would indicate corruption and should throw an IOException rather than indicate EOF. See [ZOOKEEPER-1453|https://issues.apache.org/jira/browse/ZOOKEEPER-1453] for a related issue. 

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