dengzhhu653 commented on PR #5780:
URL: https://github.com/apache/hive/pull/5780#issuecomment-2840565842

   > > if we rollback at the place1, doesn't it mean we get an unexpected 
exception here, why do we continue to execute to place2?
   > 
   > @dengzhhu653 There are some cases where rollback transaction does not need 
fail the api calls, for example `create_xxx` will always check if it already 
exists by `get_xxx` that throw expected `NoSuchObjectException`, in this case 
we should continue other queries.
   
   Per my understanding, this shouldn't happen, imaging we rollback the 
transaction at place1, then the ObjectStore `openTrasactionCalls` is reset to 
0, if we continue to execute, then means we have one `openTransaction` and two 
`commitTransaction`, the `commitTransaction` at place2 should throw the 
exception:
   ```
   if (openTrasactionCalls <= 0) {
         RuntimeException e = new RuntimeException("commitTransaction was 
called but openTransactionCalls = "
             + openTrasactionCalls + ". This probably indicates that there are 
unbalanced " +
             "calls to openTransaction/commitTransaction");
         LOG.error("Unbalanced calls to open/commit Transaction", e);
         throw e;
    }
   ```
   the Metastore client call should get this exception, but our tests work fine.
   


-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to