-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60303/
-----------------------------------------------------------

Review request for hive, Carl Steinbach, Anthony Hsu, and Ratandeep Ratti.


Bugs: HIVE-16908
    https://issues.apache.org/jira/browse/HIVE-16908


Repository: hive-git


Description
-------

HIVE-16908: Update table and partition replication tests to not use 2nd HCat 
instance

HIVE-16844 fixed a connection leak issue which subsequently exposed failures in 
TestHCatClient. The connection leak gets triggered if a metastore instance is 
updated with a different JDO configuration. TestHCatClient uses 2 metastore 
instances to test replication related methods. Unfortunately, it does so by 
providing a different derby db name for the second instance. Since the 2 
metastores run in the same JVM, the path fixed in HIVE-16844 gets triggered, 
resulting in "sourceMetastore"'s connection being closed and thus resulting in 
failures.

It appears to me that running 2 metastore instances within the same JVM is 
error prone as there could be unintentional side-effects due to statics in the 
code (as was exposed by fixing HIVE-16844). This patch provides a way to test 
the replication related methods without involving a second instance. The 
changes mainly validate the serialize/deserialize methods. One of the tests, 
testPartitionRegistrationWithCustomSchema, uses addPartitions method to verify 
propogation of changes and it appeared that addPartitions wasn't covered by 
other tests in TestHCatClient and there wasn't a better way to verify the 
intended path, so I used an approach where the original database and table are 
dropped and recreated using the serialized-string and captured partition spec.


Diffs
-----

  
hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/TestHCatClient.java
 86d3acbcb462d244fa2dc2f48923aab1e3ccee66 


Diff: https://reviews.apache.org/r/60303/diff/1/


Testing
-------

mvn test -DTest=TestHCatClient now passes.


Thanks,

Sunitha Beeram

Reply via email to