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 2022/03/14 16:20:37 UTC

[GitHub] [hive] wecharyu opened a new pull request #3104: HIVE-26036: NPE caused by getMTable() in ObjectStore

wecharyu opened a new pull request #3104:
URL: https://github.com/apache/hive/pull/3104


   
   ### What changes were proposed in this pull request?
   
   Some api in ObjectStore invoke `getMTable()` but not check that if the returned value is null, which may cause the NPE, like `addPartitions()`, `addPartition()`, `alterPartition()` et.
   
   Such api described above will check that whether the table exists in `HMSHandler` (first check), but if the table is dropped by other threads after the first check, the NPE will happen.
   
   **The simple idea is that we can check the table each time we get from `getMTable()`.**
   
   
   ### Why are the changes needed?
   
   To fix the NPE from `getMTable()` while others dropping this table.
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   No
   
   
   ### How was this patch tested?
   
   Just add one test in `TestObjectStore`, can use the minimal test command:
   ```
   mvn test -Dtest=org.apache.hadoop.hive.metastore.TestObjectStore#testPartitionOps -pl :hive-standalone-metastore-server
   ```
   


-- 
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] wecharyu commented on pull request #3104: HIVE-26036: NPE caused by getMTable() in ObjectStore

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


   @kgyrtkirk @marton-bod Could you pls review this PR?


-- 
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] wecharyu commented on pull request #3104: HIVE-26036: NPE caused by getMTable() in ObjectStore

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


   @kgyrtkirk @marton-bod Could you pls review this PR?


-- 
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] marton-bod commented on a change in pull request #3104: HIVE-26036: NPE caused by getMTable() in ObjectStore

Posted by GitBox <gi...@apache.org>.
marton-bod commented on a change in pull request #3104:
URL: https://github.com/apache/hive/pull/3104#discussion_r831165554



##########
File path: standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java
##########
@@ -393,6 +393,14 @@ public void testPartitionOps() throws Exception {
     try (AutoCloseable c = deadline()) {
       objectStore.addPartition(part2);
     }
+    List<String> value3 = Arrays.asList("US", "MA");

Review comment:
       Can you add test cases for the other changed API methods too? Maybe create a new method for them, e.g. `testPartitionOpsWhenTableDoesNotExist`? This test method already seems quite messy and cluttered so maybe it's worth separating it out




-- 
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] marton-bod commented on pull request #3104: HIVE-26036: NPE caused by getMTable() in ObjectStore

Posted by GitBox <gi...@apache.org>.
marton-bod commented on pull request #3104:
URL: https://github.com/apache/hive/pull/3104#issuecomment-1077378170


   @wecharyu merged it - thanks for the fix!


-- 
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] marton-bod merged pull request #3104: HIVE-26036: NPE caused by getMTable() in ObjectStore

Posted by GitBox <gi...@apache.org>.
marton-bod merged pull request #3104:
URL: https://github.com/apache/hive/pull/3104


   


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