> On Nov. 16, 2012, 7:48 p.m., Roshan Naik wrote:
> > why not simplify it to ..
> > 
> > 
> > //  delete log.meta  
> > //  log.meta.tmp -> log.meta
> >
> 
> Hari Shreedharan wrote:
>     I am not entirely sure how all platforms handle renames. Depending on 
> implementation, though highly unlikely, if the system crashes in the middle 
> of a rename, the tmp file might disappear without the ".meta" file being 
> created. Leaving the old file guarantees that either the old or the new file 
> is available at any point in time. 
>     
>     I am just being paranoid about it since I don't know how different 
> operating systems implement renames (for example, Windows does not seem to 
> give many guarantees about durability in the event of a crash during a rename)

Do we ever look for log.meta.old? If not, I think we should look for it @ 
startup time if log.meta does not exist.

Roshan: If we lose the meta file on an encrypted file channel, we are screwed 
because the meta file contains the initialization vector for AES/CTR/Nopadding. 
The data will be irrecovably lost.


- Mike


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/8087/#review13525
-----------------------------------------------------------


On Nov. 16, 2012, 7:26 p.m., Hari Shreedharan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/8087/
> -----------------------------------------------------------
> 
> (Updated Nov. 16, 2012, 7:26 p.m.)
> 
> 
> Review request for Flume.
> 
> 
> Description
> -------
> 
> If atomic rename fails, rename the current meta file to old, rename tmp to 
> meta and then delete old.
> 
> 
> This addresses bug FLUME-1699.
>     https://issues.apache.org/jira/browse/FLUME-1699
> 
> 
> Diffs
> -----
> 
>   
> flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/LogFileV3.java
>  f768d23 
> 
> Diff: https://reviews.apache.org/r/8087/diff/
> 
> 
> Testing
> -------
> 
> All unit tests pass
> 
> 
> Thanks,
> 
> Hari Shreedharan
> 
>

Reply via email to