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

Ramit Gupta updated HIVE-30281:
-------------------------------
    Description: {{Hive.copyFiles}} moves each task's staged file, such as 
{{{}000000_0{}}}, into the table or partition directory. {{pickDestFilePath}} 
checks {{exists()}} and, when that name is free, {{mvFile}} renames the staged 
file to it. Two inserts can both observe the name as missing and both call 
rename. On HDFS, {{FileSystem.rename(Path, Path)}} returns false and leaves the 
source in place when the destination already exists. {{mvFile}} ignored that 
return value and reported the move as successful. The staging directory is 
removed afterward, so the loser's file is deleted while the query still 
succeeds.

> Title: File loss when concurrent inserts attempts HDFS rename on same 
> destination path
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-30281
>                 URL: https://issues.apache.org/jira/browse/HIVE-30281
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ramit Gupta
>            Assignee: Ramit Gupta
>            Priority: Major
>
> {{Hive.copyFiles}} moves each task's staged file, such as {{{}000000_0{}}}, 
> into the table or partition directory. {{pickDestFilePath}} checks 
> {{exists()}} and, when that name is free, {{mvFile}} renames the staged file 
> to it. Two inserts can both observe the name as missing and both call rename. 
> On HDFS, {{FileSystem.rename(Path, Path)}} returns false and leaves the 
> source in place when the destination already exists. {{mvFile}} ignored that 
> return value and reported the move as successful. The staging directory is 
> removed afterward, so the loser's file is deleted while the query still 
> succeeds.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to