[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13950762#comment-13950762
 ] 

Rakesh R commented on ZOOKEEPER-1797:
-------------------------------------

[~fpj] I've reviewed the code, AFAIK both autopurge and cron job will be 
affected and can mistakenly delete the log or snap files. Kindly see the 
proposed patch when you get sometime. Also, I've tried to simulate the case 
through one test case. Thanks.

+Proposed algo:+
If logs are rolling or a new snapshot is created during this process, these 
newest N snapshots or logs will be excluded from current purging cycle. Here my 
idea is not to loose any info, anyway it can be taken care on next cycle.

> PurgeTxnLog may delete data logs during roll
> --------------------------------------------
>
>                 Key: ZOOKEEPER-1797
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1797
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.5
>            Reporter: Derek Dagit
>            Assignee: Rakesh R
>            Priority: Critical
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1797.patch
>
>
> org.apache.zookeeper.server.PurgeTxnLog deletes old data logs and snapshots, 
> keeping the newest N snapshots and any data logs that have been written since 
> the snapshot.
> It does this by listing the available snapshots & logs and creates a 
> blacklist of snapshots and logs that should not be deleted.  Then, it 
> searches for and deletes all logs and snapshots that are not in this list.
> It appears that if logs are rolling or a new snapshot is created during this 
> process, then these newer files will be unintentionally deleted.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to