You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Vishal Kathuria (JIRA)" <ji...@apache.org> on 2011/08/18 22:01:32 UTC

[jira] [Updated] (ZOOKEEPER-1156) Log truncation truncating log too much - can cause data loss

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

Vishal Kathuria updated ZOOKEEPER-1156:
---------------------------------------

    Attachment: ZOOKEEPER-1156.patch

This patch includes the fix. It makes the following changes to PositionInputStream

1. In read, use rc > -1 instead of rc > 0 so the bytes with 0 value do not get skipped.
2. Overrided some functions related to marking. Idea is that if the user of this stream uses these functions, we shouldn't silently return incorrect position.



> Log truncation truncating log too much - can cause data loss
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1156
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1156
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: quorum, server
>    Affects Versions: 3.3.3
>            Reporter: Vishal Kathuria
>            Priority: Blocker
>             Fix For: 3.3.4
>
>         Attachments: ZOOKEEPER-1156.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The log truncation relies on position calculation for a particular zxid to figure out the new size of the log file. There is a bug in PositionInputStream implementation which skips counting the bytes in the log which have value 0. This can lead to underestimating the actual log size. The log records which should be there can get truncated, leading to data loss on the participant which is executing the trunc.
> Clients can see different values depending on whether they connect to the node on which trunc was executed. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira