You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/05/13 15:07:01 UTC

[GitHub] [hive] belugabehr opened a new pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

belugabehr opened a new pull request #2269:
URL: https://github.com/apache/hive/pull/2269


   


-- 
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.

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



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


[GitHub] [hive] belugabehr closed pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
belugabehr closed pull request #2269:
URL: https://github.com/apache/hive/pull/2269


   


-- 
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.

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



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


[GitHub] [hive] belugabehr commented on pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
belugabehr commented on pull request #2269:
URL: https://github.com/apache/hive/pull/2269#issuecomment-841454459


   @miklosgergely  `ObjectStore` cannot decide what it wants to be.  Each method has its own transaction handling, but there are times, such as in `HMSHandler::create_catalog` that wraps several methods under one using its own transaction handling.  We need to decide which one it will be, it cannot be both.  Based on the current usage, it looks to me like the Transaction handling should be removed from the ObjectStore code and moved up to whatever is wrapping it (HMSHandler for example).


-- 
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.

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



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


[GitHub] [hive] belugabehr commented on a change in pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
belugabehr commented on a change in pull request #2269:
URL: https://github.com/apache/hive/pull/2269#discussion_r631883645



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java
##########
@@ -160,10 +160,11 @@
    * @param catName name of the catalog to alter.
    * @param cat new version of the catalog.
    * @throws MetaException something went wrong, usually in the database.
+   * @throws NoSuchObjectException no catalog of this name exists.
    * @throws InvalidOperationException attempt to change something about the catalog that is not
    * changeable, like the name.
    */
-  void alterCatalog(String catName, Catalog cat) throws MetaException, InvalidOperationException;
+  void alterCatalog(String catName, Catalog cat) throws MetaException, NoSuchObjectException, InvalidOperationException;

Review comment:
       This should also throw NoSuchObjectException if user is attempting to alter a non-existing catalog




-- 
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.

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



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


[GitHub] [hive] belugabehr edited a comment on pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
belugabehr edited a comment on pull request #2269:
URL: https://github.com/apache/hive/pull/2269#issuecomment-841438042


   @miklosgergely Nothing about this project can be easy. Oh well. Thanks for the review, but clearly (based on the unit tests) this would be a bigger effort than I had imagined/hoped.


-- 
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.

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



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


[GitHub] [hive] github-actions[bot] closed pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #2269:
URL: https://github.com/apache/hive/pull/2269


   


-- 
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-unsubscribe@hive.apache.org

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



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


[GitHub] [hive] github-actions[bot] commented on pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #2269:
URL: https://github.com/apache/hive/pull/2269#issuecomment-881976843


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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-unsubscribe@hive.apache.org

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



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


[GitHub] [hive] belugabehr commented on pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
belugabehr commented on pull request #2269:
URL: https://github.com/apache/hive/pull/2269#issuecomment-841438042


   @miklosgergely Nothing about this project can be easy. Oh well. Thanks for the review, but clearly this would be a bigger effort than I had imagined/hoped.


-- 
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.

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



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


[GitHub] [hive] belugabehr commented on a change in pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
belugabehr commented on a change in pull request #2269:
URL: https://github.com/apache/hive/pull/2269#discussion_r631882813



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -642,112 +642,140 @@ public void rollbackTransaction() {
   @Override
   public void createCatalog(Catalog cat) throws MetaException {
     LOG.debug("Creating catalog {}", cat);
-    boolean committed = false;
+
     MCatalog mCat = catToMCat(cat);
+
+    final Transaction tx = pm.currentTransaction();
+
     try {
-      openTransaction();
+      tx.begin();
       pm.makePersistent(mCat);
-      committed = commitTransaction();
+      tx.commit();
     } finally {
-      if (!committed) {
-        rollbackTransaction();
+      if (tx.isActive()) {
+        tx.rollback();
       }
     }
   }
 
   @Override
   public void alterCatalog(String catName, Catalog cat)
-      throws MetaException, InvalidOperationException {
+      throws MetaException, InvalidOperationException, NoSuchObjectException {

Review comment:
       This should also throw NoSuchObjectException if user is attempting to alter a non-existing catalog




-- 
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.

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



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


[GitHub] [hive] belugabehr edited a comment on pull request #2269: HIVE-25111: Metastore Catalog Methods JDO Persistence

Posted by GitBox <gi...@apache.org>.
belugabehr edited a comment on pull request #2269:
URL: https://github.com/apache/hive/pull/2269#issuecomment-841454459


   @miklosgergely  `ObjectStore` cannot decide what it wants to be.  Each method has its own transaction handling, but there are times, such as in `HMSHandler::create_catalog` that wraps several methods under one transaction using its own transaction handling.  We need to decide which one it will be, it cannot be both.  Based on the current usage, it looks to me like the Transaction handling should be removed from the ObjectStore code and moved up to whatever is wrapping it (HMSHandler for example).


-- 
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.

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



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