You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2020/04/20 13:48:00 UTC

[jira] [Comment Edited] (HIVE-4897) Hive should handle AlreadyExists on retries when creating tables/partitions

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

David Mollitor edited comment on HIVE-4897 at 4/20/20, 1:47 PM:
----------------------------------------------------------------

I think this is often achieved with an 'updated' timestamp value in the database schema.  When a request is generated, the client puts in a timestamp.  If the operation fails and is re-submitted, if the 'updated' timestamp matches the requests then a success is returned, otherwise, if the timestamp in HMS is older, than the retry happens again.  And obvious the 'updated' value is updated to match the request's timestamp on success.


was (Author: belugabehr):
I think this is often achieved with an 'updated' timestamp value in the database schema.  When a request is generated, the client puts in a timestamp.  If the operation fails and is re-submitted, if the 'updated' timestamp matches the requests then a success is returned, otherwise, if the timestamp in HMS is older, than the retry happens again.

> Hive should handle AlreadyExists on retries when creating tables/partitions
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-4897
>                 URL: https://issues.apache.org/jira/browse/HIVE-4897
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Aihua Xu
>            Priority: Major
>         Attachments: hive-snippet.log
>
>
> Creating new tables/partitions may fail with an AlreadyExistsException if there is an error part way through the creation and the HMS tries again without properly cleaning up or checking if this is a retry.
> While partitioning a new table via a script on distributed hive (MetaStore on the same machine) there was a long timeout and then:
> {code}
> FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. AlreadyExistsException(message:Partition already exists:Partition( ...
> {code}
> I am assuming this is due to retry. Perhaps already-exists on retry could be handled better.
> A similar error occurred while creating a table through Impala, which issued a single createTable call that failed with an AlreadyExistsException. See the logs related to table tmp_proc_8_d2b7b0f133be455ca95615818b8a5879_7 in the attached hive-snippet.log



--
This message was sent by Atlassian Jira
(v8.3.4#803005)