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

Sahil Takiar commented on HIVE-15093:
-------------------------------------

[~poeppt], [~spena]

I agree that ideally this should be fixed in s3a. This patch is more of a 
stop-gap solution until this is fixed in HADOOP-13600. However, that could be a 
while. I don't know when the fix in s3a will land, the current JIRA has a 
Target Version of 2.9.0 and I don't know when that will be released.

I think it's still worth adding this to Hive even if it will be reverted once 
Hadoop 2.9.0 is released (whenever that will be). We have seen this portion of 
the code become a bottleneck for any Hive questions on S3, because all data on 
S3 needs to be renamed sequentially, by a single process.

I think the burden is still on the blobstore connectors to implement efficient 
rename of directories. We can just make this specific patch s3a specific.

I like the idea of moving the logic into the BlobStorageUtils class so that 
other components can re-use this optimization. This should make it much easier 
to remove in the future too.

> For S3-to-S3 renames, files should be moved individually rather than at a 
> directory level
> -----------------------------------------------------------------------------------------
>
>                 Key: HIVE-15093
>                 URL: https://issues.apache.org/jira/browse/HIVE-15093
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Hive
>    Affects Versions: 2.1.0
>            Reporter: Sahil Takiar
>            Assignee: Sahil Takiar
>         Attachments: HIVE-15093.1.patch
>
>
> Hive's MoveTask uses the Hive.moveFile method to move data within a 
> distributed filesystem as well as blobstore filesystems.
> If the move is done within the same filesystem:
> 1: If the source path is a subdirectory of the destination path, files will 
> be moved one by one using a threapool of workers
> 2: If the source path is not a subdirectory of the destination path, a single 
> rename operation is used to move the entire directory
> The second option may not work well on blobstores such as S3. Renames are not 
> metadata operations and require copying all the data. Client connectors to 
> blobstores may not efficiently rename directories. Worst case, the connector 
> will copy each file one by one, sequentially rather than using a threadpool 
> of workers to copy the data (e.g. HADOOP-13600).
> Hive already has code to rename files using a threadpool of workers, but this 
> only occurs in case number 1.
> This JIRA aims to modify the code so that case 1 is triggered when copying 
> within a blobstore. The focus is on copies within a blobstore because 
> needToCopy will return true if the src and target filesystems are different, 
> in which case a different code path is triggered.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to