[ 
https://issues.apache.org/jira/browse/GOBBLIN-1596?focusedWorklogId=708638&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-708638
 ]

ASF GitHub Bot logged work on GOBBLIN-1596:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jan/22 20:29
            Start Date: 13/Jan/22 20:29
    Worklog Time Spent: 10m 
      Work Description: umustafi commented on a change in pull request #3451:
URL: https://github.com/apache/gobblin/pull/3451#discussion_r784301329



##########
File path: 
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/metastore/HiveMetaStoreBasedRegister.java
##########
@@ -276,14 +276,16 @@ private boolean 
ensureHiveTableExistenceBeforeAlternation(String tableName, Stri
       Table table) throws TException, IOException{
     try (AutoCloseableHiveLock lock = this.locks.getTableLock(dbName, 
tableName)) {
       try {
-        if(!existsTable(dbName, tableName, client)) {
+        if (!existsTable(dbName, tableName, client)) {
           try (Timer.Context context = 
this.metricContext.timer(CREATE_HIVE_TABLE).time()) {
             client.createTable(getTableWithCreateTimeNow(table));
             log.info(String.format("Created Hive table %s in db %s", 
tableName, dbName));
             return true;
           }
         }
-      }catch (TException e) {
+      } catch (AlreadyExistsException ignore) {
+        // Table already exists, continue

Review comment:
       should we log this case?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 708638)
    Time Spent: 20m  (was: 10m)

> Ignore table AlreadyExistsException when adding a partition
> -----------------------------------------------------------
>
>                 Key: GOBBLIN-1596
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1596
>             Project: Apache Gobblin
>          Issue Type: Task
>          Components: gobblin-core
>    Affects Versions: 0.16.0
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Hive Registration throws an error when creating a table to add partitions to, 
> if the table already exists. Although we should have locks to prevent this, 
> we can't guard against other jobs that could also cause a race condition too. 
> We can ignore the exception in the error handling for 
> `ensureHiveTableExistenceBeforeAlternation`



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to